Skip to content

Commit cbb1935

Browse files
committed
Merge pull request #2106 from winstonzhang-intel/URLZA-391
[L0] Fix urEnqueueDeviceGlobalVariableRead to use device specific modules
1 parent 672ac18 commit cbb1935

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

source/adapters/level_zero/kernel.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,11 +661,19 @@ ur_result_t ur_queue_handle_legacy_t_::enqueueDeviceGlobalVariableRead(
661661

662662
std::scoped_lock<ur_shared_mutex> lock(Queue->Mutex);
663663

664+
ze_module_handle_t ZeModule{};
665+
auto It = Program->ZeModuleMap.find(Queue->Device->ZeDevice);
666+
if (It != Program->ZeModuleMap.end()) {
667+
ZeModule = It->second;
668+
} else {
669+
ZeModule = Program->ZeModule;
670+
}
671+
664672
// Find global variable pointer
665673
size_t GlobalVarSize = 0;
666674
void *GlobalVarPtr = nullptr;
667675
ZE2UR_CALL(zeModuleGetGlobalPointer,
668-
(Program->ZeModule, Name, &GlobalVarSize, &GlobalVarPtr));
676+
(ZeModule, Name, &GlobalVarSize, &GlobalVarPtr));
669677
if (GlobalVarSize < Offset + Count) {
670678
setErrorMessage("Read from device global variable is out of range.",
671679
UR_RESULT_ERROR_INVALID_VALUE,

0 commit comments

Comments
 (0)