File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
source/adapters/level_zero Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -556,11 +556,19 @@ ur_result_t urEnqueueDeviceGlobalVariableRead(
556556) {
557557 std::scoped_lock<ur_shared_mutex> lock (Queue->Mutex );
558558
559+ ze_module_handle_t ZeModule{};
560+ auto It = Program->ZeModuleMap .find (Queue->Device ->ZeDevice );
561+ if (It != Program->ZeModuleMap .end ()) {
562+ ZeModule = It->second ;
563+ } else {
564+ ZeModule = Program->ZeModule ;
565+ }
566+
559567 // Find global variable pointer
560568 size_t GlobalVarSize = 0 ;
561569 void *GlobalVarPtr = nullptr ;
562570 ZE2UR_CALL (zeModuleGetGlobalPointer,
563- (Program-> ZeModule , Name, &GlobalVarSize, &GlobalVarPtr));
571+ (ZeModule, Name, &GlobalVarSize, &GlobalVarPtr));
564572 if (GlobalVarSize < Offset + Count) {
565573 setErrorMessage (" Read from device global variable is out of range." ,
566574 UR_RESULT_ERROR_INVALID_VALUE,
You can’t perform that action at this time.
0 commit comments