-
Notifications
You must be signed in to change notification settings - Fork 747
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
[SYCL] Fix using some of math built-ins when ESIMD is included #14793
[SYCL] Fix using some of math built-ins when ESIMD is included #14793
Conversation
This reverts commit 1f1be9c.
… and support new functions (intel#13383)" This is a partial revert of bcca7a8. Notable changes: - new tests for `popcount`, `clz` and `ctz` built-ins were preserved - public definitions of those ESIMD APIs were preserved - the implementation of the latter was changed, though: - drop template args around `__spirv_ocl_*` intrinsics to use ones that are auto-declared by the compiler - added `#ifdef __SYCL_DEVICE_ONLY__`, because the compiler only declares `__spirv_ocl_*` intrinsics for device compilation
1b00cda
to
97abb43
Compare
@@ -72,23 +72,6 @@ template <typename T, int N> | |||
__ESIMD_INTRIN __ESIMD_raw_vec_t(T, N) | |||
__spirv_ocl_native_powr(__ESIMD_raw_vec_t(T, N), __ESIMD_raw_vec_t(T, N)); | |||
|
|||
template <typename T, int N> | |||
__ESIMD_INTRIN __ESIMD_raw_vec_t(T, N) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead what if we SFINAE these to only work when N==1, so we use the compiler generated ones by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whatever, I'll deal with this later. Will approve/merge for now.
intel#14793)" This reverts commit 0228c23.
intel#14793)" This reverts commit 0228c23.
ESIMD headers declare some of
__spirv_ocl_*
built-ins as template functions, but those built-ins are also automatically declared by the compiler implicitly when used.On Windows, redeclarations in headers cause compilation issues, because by some reason they take priority, but template arguments for them couldn't be inferred.
This commit effectively introduces new tests to cover affected scenarios and reverts a couple of ESIMD commits to fix the issue:
__spirv_ocl_*
built-insI suppose that both PRs were made in attempt to move away from custom ESIMD intrinsic to standard SPIR-V ones, but that should be done without manually declaring the latter. A bigger refactoring might be needed to use auto-declared SPIR-V built-ins in ESIMD because of presence and usage of single-element vectors in ESIMD (which do not exist in SPIR-V).