Skip to content

[SYCL] Limit decorations to init function for annotated_arg/ptr classes #11881

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

Merged
merged 6 commits into from
Nov 16, 2023

Conversation

tiwaria1
Copy link
Contributor

annotated_arg/annotated_ptr are special classes and arguments of the __init() member function become kernel arguments. The classes have decorated_global_ptr or other such type applied on the class members to indicate that these must be in global address-space (or other address space as indicated by the applied type). The goal of applying the type on the member was to ensure that class member gets captured as a global address space pointer when set as kernel argument.

However, the type was applied on class constructor arguments as well. This PR restricts the type to only be present on the __init member function argument, otherwise the presence of the type on constructors causes functional errors on certain backends when objects are constructed in the kernel body. The object constructed inside kernel body also gets a global address space cast generated by the compiler when the decorated_global_ptr type is applied on ctor arguments. This is problematic for example when the object is constructed from a pointer to some array defined inside the kernel.

@tiwaria1 tiwaria1 requested a review from a team as a code owner November 14, 2023 15:21
@tiwaria1
Copy link
Contributor Author

Friendly ping @sergey-semenov
Optional reviewer: @elizabethandrews

@tiwaria1
Copy link
Contributor Author

@intel/llvm-gatekeepers please merge, thank you!

@aelovikov-intel aelovikov-intel merged commit 08907a3 into intel:sycl Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants