RESTRICTIONS(3clc)

๐Ÿ“ฆ
version 1.0~svn33624 ยท 3 versions
, in ubuntu jammy, ubuntu noble

โœจ NAME โœจ

okay so bestie, welcome to Restrictions ๐Ÿ’– this is the OpenCL Manual page, section 3clc, and it's basically the big "no babes, you cannot do that" list for OpenCL C. it's giving rules, rules, and more rules, and honestly every single one of them matters ๐ŸŽ€

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 private(3clc), local(3clc) and constant(3clc) address space qualifiers. the otherDataTypes(3clc) type cannot be used with the __write_only access qualifier unless the cl_khr_3d_image_writes(3clc) extension is enabled. an image type cannot be used with the accessQualifiers(3clc) access qualifer which is reserved for future use. ๐Ÿ”ฎ

the sampler type (sampler_t(3clc)) 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.

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.

  • bit-fields struct members are currently not supported. rip ๐Ÿชฆ
  • variable length arrays and structures with flexible (or unsized) arrays are not supported.
  • variadic macros and functions are not supported. no ... shenanigans bestie ๐Ÿšซ
  • the library functions defined in the C99 standard headers assert.h, ctype.h, complex.h, errno.h, fenv.h, float.h, inttypes.h, limits.h, locale.h, setjmp.h, signal.h, stdarg.h, stdio.h, stdlib.h, string.h, tgmath.h, time.h, wchar.h, and wctype.h are not available and cannot be included by a program. yes, that whole list. all of them. gone ๐ŸŒˆ
  • the auto and register storage-class specifiers are not supported.
  • recursion is not supported. she cannot call herself, periodt ๐Ÿ’…
  • the function using the functionQualifiers(3clc) qualifier can only have return type void in the source code.
  • arguments to kernel functions in a program cannot be declared with the built-in scalar types bool, half, size_t, ptrdiff_t, intptr_t, and uintptr_t, 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 half 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. half is not supported as half can be used as a storage format only (unless the cl_khr_fp16(3clc) extension is supported) and is not a data type on which floating-point arithmetic can be performed. so like... don't try to do math on it, she's decorative ๐Ÿ˜ญ
  • whether or not irreducible control flow is illegal is implementation defined. shrug, it depends ๐Ÿฆ‹
  • arguments to kernel functions in a program cannot be declared to be of type otherDataTypes(3clc).
  • 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. one space, one family, no mixing ๐Ÿซถ
  • 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.
  • the type qualifiers const, restrict, and volatile as defined by the C99 specification are supported. these qualifiers cannot be used with otherDataTypes(3clc), otherDataTypes(3clc), otherDataTypes(3clc), otherDataTypes(3clc), otherDataTypes(3clc), and otherDataTypes(3clc) types. types other than pointer types shall not use the restrict qualifier.
  • the event type (otherDataTypes(3clc)) 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 local(3clc), constant(3clc), and global(3clc) address space qualifiers. so many no's for one little type, iconic honestly โœจ

๐Ÿ“œ SPECIFICATION ๐Ÿ“œ

OpenCL Specification[1]


๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

imageFunctions(3clc), functionQualifiers(3clc)


๐Ÿซถ 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 231, section 6.9 - Restrictions

and that's the whole page bestie, no cap ๐Ÿ’œ shoutout to The Khronos Group for writing it and for the date stamp 01/14/2021 โ€” this is RESTRICTIONS(3clc), signing off, slay ๐ŸŒธ

๐Ÿ“ฆ where this page comes from