Skip to content

Commit e87f68d

Browse files
committed
fix build
1 parent f071e84 commit e87f68d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

source/loader/layers/sanitizer/asan_shadow_setup.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ ur_result_t SetupShadowMemory(ur_context_handle_t Context, uptr &ShadowBegin,
134134
// multiple contexts. Therefore, we just create one shadow memory here.
135135
static ur_result_t Result = [&Context]() {
136136
// TODO: Protect Bad Zone
137-
auto Result = context.urDdiTable.VirtualMem.pfnReserve(
137+
auto Result = getContext()->urDdiTable.VirtualMem.pfnReserve(
138138
Context, nullptr, SHADOW_SIZE, (void **)&LOW_SHADOW_BEGIN);
139139
if (Result == UR_RESULT_SUCCESS) {
140140
HIGH_SHADOW_END = LOW_SHADOW_BEGIN + SHADOW_SIZE;
141141
// Retain the context which reserves shadow memory
142142
ShadowContext = Context;
143-
context.urDdiTable.Context.pfnRetain(Context);
143+
getContext()->urDdiTable.Context.pfnRetain(Context);
144144
}
145145
return Result;
146146
}();
@@ -154,9 +154,9 @@ ur_result_t DestroyShadowMemory() {
154154
if (!ShadowContext) {
155155
return UR_RESULT_SUCCESS;
156156
}
157-
auto Result = context.urDdiTable.VirtualMem.pfnFree(
157+
auto Result = getContext()->urDdiTable.VirtualMem.pfnFree(
158158
ShadowContext, (const void *)LOW_SHADOW_BEGIN, SHADOW_SIZE);
159-
context.urDdiTable.Context.pfnRelease(ShadowContext);
159+
getContext()->urDdiTable.Context.pfnRelease(ShadowContext);
160160
return Result;
161161
}();
162162
return Result;

source/loader/layers/sanitizer/ur_sanitizer_utils.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ DeviceType GetDeviceType(ur_context_handle_t Context,
129129
case UR_DEVICE_TYPE_GPU: {
130130
uptr Ptr;
131131
[[maybe_unused]] ur_result_t Result =
132-
context.urDdiTable.USM.pfnDeviceAlloc(Context, Device, nullptr,
133-
nullptr, 4, (void **)&Ptr);
134-
context.logger.debug("GetDeviceType: {}", (void *)Ptr);
132+
getContext()->urDdiTable.USM.pfnDeviceAlloc(
133+
Context, Device, nullptr, nullptr, 4, (void **)&Ptr);
134+
getContext()->logger.debug("GetDeviceType: {}", (void *)Ptr);
135135
assert(Result == UR_RESULT_SUCCESS &&
136136
"getDeviceType() failed at allocating device USM");
137137
// FIXME: There's no API querying the address bits of device, so we guess it by the
@@ -142,7 +142,7 @@ DeviceType GetDeviceType(ur_context_handle_t Context,
142142
} else {
143143
Type = DeviceType::GPU_DG2;
144144
}
145-
Result = context.urDdiTable.USM.pfnFree(Context, (void *)Ptr);
145+
Result = getContext()->urDdiTable.USM.pfnFree(Context, (void *)Ptr);
146146
assert(Result == UR_RESULT_SUCCESS &&
147147
"getDeviceType() failed at releasing device USM");
148148
return Type;

0 commit comments

Comments
 (0)