Skip to content

Clarify behaviour for using accessors outside commands #882

@tomdeakin

Description

@tomdeakin

The WG made a clarification in 2020, but plan to revisit behaviour in SYCL Next.

I think it should be possible to do better for SYCL Next, though. I think this type of situation is what erroneous behavior is for. If we specified calls to these functions as erroneous behavior outside of commands, some implementations might be able to provide a compile-time diagnostic, some implementations might throw at runtime, but implementations wouldn't be permitted to do UB.

I agree. I said something similar in #580, but there were some concerns raised there about whether what we want is "erroneous behavior" or just something similar to it.

Additionally, it looks like C++26 is going to introduce some new features and wording related to safety (e.g., hardened preconditions, contracts), so we may want to wait and revisit these sorts of issues after C++26 is finalized.

Originally posted by @Pennycook in #862 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions