Skip to content

Commit 7e06ae1

Browse files
committed
Tidy up conditional compilation.
Signed-off-by: Julian Oppermann <[email protected]>
1 parent 46e7127 commit 7e06ae1

File tree

1 file changed

+13
-32
lines changed

1 file changed

+13
-32
lines changed

sycl/source/detail/kernel_compiler/kernel_compiler_sycl.cpp

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -317,57 +317,38 @@ bool SYCL_Compilation_Available() {
317317
#endif
318318

319319
#if SYCL_EXT_JIT_ENABLE
320-
321320
#include "../jit_compiler.hpp"
321+
#endif
322322

323323
namespace sycl {
324324
inline namespace _V1 {
325325
namespace ext::oneapi::experimental {
326326
namespace detail {
327327

328328
bool SYCLJIT_Compilation_Available() {
329+
#if SYCL_EXT_JIT_ENABLE
329330
return sycl::detail::jit_compiler::get_instance().isAvailable();
331+
#else
332+
return false;
333+
#endif
330334
}
331335

332-
spirv_vec_t
333-
SYCLJIT_to_SPIRV(const std::string &SYCLSource, include_pairs_t IncludePairs,
334-
const std::vector<std::string> &UserArgs, std::string *LogPtr,
335-
const std::vector<std::string> &RegisteredKernelNames) {
336+
spirv_vec_t SYCLJIT_to_SPIRV(
337+
[[maybe_unused]] const std::string &SYCLSource,
338+
[[maybe_unused]] include_pairs_t IncludePairs,
339+
[[maybe_unused]] const std::vector<std::string> &UserArgs,
340+
[[maybe_unused]] std::string *LogPtr,
341+
[[maybe_unused]] const std::vector<std::string> &RegisteredKernelNames) {
342+
#if SYCL_EXT_JIT_ENABLE
336343
return sycl::detail::jit_compiler::get_instance().compileSYCL(
337344
SYCLSource, IncludePairs, UserArgs, LogPtr, RegisteredKernelNames);
338-
}
339-
340-
} // namespace detail
341-
} // namespace ext::oneapi::experimental
342-
} // namespace _V1
343-
} // namespace sycl
344-
345345
#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-
364346
throw sycl::exception(sycl::errc::build,
365347
"kernel_compiler via sycl-jit is not available");
348+
#endif
366349
}
367350

368351
} // namespace detail
369352
} // namespace ext::oneapi::experimental
370353
} // namespace _V1
371354
} // namespace sycl
372-
373-
#endif // SYCL_EXT_JIT_ENABLE

0 commit comments

Comments
 (0)