-
Notifications
You must be signed in to change notification settings - Fork 769
Unintended different behavior between SYCL and OpenCL attributes #1596
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
Comments
@AnastasiaStulova is it intentional that for OpenCL for C++ in most contexts struct S1{ void f() __attribute__((opencl_private)); }; //error
struct S2{ void f() __private; }; If this is intentional what's the reason? For SYCL we only want to support the attribute but not the keyword. Do you think there is a problem for us to allow the attribute? |
@rolandschulz address space attr works slightly differently in C++ outside of OpenCL. I have a patch that generalizes the behavior with the attribute spelling https://reviews.llvm.org/D57464. I think it should work for your use case but I got quite many review comments and didn't have time to finalize this. :( |
@AnastasiaStulova, could we add one more test to https://reviews.llvm.org/D57464 to cover C++ for OpenCL mode as well? Existing test case covers non-OpenCL C++ mode only. struct S1{ void f() __attribute__((opencl_private)); }; // should be ok
struct S2{ void f() __private; }; |
Just FYI C++ for OpenCL is covered by different review: If you are interested in having https://reviews.llvm.org/D57464 committed too, I can't promise any timeline at the moment, unfortunately. But I am happy if you want to go ahead and rebase/rework it upstream. I will certainly be able to help you finilising it. |
Interesting... New spelling doesn't work as original keywords. https://godbolt.org/z/_W8xH8 I'm not sure if https://reviews.llvm.org/D57464 will help to resolve this issue. |
None of the spelling are working :) I think this is a grammar problem here. |
Well clang only has support for OpenCL address spaces. Use of attribute((opencl_private)) is a Clang extension. I think though it should be pretty straight forward to extend https://reviews.llvm.org/D57464 to work for your case. Because it is also attribute-based? |
The impact of not being able to put a qualifier on C++ methods is that the |
Patch for "Error for non-overlapping address space is important to have correct code" - https://reviews.llvm.org/D80317. |
OCL C++ version: https://godbolt.org/z/wCDKhZ
For users to use the decorated pointer (from
multi_ptr::pointer_t
) for performance tuning it is important this doesn't have any unintentional differences.this
pointer with attribute#1581 contains some previous discussion of this issue.
The text was updated successfully, but these errors were encountered: