Skip to content

Commit 1b45a8a

Browse files
committed
Don't retain device handle references in sanitizer layer.
Also use uint32_t for Debug value.
1 parent 0abf370 commit 1b45a8a

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

source/loader/layers/sanitizer/asan_interceptor.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,8 +708,7 @@ ur_result_t SanitizerInterceptor::prepareLaunch(
708708
};
709709

710710
// Write debug
711-
// We use "uint64_t" here because EnqueueWriteGlobal will fail when it's "uint32_t"
712-
uint64_t Debug = Options(logger).Debug ? 1 : 0;
711+
uint32_t Debug = Options(logger).Debug ? 1 : 0;
713712
EnqueueWriteGlobal(kSPIR_AsanDebug, &Debug, sizeof(Debug));
714713

715714
// Write shadow memory offset for global memory

source/loader/layers/sanitizer/asan_interceptor.hpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,7 @@ struct DeviceInfo {
4545
std::queue<std::shared_ptr<AllocInfo>> Quarantine;
4646
size_t QuarantineSize = 0;
4747

48-
explicit DeviceInfo(ur_device_handle_t Device) : Handle(Device) {
49-
[[maybe_unused]] auto Result =
50-
getContext()->urDdiTable.Device.pfnRetain(Device);
51-
assert(Result == UR_RESULT_SUCCESS);
52-
}
53-
54-
~DeviceInfo() {
55-
[[maybe_unused]] auto Result =
56-
getContext()->urDdiTable.Device.pfnRelease(Handle);
57-
assert(Result == UR_RESULT_SUCCESS);
58-
}
48+
explicit DeviceInfo(ur_device_handle_t Device) : Handle(Device) {}
5949

6050
ur_result_t allocShadowMemory(ur_context_handle_t Context);
6151
};

0 commit comments

Comments
 (0)