Skip to content

[SYCL][ESIMD] Add ESIMD support for compile time hardware dispatch #7919

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 1 commit into from
Jan 5, 2023
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
3 changes: 2 additions & 1 deletion llvm/lib/SYCLLowerIR/ESIMD/ESIMDVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ static const char *LegalSYCLFunctions[] = {
"^sycl::_V1::ext::oneapi::sub_group::.+",
"^sycl::_V1::ext::oneapi::experimental::spec_constant<.+>::.+",
"^sycl::_V1::ext::oneapi::experimental::this_sub_group",
"^sycl::_V1::ext::oneapi::experimental::bfloat16::.+"};
"^sycl::_V1::ext::oneapi::experimental::bfloat16::.+",
"^sycl::_V1::ext::oneapi::experimental::if_architecture_is"};

static const char *LegalSYCLFunctionsInStatelessMode[] = {
"^sycl::_V1::multi_ptr<.+>::get",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,16 +505,16 @@ namespace ext::oneapi::experimental {

template <architecture... Archs, typename T, typename... Args>
constexpr static auto if_architecture_is(T fnTrue, Args... args) {
static_assert(detail::allowable_aot_mode<Archs...>(),
static_assert(sycl::detail::allowable_aot_mode<Archs...>(),
"The if_architecture_is function may only be used when AOT "
"compiling with '-fsycl-targets=spir64_x86_64' or "
"'-fsycl-targets=*_gpu_*'");
if constexpr (detail::device_architecture_is<Archs...>()) {
if constexpr (sycl::detail::device_architecture_is<Archs...>()) {
fnTrue(args...);
return detail::if_architecture_helper<false>{};
return sycl::detail::if_architecture_helper<false>{};
} else {
(void)fnTrue;
return detail::if_architecture_helper<true>{};
return sycl::detail::if_architecture_helper<true>{};
}
}

Expand Down