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 @@ -661,11 +661,19 @@ ur_result_t ur_queue_handle_legacy_t_::enqueueDeviceGlobalVariableRead(
661
661
662
662
std::scoped_lock<ur_shared_mutex> lock (Queue->Mutex );
663
663
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
+
664
672
// Find global variable pointer
665
673
size_t GlobalVarSize = 0 ;
666
674
void *GlobalVarPtr = nullptr ;
667
675
ZE2UR_CALL (zeModuleGetGlobalPointer,
668
- (Program-> ZeModule , Name, &GlobalVarSize, &GlobalVarPtr));
676
+ (ZeModule, Name, &GlobalVarSize, &GlobalVarPtr));
669
677
if (GlobalVarSize < Offset + Count) {
670
678
setErrorMessage (" Read from device global variable is out of range." ,
671
679
UR_RESULT_ERROR_INVALID_VALUE,
You can’t perform that action at this time.
0 commit comments