STORAGEQUALIFIERS(3clc)
π STORAGE-CLASS QUALIFIERS (3clc) β bestie edition π
okay so this is the OpenCL Manual page for Storage-class_Qualifiers, and it's literally all about the typedef, extern and static storage-class specifiers. tiny page, huge main character energy. let's get into it π«Ά
β¨ NAME β¨
Storage-class_Qualifiers β the typedef, extern and static storage-class specifiers. periodt.
πΈ NOTES πΈ
okay so here's the vibe check on which ones actually made the cut:
- the
typedef,extern, andstaticstorage-class specifiers? supported. slay. - the
autoandregisterstorage-class specifiers? not supported. not invited to the function, bestie. π«
and here's the fine print, because it matters:
- the
externstorage-class specifier can only be used for functions (kernel and non-kernel functions) and for global variables declared in program scope. - the
staticstorage-class specifier can only be used for non-kernel functions and global variables declared in program scope.
like, don't try to be cute with it. program scope only. that's the rule and she is not negotiable. π
π Example π
here's the whole thing, exactly as it lives on the page (the line breaks are the man page's doing, not mine, she's just Like That):
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.
... my_foo(img); ... my_bar(a); ...
}
notice the three little // error. notes in there? yeah. that's the whole point. those declarations are errors, bestie, and the compiler is gonna clock them immediately. π
π SPECIFICATION π
OpenCL Specification[1] β that's it, that's the whole section. she's concise. π
π AUTHORS π
The Khronos Group
π COPYRIGHT π
Copyright Β© 2007-2011 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.
π NOTES π
OpenCL Specificationβ page230, section6.8-Storage-class Qualifiers
and that's the page!! π written by The Khronos Group, dated 01/14/2021, and that's STORAGE-CLASS QUALI(3clc) out. go declare some program-scope globals responsibly bestie, ily ππ¦β¨
π¦ where this page comes from
- ubuntu jammy: opencl-1.2-man-doc 1.0~svn33624-5 Β· other
- ubuntu noble: opencl-1.2-man-doc 1.0~svn33624-5 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms