~ubuntu-branches/ubuntu/trusty/khronos-opencl-man/trusty

« back to all changes in this revision

Viewing changes to atomicFunctions.xml

  • Committer: Package Import Robot
  • Author(s): Mathieu Malaterre
  • Date: 2013-05-21 18:06:15 UTC
  • Revision ID: package-import@ubuntu.com-20130521180615-6e0s2n3pai95ip2f
Tags: upstream-1.0~svn21772
ImportĀ upstreamĀ versionĀ 1.0~svn21772

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8"?>
 
2
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
 
3
              "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
 
4
 
 
5
<refentry>
 
6
    <refentryinfo>
 
7
        <keywordset>
 
8
            <keyword>Atomic Functions</keyword>
 
9
        </keywordset>
 
10
    </refentryinfo>
 
11
    <refmeta>
 
12
        <refentrytitle>Atomic Functions</refentrytitle>
 
13
        <refmiscinfo>
 
14
            <copyright>
 
15
                <year>2007-2011</year>
 
16
                <holder>The Khronos Group Inc.
 
17
 Permission is hereby granted, free of charge, to any person obtaining a
 
18
copy of this software and/or associated documentation files (the
 
19
"Materials"), to deal in the Materials without restriction, including
 
20
without limitation the rights to use, copy, modify, merge, publish,
 
21
distribute, sublicense, and/or sell copies of the Materials, and to
 
22
permit persons to whom the Materials are furnished to do so, subject to
 
23
the condition that this copyright notice and permission notice shall be included
 
24
in all copies or substantial portions of the Materials.</holder>
 
25
            </copyright>
 
26
        </refmiscinfo>
 
27
        <manvolnum>3</manvolnum>
 
28
    </refmeta>
 
29
    <refnamediv>
 
30
        <refname>Atomic Functions</refname>
 
31
        <refpurpose>
 
32
The atomic functions are shown below.
 
33
Click an item in the table below for details about that function.
 
34
        </refpurpose>
 
35
    </refnamediv>
 
36
 
 
37
<refsect1 id="springboard"><title></title>
 
38
 
 
39
<informaltable frame="all"><tgroup cols="4" align="left" colsep="1" rowsep="1">
 
40
    <colspec colnum="1" colwidth="1*" colname="col1" />
 
41
    <colspec colnum="2" colwidth="1*" colname="col2" />
 
42
    <colspec colnum="3" colwidth="1*" colname="col3" />
 
43
    <colspec colnum="4" colwidth="1*" colname="col4" />
 
44
    <tbody>
 
45
        <row>
 
46
            <entry>
 
47
                <citerefentry><refentrytitle>atomic_add</refentrytitle></citerefentry>
 
48
            </entry>
 
49
            <entry>
 
50
                <citerefentry><refentrytitle>atomic_sub</refentrytitle></citerefentry>
 
51
            </entry>
 
52
            <entry>
 
53
                <citerefentry><refentrytitle>atomic_xchg</refentrytitle></citerefentry>
 
54
            </entry>
 
55
            <entry>
 
56
                <citerefentry><refentrytitle>atomic_inc</refentrytitle></citerefentry>
 
57
            </entry>
 
58
        </row>
 
59
 
 
60
        <row>
 
61
            <entry>
 
62
                <citerefentry><refentrytitle>atomic_dec</refentrytitle></citerefentry>
 
63
            </entry>
 
64
            <entry>
 
65
                <citerefentry><refentrytitle>atomic_cmpxchg</refentrytitle></citerefentry>
 
66
            </entry>
 
67
            <entry>
 
68
                <citerefentry><refentrytitle>atomic_min</refentrytitle></citerefentry>
 
69
            </entry>
 
70
            <entry>
 
71
                <citerefentry><refentrytitle>atomic_max</refentrytitle></citerefentry>
 
72
            </entry>
 
73
        </row>
 
74
 
 
75
        <row>
 
76
            <entry>
 
77
                <citerefentry><refentrytitle>atomic_and</refentrytitle></citerefentry>
 
78
            </entry>
 
79
            <entry>
 
80
                <citerefentry><refentrytitle>atomic_or</refentrytitle></citerefentry>
 
81
            </entry>
 
82
            <entry>
 
83
                <citerefentry><refentrytitle>atomic_xor</refentrytitle></citerefentry>
 
84
            </entry>
 
85
            <entry>
 
86
            </entry>
 
87
        </row>
 
88
 
 
89
    </tbody>
 
90
 
 
91
    </tgroup></informaltable>
 
92
 
 
93
    <para>
 
94
      The <citerefentry><refentrytitle>cl_khr_int64_base_atomics</refentrytitle></citerefentry>
 
95
      extension enables additional atomic functions using types <type>long</type>
 
96
      and <type>unsigned long</type>.  An application that wants to use
 
97
      this extension will need to include the <code>#pragma OPENCL EXTENSION
 
98
      <citerefentry><refentrytitle>cl_khr_int64_base_atomics</refentrytitle></citerefentry> :
 
99
      enable</code> in the OpenCL program source.
 
100
    </para>
 
101
 
 
102
<informaltable frame="all"><tgroup cols="4" align="left" colsep="1" rowsep="1">
 
103
    <colspec colnum="1" colwidth="1*" colname="col1" />
 
104
    <colspec colnum="2" colwidth="1*" colname="col2" />
 
105
    <colspec colnum="3" colwidth="1*" colname="col3" />
 
106
    <colspec colnum="4" colwidth="1*" colname="col4" />
 
107
    <tbody>
 
108
        <row>
 
109
            <entry>
 
