Skip to content

[SYCL] Fix compilation when JIT is disabled #19302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion sycl/source/detail/device_image_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

#pragma once

#if SYCL_EXT_JIT_ENABLE
#include "JITBinaryInfo.h"
#endif // SYCL_EXT_JIT_ENABLE
#include <detail/adapter_impl.hpp>
#include <detail/compiler.hpp>
#include <detail/context_impl.hpp>
Expand All @@ -35,6 +37,10 @@
#include <mutex>
#include <vector>

namespace jit_compiler {
enum class BinaryFormat : uint32_t;
}

namespace sycl {
inline namespace _V1 {
namespace detail {
Expand Down Expand Up @@ -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:
Expand All @@ -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<std::shared_ptr<device_image_impl>> buildFromSource(
Expand Down
3 changes: 2 additions & 1 deletion sycl/source/detail/jit_compiler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

#pragma once

#include <JITBinaryInfo.h>
#include <detail/jit_device_binaries.hpp>
#include <detail/queue_impl.hpp>
#include <sycl/detail/kernel_name_str_t.hpp>
#include <sycl/feature_test.hpp>
#if SYCL_EXT_JIT_ENABLE
#include <JITBinaryInfo.h>
#include <Materializer.h>
#include <RTC.h>
#endif // SYCL_EXT_JIT_ENABLE
Expand All @@ -28,6 +28,7 @@ struct RTCDevImgInfo;
struct RTCBundleInfo;
template <typename T> class DynArray;
using JITEnvVar = DynArray<char>;
enum class BinaryFormat : uint32_t;
} // namespace jit_compiler

namespace sycl {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

#pragma once

#include <JITBinaryInfo.h>
#if SYCL_EXT_JIT_ENABLE
#include "JITBinaryInfo.h"
#endif // SYCL_EXT_JIT_ENABLE
#include <sycl/detail/defines_elementary.hpp>
#include <sycl/detail/export.hpp> // __SYCL_EXPORT
#include <sycl/detail/string_view.hpp>
Expand All @@ -18,6 +20,10 @@
#include <string>
#include <vector>

namespace jit_compiler {
enum class BinaryFormat : uint32_t;
}

namespace sycl {
inline namespace _V1 {
namespace ext::oneapi::experimental {
Expand Down