1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry>
<refentryinfo>
<keywordset><keyword>restrictions</keyword></keywordset>
</refentryinfo>
<refmeta>
<refentrytitle>restrictions</refentrytitle>
<refmiscinfo>
<copyright>
<year>2007-2011</year>
<holder>The Khronos Group Inc.
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.</holder>
</copyright>
</refmiscinfo>
<manvolnum>3</manvolnum>
</refmeta>
<!-- ================================ SYNOPSIS -->
<refnamediv id="restrictionsref">
<refname>Restrictions</refname>
<refpurpose> </refpurpose>
</refnamediv>
<refsect1 id="restrictions"><title></title>
<itemizedlist mark="disc">
<listitem>
<!-- RESTRICTION a -->
<para>The use of pointers is somewhat restricted. The following rules apply:</para>
<itemizedlist mark="opencircle">
<listitem>
<para>
Arguments to <citerefentry
href="functionQualifiers"><refentrytitle>__kernel</refentrytitle></citerefentry>
functions declared in a program that are pointers must be declared with the
<citerefentry href="global"><refentrytitle>__global</refentrytitle></citerefentry>,
<citerefentry href="constant"><refentrytitle>__constant</refentrytitle></citerefentry>, or
<citerefentry href="local"><refentrytitle>__local</refentrytitle></citerefentry>
qualifier.
</para>
</listitem>
<listitem>
<para>
A pointer declared with the
<citerefentry href="constant"><refentrytitle>__constant</refentrytitle></citerefentry>,
<citerefentry href="local"><refentrytitle>__local</refentrytitle></citerefentry>, or
<citerefentry href="global"><refentrytitle>__global</refentrytitle></citerefentry>
qualifier can only be assigned to a pointer declared with the __constant, __local, or
__global qualifier respectively.
</para>
</listitem>
<listitem>
<para>Pointers to functions are not allowed.</para>
</listitem>
<listitem>
<para>
Arguments to <citerefentry
href="functionQualifiers"><refentrytitle>__kernel</refentrytitle></citerefentry>
functions in a program cannot be declared as a pointer to a pointer(s). Variables
inside a function or arguments to non-kernel functions in a program can be
declared as a pointer to a pointer(s).
</para> </listitem>
</itemizedlist>
</listitem>
<!-- RESTRICTION b -->
<listitem>
<para>
An image type (
<citerefentry href="otherDataTypes"><refentrytitle>image2d_t</refentrytitle></citerefentry>,
<citerefentry href="otherDataTypes"><refentrytitle>image3d_t</refentrytitle></citerefentry>,
<citerefentry href="otherDataTypes"><refentrytitle>image2d_array_t</refentrytitle></citerefentry>,
<citerefentry href="otherDataTypes"><refentrytitle>image1d_t</refentrytitle></citerefentry>,
<citerefentry href="otherDataTypes"><refentrytitle>image1d_buffer_t</refentrytitle></citerefentry>, or
<citerefentry href="otherDataTypes"><refentrytitle>image1d_array_t</refentrytitle></citerefentry>)
can only be used as the type of a function argument. An image function
argument cannot be modified. Elements of an image can only be accessed
using the <citerefentry href="imageFunctions"><refentrytitle>Built-in Image
Functions</refentrytitle></citerefentry>.
</para>
<para>
An image type cannot be used to declare a variable, a structure or
union field, an array of images, a pointer to an image, or the return
type of a function. An image type cannot be used with the
<citerefentry href="private"><refentrytitle>__private</refentrytitle></citerefentry>,
<citerefentry href="local"><refentrytitle>__local</refentrytitle></citerefentry> and
<citerefentry href="constant"><refentrytitle>__constant</refentrytitle></citerefentry>
address space qualifiers. The <citerefentry
href="otherDataTypes"><refentrytitle>image3d_t</refentrytitle></citerefentry>
type cannot be used with the __write_only access qualifier unless the
<citerefentry><refentrytitle>cl_khr_3d_image_writes</refentrytitle></citerefentry>
extension is enabled. An image type cannot be used with the
<citerefentry href="accessQualifiers"><refentrytitle>__read_write</refentrytitle></citerefentry>
access qualifer which is reserved for future use.
</para>
<para>
The sampler type
(<citerefentry><refentrytitle>sampler_t</refentrytitle></citerefentry>) can only be
used as the type of a function argument or a variable declared in the program scope
or the outermost scope of a kernel function. The behavior of a sampler variable
declared in a non-outermost scope of a kernel function is implementation-defined. A
sampler argument or variable cannot be modified.
</para>
<para>
The sampler type cannot be used to declare a structure or union field, an array of
samplers, a ponter to a sampler, or the return type of a function. The sampler type
cannot be used with the __local and __global address space qualifiers.
</para>
</listitem>
<!-- RESTRICTION c -->
<listitem>
<para>Bit-fields struct members are currently not supported.</para>
</listitem>
<!-- RESTRICTION d -->
<listitem>
<para>Variable length arrays and structures with flexible (or unsized) arrays are not supported.</para>
</listitem>
<!-- RESTRICTION e -->
<listitem>
<para>Variadic macros and functions are not supported.</para>
</listitem>
<!-- RESTRICTION f -->
<listitem>
<para>
The library functions defined in the C99 standard headers <code>assert.h</code>,
<code>ctype.h</code>, <code>complex.h</code>, <code>errno.h</code>,
<code>fenv.h</code>, <code>float.h</code>, <code>inttypes.h</code>,
<code>limits.h</code>, <code>locale.h</code>, <code>setjmp.h</code>,
<code>signal.h</code>, <code>stdarg.h</code>, <code>stdio.h</code>,
<code>stdlib.h</code>, <code>string.h</code>, <code>tgmath.h</code>,
<code>time.h</code>, <code>wchar.h</code>, and <code>wctype.h</code> are not
available and cannot be included by a program.
</para>
</listitem>
<!-- RESTRICTION g -->
<listitem>
<para>The <code>auto</code> and <code>register</code> storage-class specifiers are not supported.</para>
</listitem>
<!-- RESTRICTION h deleted with rev 13 of the 1.2 specification -->
<!-- RESTRICTION i -->
<listitem>
<para>Recursion is not supported.</para>
</listitem>
<!-- RESTRICTION j -->
<listitem>
<para>
The function using the
<citerefentry href="functionQualifiers"><refentrytitle>__kernel</refentrytitle></citerefentry>
qualifier can only have return type <type>void</type> in the source code.
</para>
</listitem>
<!-- RESTRICTION k -->
<listitem>
<para>
Arguments to kernel functions in a program cannot be declared with the built-in
scalar types <type>bool</type>, <type>half</type>, <type>size_t</type>,
<type>ptrdiff_t</type>, <type>intptr_t</type>, and <type>uintptr_t</type>, or
a struct and/or union that contain fields declared to be one of these built-in
scalar types. The size in bytes of these types except <type>half</type> are
implementation-defined and in addition can also be different for the OpenCL device
and the host processor making it difficult to allocate buffer objects to be passed
as arguments to a kernel declared as pointer to these types. <type>half</type> is
not supported as <type>half</type> can be used as a storage format only (unless the
<citerefentry><refentrytitle>cl_khr_fp16</refentrytitle></citerefentry> extension is
supported) and is not a data type on which floating-point arithmetic can be performed.
</para>
</listitem>
<!-- RESTRICTION l -->
<listitem>
<para>Whether or not irreducible control flow is illegal is implementation defined.</para>
</listitem>
<!-- RESTRICTION m -->
<!-- Restriction m is removed -->
<!-- RESTRICTION n -->
<listitem>
<para>
Arguments to kernel functions in a program cannot be declared to be of type
<citerefentry href="otherDataTypes"><refentrytitle>event_t</refentrytitle></citerefentry>.
</para>
</listitem>
<!-- RESTRICTION o -->
<listitem>
<para>
Elements of a struct or union must belong to the same address space. Declaring a
struct or union whose elements are in different address spaces is illegal.
</para>
</listitem>
<!-- RESTRICTION p -->
<listitem>
<para>
Arguments to kernel functions that are declared to be a struct or union do not
allow OpenCL objects to be passed as elements of the struct or union.
</para>
</listitem>
<!-- RESTRICTION q-->
<listitem>
<para>
The type qualifiers <code>const</code>, <code>restrict</code>, and <code>volatile</code>
as defined by the C99 specification are supported. These qualifiers cannot be used with
<citerefentry href="otherDataTypes"><refentrytitle>image2d_t</refentrytitle></citerefentry>,
<citerefentry href="otherDataTypes"><refentrytitle>image3d_t</refentrytitle></citerefentry>,
<citerefentry href="otherDataTypes"><refentrytitle>image2d_array_t</refentrytitle></citerefentry>,
<citerefentry href="otherDataTypes"><refentrytitle>image1d_t</refentrytitle></citerefentry>,
<citerefentry href="otherDataTypes"><refentrytitle>image1d_buffer_t</refentrytitle></citerefentry>, and
<citerefentry href="otherDataTypes"><refentrytitle>image1d_array_t</refentrytitle></citerefentry> types.
Types other than pointer types shall not use the <code>restrict</code> qualifier.
</para>
</listitem>
<!-- RESTRICTION r -->
<listitem>
<para>
The event type
(<citerefentry href="otherDataTypes"><refentrytitle>event_t</refentrytitle></citerefentry>)
cannot be used as the type of a kernel function argument. The event type cannot be used to
declare a program scope variable. The event type cannot be used to declare a structure or
union field. The event type cannot be used with the
<citerefentry href="local"><refentrytitle>__local</refentrytitle></citerefentry>,
<citerefentry href="constant"><refentrytitle>__constant</refentrytitle></citerefentry>, and
<citerefentry href="global"><refentrytitle>__global</refentrytitle></citerefentry>
address space qualifiers.
</para>
</listitem>
</itemizedlist>
</refsect1>
<!-- ================================ SPECIFICATION -->
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
-->
<refsect1 id="specification"><title>Specification</title>
<para><imageobject><imagedata fileref="pdficon_small1.gif" format="gif" /></imageobject>
<olink uri="restrictions">OpenCL Specification</olink>
</para>
</refsect1>
<!-- ================================ ALSO SEE -->
<refsect1 id="seealso"><title>Also see</title>
<para>
<citerefentry href="imageFunctions"><refentrytitle>Image Functions</refentrytitle></citerefentry>,
<citerefentry href="functionQualifiers"><refentrytitle>Function Qualifiers</refentrytitle></citerefentry>
</para>
</refsect1>
<!-- ============================== COPYRIGHT -->
<!-- Content included from copyright.inc.xsl -->
<refsect3 id="Copyright"><title></title>
<imageobject>
<imagedata fileref="KhronosLogo.jpg" format="jpg" />
</imageobject>
<para />
</refsect3>
<!-- 27-Oct-2011 -->
</refentry>
|