110
                <citerefentry><refentrytitle>atom_add</refentrytitle></citerefentry>
 
111
            </entry>
 
112
            <entry>
 
113
                <citerefentry><refentrytitle>atom_sub</refentrytitle></citerefentry>
 
114
            </entry>
 
115
            <entry>
 
116
                <citerefentry><refentrytitle>atom_xchg</refentrytitle></citerefentry>
 
117
            </entry>
 
118
            <entry>
 
119
                <citerefentry><refentrytitle>atom_inc</refentrytitle></citerefentry>
 
120
            </entry>
 
121
        </row>
 
122
 
 
123
        <row>
 
124
            <entry>
 
125
                <citerefentry><refentrytitle>atom_dec</refentrytitle></citerefentry>
 
126
            </entry>
 
127
            <entry>
 
128
                <citerefentry><refentrytitle>atom_cmpxchg</refentrytitle></citerefentry>
 
129
            </entry>
 
130
        </row>
 
131
    </tbody>
 
132
    </tgroup></informaltable>
 
133
 
 
134
    <para>
 
135
      The <citerefentry><refentrytitle>cl_khr_int64_extended_atomics</refentrytitle></citerefentry>
 
136
      extension enables additional atomic functions using types <type>long</type>
 
137
      and <type>unsigned long</type>.  An application that wants to use
 
138
      this extension will need to include the <code>#pragma OPENCL EXTENSION
 
139
      <citerefentry><refentrytitle>cl_khr_int64_extended_atomics</refentrytitle></citerefentry>
 
140
      : enable</code> in the OpenCL program source.
 
141
    </para>
 
142
 
 
143
<informaltable frame="all"><tgroup cols="3" align="left" colsep="1" rowsep="1">
 
144
    <colspec colnum="1" colwidth="1*" colname="col1" />
 
145
    <colspec colnum="2" colwidth="1*" colname="col2" />
 
146
    <colspec colnum="3" colwidth="1*" colname="col3" />
 
147
    <tbody>
 
148
        <row>
 
149
            <entry>
 
150
                <citerefentry><refentrytitle>atom_min</refentrytitle></citerefentry>
 
151
            </entry>
 
152
            <entry>
 
153
                <citerefentry><refentrytitle>atom_max</refentrytitle></citerefentry>
 
154
            </entry>
 
155
            <entry>
 
156
                <citerefentry><refentrytitle>atom_xor</refentrytitle></citerefentry>
 
157
            </entry>
 
158
        </row>
 
159
 
 
160
        <row>
 
161
            <entry>
 
162
                <citerefentry><refentrytitle>atom_and</refentrytitle></citerefentry>
 
163
            </entry>
 
164
            <entry>
 
165
                <citerefentry><refentrytitle>atom_or</refentrytitle></citerefentry>
 
166
            </entry>
 
167
        </row>
 
168
 
 
169
    </tbody>
 
170
 
 
171
    </tgroup></informaltable>
 
172
 
 
173
    </refsect1>
 
174
 
 
175
    <refsect1 id="description"><title>Description</title>
 
176
        <para>
 
177
          These functions provide atomic operations on 32-bit signed, unsigned
 
178
          integers and single precision floating-point to locations in <citerefentry
 
179
          href="global"><refentrytitle>__global</refentrytitle></citerefentry> or <citerefentry
 
180
          href="local"><refentrytitle>__local</refentrytitle></citerefentry> memory.  Only the
 
181
          <function>atomic_xchg</function> operation is supported for single precision
 
182
          floating-point data type.
 
183
        </para>
 
184
 
 
185
        <para>
 
186
          The atomic built-in functions that use the <constant>atom_</constant> prefix and are
 
187
          described in the <olink uri="atom_add">OpenCL Extension Specification</olink> and are
 
188
          enabled by: cl_khr_global_int32_base_atomics, cl_khr_global_int32_extended_atomics,
 
189
          cl_khr_local_int32_base_atomics, and cl_khr_local_int32_extended_atomics in sections
 
190
          9.5 and 9.6 of the OpenCL 1.0 specification are also supported.  .
 
191
        </para>
 
192
 
 
193
        <para>
 
194
          The 64-bit transactions are atomic for the device executing these atomic functions. There
 
195
          is no guarantee of atomicity if the atomic operations to the same memory location
 
196
          are being performed by kernels executing on multiple devices.
 
197
        </para>
 
198
    </refsect1>
 
199
 
 
200
    <refsect1 id="specification"><title>Specification</title>
 
201
        <para>
 
202
            <imageobject>
 
203
                <imagedata fileref="pdficon_small1.gif" format="gif" />
 
204
            </imageobject>
 
205
                                                 <!-- link to section 9.5 of spec -->
 
206
            <olink uri="atomicFunctions">OpenCL Specification</olink>
 
207
        </para>
 
208
    </refsect1>
 
209
 
 
210
<!-- ================================ ALSO SEE
 
211
    <refsect1 id="seealso"><title>Also see</title>
 
212
        <para>
 
213
            <citerefentry><refentrytitle>sampler_t</refentrytitle></citerefentry>
 
214
        </para>
 
215
    </refsect1>  -->
 
216
 
 
217
<!-- ============================== COPYRIGHT -->
 
218
<!-- Content included from copyright.inc.xsl -->
 
219
 
 
220
    <refsect3 id="Copyright"><title></title>
 
221
        <imageobject>
 
222
                <imagedata fileref="KhronosLogo.jpg" format="jpg" />
 
223
        </imageobject>
 
224
        <para />
 
225
    </refsect3>
 
226
 
 
227
<!-- 23-Oct-2011 -->
 
228
</refentry>
 
229