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_xchg - atomic_xchg functions.

Authors

TheKhronosGroup

Description

       Swaps the old value stored at location p with new value given by val. The function returns old.

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

Name

       atomic_xchg - atomic_xchg functions.

       intatomic_xchg(volatileglobal(3clc) int *p,intval);unsignedintatomic_xchg(volatileglobal(3clc) unsigned int *p,unsignedintval);floatatomic_xchg(volatileglobal(3clc) float *p,floatval);intatomic_xchg(volatilelocal(3clc) int *p,intval);unsignedintatomic_xchg(volatilelocal(3clc) unsigned int *p,unsignedintval);floatatomic_xchg(volatileglobal(3clc) float *p,floatval);

Notes

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

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

See Also

atomicFunctions(3clc), atom_xchg(3clc)

Specification

OpenCLSpecification[1]

See Also