-
Notifications
You must be signed in to change notification settings - Fork 744
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] Move an accessor pointer to global_device space #2044
Conversation
ee0ad94
to
0bbd843
Compare
With this patch an accessor pointer to global buffer is moved from global space to global_device space. That is done to distinguish this pointer from those USM pointers, that are allocated global space or global_host space, in compile time. In addition to this change there are added explicit conversion operator from global_device to global space for multi_ptr class and implicit convertion for atomic class from global_device for global space. The last change isn't covered by specification published here: intel#1840 , but is required to pass atomic_api CTS. Signed-off-by: Dmitry Sidorov <[email protected]>
Signed-off-by: Dmitry Sidorov <[email protected]>
Signed-off-by: Dmitry Sidorov <[email protected]>
Signed-off-by: Dmitry Sidorov <[email protected]>
6fcfbcc
to
f6d8bdf
Compare
@intel/llvm-reviewers-runtime ping |
Signed-off-by: Dmitry Sidorov <[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.
Not a request to change, but it would be nice to fix it in my opinion.
The 'atomic' class seems to be ripped by those 'private', 'public' keywords already and your fix added more to it.
With your fix the class has: private: public: private: public: private.
I suggest moving those new private getter methods to the line 336
I don't mind to change it, here I was just following Robert C. Martin "Clean code" advise to order methods in a way so readers have no need to scroll the code too much. What do you think? |
Signed-off-by: Dmitry Sidorov <[email protected]>
Well, actually, now I can even remove this method. |
In the process of answer to this question I was going to still suggest moving the methods to the place where the field declared. Then I realized that atomic::getPtr() is used only inside atomic class. This makes that getter method redundant, in my opinion. I suppose you added it to public section before adding that "friend" class and that was the purpose of the getter method. After adding "friend" statement there is no big need in that getter. |
Yeap, I've just removed it :) |
Signed-off-by: Dmitry Sidorov <[email protected]>
Signed-off-by: Dmitry Sidorov <[email protected]>
With this patch an accessor pointer to global buffer is moved from
global space to global_device space. That is done to distinguish this
pointer from those USM pointers, that are allocated global space or
global_host space, in compile time.
In addition to this change there are added explicit conversion operator
from global_device to global space for multi_ptr class and implicit
convertion for atomic class from global_device for global space.
The last change isn't covered by specification published here:
#1840 , but is required to pass
atomic_api CTS.