STORAGEQUALIFIERS(3clc)

πŸ“¦
version 1.0~svn33624 Β· 3 versions
, in ubuntu jammy, ubuntu noble

πŸ’… 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, and static storage-class specifiers? supported. slay.
  • the auto and register storage-class specifiers? not supported. not invited to the function, bestie. 🚫

and here's the fine print, because it matters:

  • the extern storage-class specifier can only be used for functions (kernel and non-kernel functions) and for global variables declared in program scope.
  • the static storage-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 Β© 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 πŸ”–

  1. OpenCL Specification β€” page 230, section 6.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