KhronosGroup / SYCL-Docs

SYCL Open Source Specification
Other
109 stars 67 forks source link

Non-legacy multi_ptr and access::address_space::constant_space #288

Open steffenlarsen opened 1 year ago

steffenlarsen commented 1 year ago

The specification does not explicitly state that access::address_space::constant_space is unsupported by non-legacy multi_ptr, but it does specify that:

This legacy class supports the deprecated address_space::constant_space address space, which can be used to represent a pointer to constant memory. Pointers to constant memory have an implementation-defined address space, and each implementation can define whether it is legal to assign such a pointer to a generic address pointer.

Additionally it disallows access::address_space::constant_space in the RHS of the assignment operator overloads of non-legacy multi_ptr and constant_ptr is defined as a legacy multi_ptr. Is the intention that non-legacy multi_ptr shouldn't support access::address_space::constant_space?

gmlueck commented 1 year ago

I wasn't around when the new multi_ptr was added, so I'm not sure of the original intent. However, we generally do not add new APIs that support deprecated features. Therefore, I think it makes sense that the new multi_ptr should not support the deprecated address_space::constant_space.

Naghasan commented 1 year ago

2020 doesn't have a constant address space in its memory model. The underlying reason is its incompatibility in SPIR-V with generic (you can't cast from constant to/from generic) making it difficult to support in generic by default.

There is other options on the table possible for the next version though.

Legacy refers to the 1.2.1 interface as the 2020 has breaking changes.