Skip to content

Commit 94001c4

Browse files
committed
define the spec constant id with macro
1 parent 2167d96 commit 94001c4

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

libdevice/include/sanitizer_utils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ inline __SYCL_PRIVATE__ void *ToPrivate(void *ptr) {
5151

5252
inline DeviceType GetDeviceTy() {
5353
return static_cast<DeviceType>(
54-
__spirv_SpecConstant(SpecConstantDeviceTyID, 0));
54+
__spirv_SpecConstant(SPEC_CONSTANT_DEVICE_TYPE_ID, 0));
5555
}
5656

5757
template <typename T> T Memset(T ptr, int value, size_t size) {

unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ ur_result_t AsanInterceptor::insertProgram(ur_program_handle_t Program) {
646646
auto CI = getContextInfo(GetContext(Program));
647647
auto DI = getDeviceInfo(CI->DeviceList[0]);
648648
ur_specialization_constant_info_t SpecConstantInfo{
649-
SpecConstantDeviceTyID, sizeof(DeviceType), &DI->Type};
649+
SPEC_CONSTANT_DEVICE_TYPE_ID, sizeof(DeviceType), &DI->Type};
650650
ur_result_t URes =
651651
getContext()->urDdiTable.Program.pfnSetSpecializationConstants(
652652
Program, 1, &SpecConstantInfo);

unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ ur_result_t MsanInterceptor::insertProgram(ur_program_handle_t Program) {
387387
auto CI = getContextInfo(GetContext(Program));
388388
auto DI = getDeviceInfo(CI->DeviceList[0]);
389389
ur_specialization_constant_info_t SpecConstantInfo{
390-
SpecConstantDeviceTyID, sizeof(DeviceType), &DI->Type};
390+
SPEC_CONSTANT_DEVICE_TYPE_ID, sizeof(DeviceType), &DI->Type};
391391
ur_result_t URes =
392392
getContext()->urDdiTable.Program.pfnSetSpecializationConstants(
393393
Program, 1, &SpecConstantInfo);

unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_libdevice.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace ur_sanitizer_layer {
2222
enum class DeviceType : uint32_t { UNKNOWN = 0, CPU, GPU_PVC, GPU_DG2 };
2323

2424
// Try to use a larger ID number to avoid conflict with user ID.
25-
constexpr int SpecConstantDeviceTyID = INT32_MAX - 1;
25+
#define SPEC_CONSTANT_DEVICE_TYPE_ID (INT32_MAX - 1)
2626

2727
inline const char *ToString(DeviceType Type) {
2828
switch (Type) {

unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ ur_result_t TsanInterceptor::insertProgram(ur_program_handle_t Program) {
310310
auto CI = getContextInfo(GetContext(Program));
311311
auto DI = getDeviceInfo(CI->DeviceList[0]);
312312
ur_specialization_constant_info_t SpecConstantInfo{
313-
SpecConstantDeviceTyID, sizeof(DeviceType), &DI->Type};
313+
SPEC_CONSTANT_DEVICE_TYPE_ID, sizeof(DeviceType), &DI->Type};
314314
ur_result_t URes =
315315
getContext()->urDdiTable.Program.pfnSetSpecializationConstants(
316316
Program, 1, &SpecConstantInfo);

0 commit comments

Comments
 (0)