KhronosGroup / KhronosGroup/SPIRV-Tools

[OpenCL validation] Atomic instructions

Open
#2,595 0 comments 0 reactions 0 assignees View on GitHub
component:validation
Dominant language
C++
Stars
1.4k
Forks
709
Avg merge
1d 22h
Merged PRs (30d)
28

Description

#### Common validation rules

For all Atomic Instructions:
- [ ] Only 32-bit integer types are supported for the Result Type and/or type of Value except when the **Int64Atomics** capability is declared. In that case 64-bit integers are allowed as well.
- [x] The Pointer operand must be a pointer to the **Function**, **Workgroup** or **CrossWorkGroup**
storage classes. Note that an Atomic Instruction on a pointer to the **Function** Storage Class
is valid, but does not have defined behavior.
- [ ] When the **WorkgroupMemory** _Memory Semantic_ is used the _Scope_ must be **Workgroup**. See https://github.com/KhronosGroup/OpenCL-Docs/issues/88.
#### OpenCL 2.2/2.1/2.0

- [x] The Pointer operand to all Atomic Instructions may additionally be a pointer to the **Generic**
Storage Class, however behavior is still undefined if the **Generic** pointer represents a pointer to the
**Function** Storage Class.

#### OpenCL 1.2

- [ ] For the Atomic Instructions, the _Scope_ must be **Device**, and the _Memory Semantics_ must be
**Relaxed**.

Contributor guide

Open the contributing guide

Research direction

No source files, tests, or entry points are named. Start by locating the OpenCL validation for Atomic Instructions, then use the checklist in this issue as the acceptance criteria, including integer widths, memory semantic and scope combinations, and OpenCL version-specific rules.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.