Open illuhad opened 2 years ago
item<1>
can be implicitly converted toid<1>
Is this true? I don't see this in the spec.
id
has non-explicit constructor accepting item
:
https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#id-class
22/11/24: more investigation required by implementors.
Currently, we have
accessor::operator[](id<Dim>)
available for device accessors if Dim > 0: https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#_interface_for_buffer_command_accessorsI believe this can cause ambiguities if
accessor::operator[]
is used withitem<1>
as argument instead ofid<1>
:item<1>
can be implicitly converted toid<1>
, for which anaccessor::operator[]
overload existsitem<1>
can be implicitly converted tosize_t
, for which anaccessor::operator[]
overload exists as well.Do we want to support passing
item
toaccessor::operator[]
? If so, I think one solution could be to make theaccessor::operator[](id<Dim>)
only available for Dim > 1. This is how I have solved this at the moment.Passing
id<1>
still works, because thenid<1>
would be implicitly converted tosize_t
, and thenaccessor::operator[](size_t)
can be used.I'm curious how other implementers have solved this, because going strictly by the synopsis as defined in the spec will not work I think.