Skip to content

Commit 246bc6d

Browse files
committed
Obey SYCL_EXT_JIT_ENABLE.
Signed-off-by: Julian Oppermann <[email protected]>
1 parent 6e892f9 commit 246bc6d

File tree

1 file changed

+47
-4
lines changed

1 file changed

+47
-4
lines changed

sycl/source/detail/kernel_compiler/kernel_compiler_sycl.cpp

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "kernel_compiler_sycl.hpp"
10-
#include "../jit_compiler.hpp"
1110
#include <sycl/exception.hpp> // make_error_code
1211

1312
#if __GNUC__ && __GNUC__ < 8
@@ -311,6 +310,25 @@ bool SYCL_Compilation_Available() {
311310
return (result == 0);
312311
}
313312

313+
} // namespace detail
314+
} // namespace ext::oneapi::experimental
315+
} // namespace _V1
316+
} // namespace sycl
317+
#endif
318+
319+
#if SYCL_EXT_JIT_ENABLE
320+
321+
#include "../jit_compiler.hpp"
322+
323+
namespace sycl {
324+
inline namespace _V1 {
325+
namespace ext::oneapi::experimental {
326+
namespace detail {
327+
328+
bool SYCLJIT_Compilation_Available() {
329+
return sycl::detail::jit_compiler::get_instance().isAvailable();
330+
}
331+
314332
spirv_vec_t
315333
SYCLJIT_to_SPIRV(const std::string &SYCLSource, include_pairs_t IncludePairs,
316334
const std::vector<std::string> &UserArgs, std::string *LogPtr,
@@ -319,12 +337,37 @@ SYCLJIT_to_SPIRV(const std::string &SYCLSource, include_pairs_t IncludePairs,
319337
SYCLSource, IncludePairs, UserArgs, LogPtr, RegisteredKernelNames);
320338
}
321339

322-
bool SYCLJIT_Compilation_Available() {
323-
return sycl::detail::jit_compiler::get_instance().isAvailable();
340+
} // namespace detail
341+
} // namespace ext::oneapi::experimental
342+
} // namespace _V1
343+
} // namespace sycl
344+
345+
#else
346+
347+
namespace sycl {
348+
inline namespace _V1 {
349+
namespace ext::oneapi::experimental {
350+
namespace detail {
351+
352+
bool SYCLJIT_Compilation_Available() { return false; }
353+
354+
spirv_vec_t
355+
SYCLJIT_to_SPIRV(const std::string &SYCLSource, include_pairs_t IncludePairs,
356+
const std::vector<std::string> &UserArgs, std::string *LogPtr,
357+
const std::vector<std::string> &RegisteredKernelNames) {
358+
(void)SYCLSource;
359+
(void)IncludePairs;
360+
(void)UserArgs;
361+
(void)LogPtr;
362+
(void)RegisteredKernelNames;
363+
364+
throw sycl::exception(sycl::errc::build,
365+
"kernel_compiler via sycl-jit is not available");
324366
}
325367

326368
} // namespace detail
327369
} // namespace ext::oneapi::experimental
328370
} // namespace _V1
329371
} // namespace sycl
330-
#endif
372+
373+
#endif // SYCL_EXT_JIT_ENABLE

0 commit comments

Comments
 (0)