Skip to content

Can the container used to create a buffer be const? #1009

@0x12CC

Description

@0x12CC

Specification Version

SYCL 2020 (Revision 11)

Section Number(s)

Section 4.7.2.1. Constructors, https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#api:buffer-ctor-container.

Issue Description

This section includes the following two sentences:

  1. The return type of std::data(container) is convertible to T*.
  2. Data is written back to container before the completion of buffer destruction if the return type of std::data(container) is not const.

The "is not const" at the end of the second sentence is confusing. If the return type is const, this would violate constraint (1) since it wouldn't be convertible to T*. It seems the constraint should instead be that std::data(container) is convertible to const T *.

Code Example (Optional)

Relevant example is in 0x12CC/ProtoSYCL#3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions