-
Notifications
You must be signed in to change notification settings - Fork 788
[SPIR-V] Add most SPIR-V definitions to clang builtin lookup #1374
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
Signed-off-by: Victor Lomuller <[email protected]>
Define __SPIRV_BUILTIN_DECLARATIONS__ when passing -fdeclare-spirv-builtins to clang. Signed-off-by: Victor Lomuller <[email protected]>
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.
What about testing this patch?
If I understand correctly, this code is dead as it's not used in the SYCL headers. Right?
This code is dead ATM, the next patch will enable the builtin lookup for device compilation + update the header. Has this brings quite a lot of code changes I broke the patch in 2 to allow focus on the parts. I'll add some more focused testing, I don't think systematic testing of every builtin is interesting, it will be quite heavy otherwise. The test that matter for this is mainly to check that the lookup set it properly built which was enabled by the previous patch. |
e61baca
to
9c42725
Compare
|
||
//===----------------------------------------------------------------------===// | ||
// Definitions of types | ||
//===----------------------------------------------------------------------===// | ||
|
||
// OpenCL v1.0/1.2/2.0 s6.1.1: Built-in Scalar Data Types. | ||
def Bool : IntType<"bool", QualType<"BoolTy">, 1>; |
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.
BTW @bader I added Bool
to keep thing as they are ATM in the SYCL runtime. Although, as per mentioned in this PR #1287, I think lowering to boolean should be handled by the translator and the builtin definition should accept char
or uchar
and vector of them. One of the reason is that not all languages have the type bool.
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.
Scalar bool must be supported.
The only problem is vector bool.
Added OpenCL SPIR-V extended set builtins bindings and part of the core SPIR-V (mostly missing Images and Pipes) Known vendor extensions are not implemented yet. Signed-off-by: Victor Lomuller <[email protected]> Co-Authored-By: Alexey Bader <[email protected]>
9c42725
to
202e3f8
Compare
This allows cuda and hip to stop reporting the relevant opencl extension string, see issue intel#1374
This patch adds most of the SPIR-V kernel builtin definitions:
Signed-off-by: Victor Lomuller [email protected]