Skip to content

Commit 7a81119

Browse files
authored
[SYCL][ESIMD] Add ESIMD support for compile time hardware dispatch (#7919)
This PR adds support for if_architecture<> to ESIMD kernels
1 parent 81ca1dc commit 7a81119

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

llvm/lib/SYCLLowerIR/ESIMD/ESIMDVerifier.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ static const char *LegalSYCLFunctions[] = {
5454
"^sycl::_V1::ext::oneapi::sub_group::.+",
5555
"^sycl::_V1::ext::oneapi::experimental::spec_constant<.+>::.+",
5656
"^sycl::_V1::ext::oneapi::experimental::this_sub_group",
57-
"^sycl::_V1::ext::oneapi::experimental::bfloat16::.+"};
57+
"^sycl::_V1::ext::oneapi::experimental::bfloat16::.+",
58+
"^sycl::_V1::ext::oneapi::experimental::if_architecture_is"};
5859

5960
static const char *LegalSYCLFunctionsInStatelessMode[] = {
6061
"^sycl::_V1::multi_ptr<.+>::get",

sycl/include/sycl/ext/oneapi/experimental/device_architecture.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -505,16 +505,16 @@ namespace ext::oneapi::experimental {
505505

506506
template <architecture... Archs, typename T, typename... Args>
507507
constexpr static auto if_architecture_is(T fnTrue, Args... args) {
508-
static_assert(detail::allowable_aot_mode<Archs...>(),
508+
static_assert(sycl::detail::allowable_aot_mode<Archs...>(),
509509
"The if_architecture_is function may only be used when AOT "
510510
"compiling with '-fsycl-targets=spir64_x86_64' or "
511511
"'-fsycl-targets=*_gpu_*'");
512-
if constexpr (detail::device_architecture_is<Archs...>()) {
512+
if constexpr (sycl::detail::device_architecture_is<Archs...>()) {
513513
fnTrue(args...);
514-
return detail::if_architecture_helper<false>{};
514+
return sycl::detail::if_architecture_helper<false>{};
515515
} else {
516516
(void)fnTrue;
517-
return detail::if_architecture_helper<true>{};
517+
return sycl::detail::if_architecture_helper<true>{};
518518
}
519519
}
520520

0 commit comments

Comments
 (0)