blob: 29a2502803a3071f2acfd18429a75801aafcc8f5 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
<keyword>Storage-class Qualifiers</keyword>
<refentrytitle>Storage-class Qualifiers</refentrytitle>
<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>
<!-- ================================ SYNOPSIS -->
<refnamediv id="Storage-classQualifiers">
<refname>Storage-class Qualifiers</refname>
The typedef, extern and static storage-class specifiers.
<!-- ================================ NOTES -->
<refsect1 id="notes"><title>Notes</title>
The <code>typedef</code>, <code>extern</code>, and <code>static</code> storage-class
specifiers are supported. The <code>auto</code> and <code>register</code> storage-class
specifiers are not supported..
The <code>extern</code> storage-class specifier can only be used for functions
(kernel and non-kernel functions) and global variables declared in program scope.
The <code>static</code> storage-class specifier can only be used for non-kernel
functions and global variables declared in program scope.
<!-- ================================ EXAMPLE -->
<refsect2 id="example1">
<informaltable frame="none">
<tgroup cols="1" align="left" colsep="0" rowsep="0">
<colspec colname="col1" colnum="1" />
extern constant float4 noise_table[256];
static constant float4 color_table[256];
extern kernel void my_foo(image2d_t img);
extern void my_bar(global float *a);
kernel void my_func(image2d_t img, global float *a)
extern constant float4 a; // error.
static constant float4 b; // error.
static float c; // error.
<!-- ================================ SPECIFICATION -->
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
<refsect1 id="specification"><title>Specification</title>
<imagedata fileref="pdficon_small1.gif" format="gif" />
<olink uri="storageQualifiers">OpenCL Specification</olink>
<!-- ================================ ALSO SEE
<refsect1 id="seealso"><title>Also see</title>
</refsect1> -->
<!-- ============================== COPYRIGHT -->
<!-- Content included from -->
<refsect3 id="Copyright"><title></title>
<imagedata fileref="KhronosLogo.jpg" format="jpg" />
<para />
<!-- 13-Oct-2011 -->