-
Notifications
You must be signed in to change notification settings - Fork 116
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
Conversation
ccc2347
to
b159f2e
Compare
d07a3a2
to
2bf81cc
Compare
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
…ant code 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]>
0da03d0
to
ef96683
Compare
Signed-off-by: Dan Hoeflinger <[email protected]>
@@ -398,6 +450,10 @@ class zip_iterator | |||
return !(*this < __it); | |||
} | |||
|
|||
friend auto | |||
is_onedpl_indirectly_device_accessible_iterator(const zip_iterator&) |
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.
Just a couple of questions.
Do we have some risk that we use not fully qualified name for zip_iterator
?
Do we have some risk that something zip_iterator
value (with qualificators) doesn't
match to const zip_iterator&
?
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.
Since this is a hidden friend, we are using the current exact instantiated type of zip_iterator
here.
As for const zip_iterator&
, I suppose that we should just use zip_iterator
. Copies don't matter because this is only used at compile time to determine output type. I've adjusted all of these ADL overloads to just use the type itself without reference.
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
test/parallel_api/iterator/indirectly_device_accessible.pass.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Dan Hoeflinger <[email protected]>
test/general/implementation_details/indirectly_device_accessible.pass.cpp
Outdated
Show resolved
Hide resolved
test/general/implementation_details/indirectly_device_accessible.pass.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[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.
LGTM
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.
I have reviewed the commits since my last review. Everything LGTM.
Signed-off-by: Dan Hoeflinger <[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.
I reviewed the test change and it LGTM.
…nt (#2126) --------- Signed-off-by: Dan Hoeflinger <[email protected]>
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 withsycl::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.