logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

atomic_cmpxchg - atomic_cmpxchg functions.

Authors

TheKhronosGroup

Description

       Read the 32-bit value (referred to as old) stored at location pointed by p. Compute (old == cmp) ?  val :
       old and store result at location pointed by p. The function returns old.

       A 64-bit version of this function, atom_cmpxchg(3clc), is enabled by cl_khr_int64_base_atomics(3clc).

Name

       atomic_cmpxchg - atomic_cmpxchg functions.

       intatomic_cmpxchg(volatileglobal(3clc) int *p,intcmp,intval);unsignedintatomic_cmpxchg(volatileglobal(3clc) unsigned int *p,unsignedintcmp,unsignedintval);intatomic_cmpxchg(volatilelocal(3clc) int *p,intcmp,intval);unsignedintatomic_cmpxchg(volatilelocal(3clc) unsigned int *p,unsignedintcmp,unsignedintval);

Notes

        1. OpenCL Specification
           page 279, section 6.12.11 - Atomic Functions for 32-bit integers

The Khronos Group                                  11/18/2024                               ATOMIC_CMPXCHG(3clc)

See Also

atomicFunctions(3clc), atom_cmpxchg(3clc)

Specification

OpenCLSpecification[1]

See Also