Skip to content

Indirectly Device Accessible Iterator Trait and ADL Customization Point #2126

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

Open
wants to merge 39 commits into
base: main
Choose a base branch
from

Conversation

danhoeflinger
Copy link
Contributor

@danhoeflinger danhoeflinger commented Mar 12, 2025

Types are "Indirectly Device Accessible" when they can represent data which can inherently be dereferenced in a SYCL kernel. Marking types as such can help oneDPL avoid unnecessary data movement surrounding sycl kernels.

Provides a default implementation for the Argument-Dependant Lookup (ADL) customization point is_onedpl_indirectly_device_accessible, as well as defined ADL overloads for oneDPL's provided iterators to provide rules for when they should be considered "indirectly device accessible".

Provides a public trait, is_indirectly_device_accessible[_v] which can be used to query whether a type is "indirectly device accessible". This can be used in combination with sycl::is_device_copyable and a check that it is a random access iterator to determine if it can be passed directly into sycl kernels without extra logic to copy the data to the device.


PR implementing the proposed design in #1999, and the current state of specification PR uxlfoundation/oneAPI-spec#620.

Will not merge until specification has been merged.

@danhoeflinger danhoeflinger marked this pull request as draft March 12, 2025 17:13
@danhoeflinger danhoeflinger force-pushed the dev/dhoeflin/passed_directly_trait branch from ccc2347 to b159f2e Compare March 21, 2025 19:23
@danhoeflinger danhoeflinger changed the title [Draft] Passed directly trait Passed Directly Trait and ADL Customization Point Apr 4, 2025
@danhoeflinger danhoeflinger marked this pull request as ready for review April 4, 2025 16:32
@danhoeflinger danhoeflinger changed the title Passed Directly Trait and ADL Customization Point Device Accessible Content Iterator Trait and ADL Customization Point Apr 4, 2025
@danhoeflinger danhoeflinger added this to the 2022.9.0 milestone Apr 7, 2025
@danhoeflinger danhoeflinger changed the title Device Accessible Content Iterator Trait and ADL Customization Point Indirectly Device Accessible Iterator Trait and ADL Customization Point Apr 17, 2025
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
@danhoeflinger danhoeflinger force-pushed the dev/dhoeflin/passed_directly_trait branch from d07a3a2 to 2bf81cc Compare April 17, 2025 16:07
@SergeyKopienko
Copy link
Contributor

Should we apply clang format suggestions here?

Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
@danhoeflinger
Copy link
Contributor Author

Should we apply clang format suggestions here?

The remaining clang format suggestion deviation is intentional for readibility.

Signed-off-by: Dan Hoeflinger <[email protected]>
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