-
Notifications
You must be signed in to change notification settings - Fork 777
[SYCL] Add 'cl::sycl::intel::experimental::printf' #835
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
Another approach for the changes in clang: #909 |
f91daff
to
52372fd
Compare
52372fd
to
198bce3
Compare
29a9b9c
to
85bc165
Compare
// appear in different order if output is redirected to a file or | ||
// another app | ||
// FIXME: strictly check output order once the bug is fixed | ||
// CHECK: {{(Hello, World!)?}} |
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.
This is fragile, even for a workaround. I hope this bug is stable
enough.
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.
From local runs it seems that it is stable enough, yes
85bc165
to
5f245ca
Compare
@@ -0,0 +1,70 @@ | |||
//==------ builtins.hpp - Non-standard SYCL built-in functions -------------==// |
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.
Rather than non-standard, there are mostly Intel extensions, aren't they?
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.
Hmm, at this point I would say it mostly "non-standard" rather than actual Intel extensions, since this file is only contains experimental::printf
which doesn't have special extension document
5f245ca
to
e18f7ff
Compare
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.
LGTM.
// - You can print vector data types using 'v' modifier: | ||
// #ifdef __SYCL_DEVICE_ONLY__ // this is only available on real devices | ||
// auto vec = cl::sycl::vec<int, 8> v(1, 2, 3, 4, 5, 6, 7, 8); | ||
// using ocl_vec_type = cl::sycl::vec<int, 8>::vector_t; |
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.
And if I have cl::sycl::vec<long, 8>
on Windows, I have to use %v8d
instead of %v8ld
, because long
is 32bit there, right? We definitely need a correct format diagnostic here (not with this patch). Or maybe Clang can adjust a format string according to the OpenCL rules, since it is guaranteed to be a compile-time constant.
New built-in is mapped to OpenCL 'printf' built-in by using SPIR-V friendly IR. Signed-off-by: Alexey Sotkin <alexey.sotkin@intel.com> Co-authored-by: Alexey Sachkov <alexey.sachkov@intel.com>
e18f7ff
to
1db211f
Compare
New built-in is mapped to OpenCL 'printf' built-in by using SPIR-V
friendly IR.