Suggestion for improving the sycl_ext_oneapi_local_memory extension #17903
fabiomestre
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The
sycl_ext_oneapi_local_memory
extension returns asycl::multi_ptr
to point to the local memory. However, the syntax to access the local memory can be confusing.
The main issue is that
multi_ptr
also implements the[]
operator. This can leadto subtle errors. For example:
I'm wondering if, either this extension or
multi_ptr
, could be improved to make these kinds of user errors detectable at compile time? For example, when the type is a C array, it doesn't make sense to use the[]
operator ofmulti_ptr
. Maybe astatic_assert
could be added or the operator could be disabled in that case?Beta Was this translation helpful? Give feedback.
All reactions