-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][LIBCLC] Add memory/control barrier, sqrt, sin and cos builtins #4091
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
Conversation
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.
Beside the mem_fence
function name, LGTM
90a711a
to
d9964c1
Compare
@jchlanda, unfortunately ROCm plugin is not validated by CI system, so I have to clarify - there some in-tree tests or llvm-test-suite tests covering these built-ins. Right? |
@bader, yes there are tests for each built-in already in the repo, see ControlBarrier, or sqrt, admittedly, not the most robust. |
AFAIK, libclc project lit tests are not executed in CI. :( |
libclc lit tests only checks the binding produced will match what is expected from an SYCL perspective. Given the situation I agree it is better than nothing, but libclc tests are close to worthless anyhow (understand, you won't replace running on an actual device). |
I see that llvm-test-suite covers all these built-ins already (e.g. https://github.com/intel/llvm-test-suite/blob/intel/SYCL/DeviceLib/built-ins/scalar_math.cpp, https://github.com/intel/llvm-test-suite/blob/intel/SYCL/DeviceLib/cmath_test.cpp, ...). @jchlanda, clang-format-check has failed. Will you apply clang-format to the patch or you have reasons to commit as is? |
@bader that was in a macro that I took from an existing file, my bad for not checking. Fixed now. |
_CLC_OVERLOAD _CLC_DEF _CLC_CONVERGENT void | ||
__spirv_ControlBarrier(unsigned int scope, unsigned int memory, | ||
unsigned int semantics); | ||
|
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.
Do we need SPIR-V built-in declarations? IIRC, @Naghasan added compiler support for these functions as compiler built-ins (can be enabled via clang's flag), so that they can be used w/o explicit declaration.
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.
Do we need SPIR-V built-in declarations?
You are right, clang generates the builtin prototype internally, so this is not needed.
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.
Removed, required a tweak to the way it's built (adding -Xclang -fdeclare-spirv-builtins
).
@bader I can't access |
It's not related. |
This removes the need for forward declaring SPIR-V builtins in OpenCL files.
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.
@Naghasan, you've requested some changes. Does it look good to you now?
yep, LGTM
No description provided.