diff --git a/sycl/source/detail/device_image_impl.hpp b/sycl/source/detail/device_image_impl.hpp index c49409561f123..60f75e3e97d18 100644 --- a/sycl/source/detail/device_image_impl.hpp +++ b/sycl/source/detail/device_image_impl.hpp @@ -8,7 +8,9 @@ #pragma once +#if SYCL_EXT_JIT_ENABLE #include "JITBinaryInfo.h" +#endif // SYCL_EXT_JIT_ENABLE #include #include #include @@ -35,6 +37,10 @@ #include #include +namespace jit_compiler { +enum class BinaryFormat : uint32_t; +} + namespace sycl { inline namespace _V1 { namespace detail { @@ -700,7 +706,9 @@ class device_image_impl return MRTCBinInfo && MRTCBinInfo->MLanguage == Lang; } - static ::jit_compiler::BinaryFormat getTargetFormat(const backend Backend) { + static ::jit_compiler::BinaryFormat + getTargetFormat([[maybe_unused]] const backend Backend) { +#if SYCL_EXT_JIT_ENABLE switch (Backend) { case backend::ext_oneapi_level_zero: case backend::opencl: @@ -714,6 +722,10 @@ class device_image_impl sycl::make_error_code(sycl::errc::invalid), "Backend does not support kernel_compiler extension"); } +#else + throw sycl::exception(sycl::make_error_code(sycl::errc::invalid), + "JIT not supported"); +#endif // SYCL_EXT_JIT_ENABLE } std::vector> buildFromSource( diff --git a/sycl/source/detail/jit_compiler.hpp b/sycl/source/detail/jit_compiler.hpp index e0aefd1deae5d..ac3ebf7d73fa4 100644 --- a/sycl/source/detail/jit_compiler.hpp +++ b/sycl/source/detail/jit_compiler.hpp @@ -8,12 +8,12 @@ #pragma once -#include #include #include #include #include #if SYCL_EXT_JIT_ENABLE +#include #include #include #endif // SYCL_EXT_JIT_ENABLE @@ -28,6 +28,7 @@ struct RTCDevImgInfo; struct RTCBundleInfo; template class DynArray; using JITEnvVar = DynArray; +enum class BinaryFormat : uint32_t; } // namespace jit_compiler namespace sycl { diff --git a/sycl/source/detail/kernel_compiler/kernel_compiler_sycl.hpp b/sycl/source/detail/kernel_compiler/kernel_compiler_sycl.hpp index 007dfae9aff22..0dfaf63a1d8da 100644 --- a/sycl/source/detail/kernel_compiler/kernel_compiler_sycl.hpp +++ b/sycl/source/detail/kernel_compiler/kernel_compiler_sycl.hpp @@ -8,7 +8,9 @@ #pragma once -#include +#if SYCL_EXT_JIT_ENABLE +#include "JITBinaryInfo.h" +#endif // SYCL_EXT_JIT_ENABLE #include #include // __SYCL_EXPORT #include @@ -18,6 +20,10 @@ #include #include +namespace jit_compiler { +enum class BinaryFormat : uint32_t; +} + namespace sycl { inline namespace _V1 { namespace ext::oneapi::experimental {