Skip to content

Commit 1867609

Browse files
authored
[SYCL] Improve all_specialization_constant_native() (#8630)
To apply comments from: #8613
1 parent 47cf939 commit 1867609

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

sycl/source/detail/device_image_impl.hpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,13 @@ class device_image_impl {
112112
bool all_specialization_constant_native() const noexcept {
113113
// Specialization constants are natively supported in JIT mode on backends,
114114
// that are using SPIR-V as IR
115-
auto IsAOTBinary = [](const char *Format) {
116-
return (
117-
(strcmp(Format, __SYCL_PI_DEVICE_BINARY_TARGET_SPIRV64_X86_64) ==
118-
0) ||
119-
(strcmp(Format, __SYCL_PI_DEVICE_BINARY_TARGET_SPIRV64_GEN) == 0) ||
120-
(strcmp(Format, __SYCL_PI_DEVICE_BINARY_TARGET_SPIRV64_FPGA) == 0));
115+
auto IsJITSPIRVTarget = [](const char *Target) {
116+
return (strcmp(Target, __SYCL_PI_DEVICE_BINARY_TARGET_SPIRV64) == 0 ||
117+
strcmp(Target, __SYCL_PI_DEVICE_BINARY_TARGET_SPIRV32) == 0);
121118
};
122-
123-
return !IsAOTBinary(MBinImage->getRawData().DeviceTargetSpec) &&
124-
(MContext.get_backend() == backend::opencl ||
125-
MContext.get_backend() == backend::ext_oneapi_level_zero);
119+
return (MContext.get_backend() == backend::opencl ||
120+
MContext.get_backend() == backend::ext_oneapi_level_zero) &&
121+
IsJITSPIRVTarget(MBinImage->getRawData().DeviceTargetSpec);
126122
}
127123

128124
bool has_specialization_constant(const char *SpecName) const noexcept {

0 commit comments

Comments
 (0)