Skip to content

Commit 6dcf90d

Browse files
Handle CUDA & HIP JIT targets
1 parent b491f82 commit 6dcf90d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

sycl/source/detail/compiler.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
#define __SYCL_DEVICE_BINARY_TARGET_NVPTX64 "nvptx64"
3232
#define __SYCL_DEVICE_BINARY_TARGET_AMDGCN "amdgcn"
3333
#define __SYCL_DEVICE_BINARY_TARGET_NATIVE_CPU "native_cpu"
34+
// JIT compilation targets for CUDA & HIP devices.
35+
#define __SYCL_DEVICE_BINARY_TARGET_LLVM_NVPTX64 "llvm_nvptx64"
36+
#define __SYCL_DEVICE_BINARY_TARGET_LLVM_AMDGCN "llvm_amdgcn"
3437

3538
/// Device binary image property set names recognized by the SYCL runtime.
3639
/// Name must be consistent with

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3399,17 +3399,18 @@ bool doesImageTargetMatchDevice(const RTDeviceBinaryImage &Img,
33993399
if (strcmp(Target, __SYCL_DEVICE_BINARY_TARGET_SPIRV64_FPGA) == 0) {
34003400
return Dev.is_accelerator();
34013401
}
3402-
if (strcmp(Target, __SYCL_DEVICE_BINARY_TARGET_NVPTX64) == 0) {
3402+
if (strcmp(Target, __SYCL_DEVICE_BINARY_TARGET_NVPTX64) == 0 ||
3403+
strcmp(Target, __SYCL_DEVICE_BINARY_TARGET_LLVM_NVPTX64) == 0) {
34033404
return BE == sycl::backend::ext_oneapi_cuda;
34043405
}
3405-
if (strcmp(Target, __SYCL_DEVICE_BINARY_TARGET_AMDGCN) == 0) {
3406+
if (strcmp(Target, __SYCL_DEVICE_BINARY_TARGET_AMDGCN) == 0 ||
3407+
strcmp(Target, __SYCL_DEVICE_BINARY_TARGET_LLVM_AMDGCN) == 0) {
34063408
return BE == sycl::backend::ext_oneapi_hip;
34073409
}
34083410
if (strcmp(Target, __SYCL_DEVICE_BINARY_TARGET_NATIVE_CPU) == 0) {
34093411
return BE == sycl::backend::ext_oneapi_native_cpu;
34103412
}
3411-
std::cerr << Target << std::endl;
3412-
assert(false);
3413+
assert(false && "Unexpected image target");
34133414
return false;
34143415
}
34153416

0 commit comments

Comments
 (0)