diff --git a/sycl/source/detail/device_image_impl.hpp b/sycl/source/detail/device_image_impl.hpp index f04fea1b8c774..b67a2b63137f1 100644 --- a/sycl/source/detail/device_image_impl.hpp +++ b/sycl/source/detail/device_image_impl.hpp @@ -110,8 +110,19 @@ class device_image_impl { } bool all_specialization_constant_native() const noexcept { - assert(false && "Not implemented"); - return false; + // Specialization constants are natively supported in JIT mode on backends, + // that are using SPIR-V as IR + auto IsAOTBinary = [](const char *Format) { + return ( + (strcmp(Format, __SYCL_PI_DEVICE_BINARY_TARGET_SPIRV64_X86_64) == + 0) || + (strcmp(Format, __SYCL_PI_DEVICE_BINARY_TARGET_SPIRV64_GEN) == 0) || + (strcmp(Format, __SYCL_PI_DEVICE_BINARY_TARGET_SPIRV64_FPGA) == 0)); + }; + + return !IsAOTBinary(MBinImage->getRawData().DeviceTargetSpec) && + (MContext.get_backend() == backend::opencl || + MContext.get_backend() == backend::ext_oneapi_level_zero); } bool has_specialization_constant(const char *SpecName) const noexcept {