'\" t .\" Title: Atomic Functions .\" Author: The Khronos Group .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 02/03/2019 .\" Manual: OpenCL Manual .\" Source: The Khronos Group .\" Language: English .\" .TH "ATOMIC FUNCTIONS" "3clc" "02/03/2019" "The Khronos Group" "OpenCL Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" Atomic_Functions \- The atomic functions are shown below\&. Click an item in the table below for details about that function\&. .SH "" .TS allbox tab(:); l l l l l l l l l l l l. T{ \fBatomic_add\fR(3clc) T}:T{ \fBatomic_sub\fR(3clc) T}:T{ \fBatomic_xchg\fR(3clc) T}:T{ \fBatomic_inc\fR(3clc) T} T{ \fBatomic_dec\fR(3clc) T}:T{ \fBatomic_cmpxchg\fR(3clc) T}:T{ \fBatomic_min\fR(3clc) T}:T{ \fBatomic_max\fR(3clc) T} T{ \fBatomic_and\fR(3clc) T}:T{ \fBatomic_or\fR(3clc) T}:T{ \fBatomic_xor\fR(3clc) T}:T{ T} .TE .sp 1 .PP The \fBcl_khr_int64_base_atomics\fR(3clc) extension enables additional atomic functions using types \fBlong\fR and \fBunsigned long\fR\&. An application that wants to use this extension will need to include the #pragma OPENCL EXTENSION \fBcl_khr_int64_base_atomics\fR(3clc) : enable in the OpenCL program source\&. .TS allbox tab(:); l l l l l l l l. T{ \fBatom_add\fR(3clc) T}:T{ \fBatom_sub\fR(3clc) T}:T{ \fBatom_xchg\fR(3clc) T}:T{ \fBatom_inc\fR(3clc) T} T{ \fBatom_dec\fR(3clc) T}:T{ \fBatom_cmpxchg\fR(3clc) T}:T{ \ \& T}:T{ \ \& T} .TE .sp 1 .PP The \fBcl_khr_int64_extended_atomics\fR(3clc) extension enables additional atomic functions using types \fBlong\fR and \fBunsigned long\fR\&. An application that wants to use this extension will need to include the #pragma OPENCL EXTENSION \fBcl_khr_int64_extended_atomics\fR(3clc) : enable in the OpenCL program source\&. .TS allbox tab(:); l l l l l l. T{ \fBatom_min\fR(3clc) T}:T{ \fBatom_max\fR(3clc) T}:T{ \fBatom_xor\fR(3clc) T} T{ \fBatom_and\fR(3clc) T}:T{ \fBatom_or\fR(3clc) T}:T{ \ \& T} .TE .sp 1 .SH "DESCRIPTION" .PP These functions provide atomic operations on 32\-bit signed, unsigned integers and single precision floating\-point to locations in \fBglobal\fR(3clc) or \fBlocal\fR(3clc) memory\&. Only the \fBatomic_xchg\fR operation is supported for single precision floating\-point data type\&. .PP The atomic built\-in functions that use the \fBatom_\fR prefix and are described in the \m[blue]\fBOpenCL Extension Specification\fR\m[]\&\s-2\u[1]\d\s+2 and are enabled by: cl_khr_global_int32_base_atomics, cl_khr_global_int32_extended_atomics, cl_khr_local_int32_base_atomics, and cl_khr_local_int32_extended_atomics in sections 9\&.5 and 9\&.6 of the OpenCL 1\&.0 specification are also supported\&. \&. .PP The 64\-bit transactions are atomic for the device executing these atomic functions\&. There is no guarantee of atomicity if the atomic operations to the same memory location are being performed by kernels executing on multiple devices\&. .SH "SPECIFICATION" .PP \m[blue]\fBOpenCL Specification\fR\m[]\&\s-2\u[2]\d\s+2 .SH "AUTHORS" .PP \fBThe Khronos Group\fR .SH "COPYRIGHT" .br Copyright \(co 2007-2011 The Khronos Group Inc. .br Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials. .sp .SH "NOTES" .IP " 1." 4 OpenCL Extension Specification .RS 4 \%page 10, section 9.3 - 64-bit Atomics .RE .IP " 2." 4 OpenCL Specification .RS 4 \%page 279, section 6.12.11 - Atomic Functions for 32-bit integers .RE