Skip to content

memory_scope_work_item: OpenCL core restrict what OpenCL SPIR-V env allow #1573

Description

@TApplencourt

OpenCL Spec

The main OpenCL spec, stipulate that:

memory_scope_work_item: memory-ordering constraints only apply within the work-item [1].

And [1] said

1. This value for memory_scope can only be used with atomic_work_item_fence with flags set to CLK_IMAGE_MEM_FENCE.

So that it's clear, memory_scope_work_item can just be used for atomic_work_item_fence set to CLK_IMAGE_MEM_FENCE.

OpenCL SPIRV-V

On the other env OpenCL SPIR-V env said (https://registry.khronos.org/OpenCL/specs/2.2/html/OpenCL_Env.html#validation-rules)

Otherwise [after OpenCL 1.2], Scope for Memory must be one of:

  • CrossDevice
  • Device
  • Workgroup
  • Invocation
  • Subgroup (OpenCL 2.1 and Newer)

Where the SPIRV spec define invocation as `A single execution of an entry point in a SPIR-V module [...] a single invocation operates only on a single work item

(naive) Question

Is this discrepancy expected / on purpose ?

Thanks


Was discovered by the SYCL WG here: KhronosGroup/SYCL-Docs#1004 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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