Skip to content

Latest commit

 

History

History
49 lines (27 loc) · 1.44 KB

c.md

File metadata and controls

49 lines (27 loc) · 1.44 KB

C

OpenCL C is a C99 variant in which kernels must be written.

https://en.wikipedia.org/wiki/OpenCL#OpenCL_C_language

C99 extensions:

C99 restrictions: https://www.khronos.org/registry/cl/sdk/2.1/docs/man/xhtml/restrictions.html

  • pointers to functions are not allowed

Qualifiers

https://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/qualifiers.html

__global

__local

Shared across the work group.

__constant

__private

Default qualifier for arguments and local function variables: https://www.khronos.org/registry/cl/sdk/2.1/docs/man/xhtml/global.html

__kernel

Marks a function that can be called from the host.

Must return void, https://www.khronos.org/registry/cl/sdk/2.1/docs/man/xhtml/restrictions.html

https://www.khronos.org/registry/cl/sdk/2.1/docs/man/xhtml/restrictions.html:

Arguments to kernel functions declared in a program that are pointers must be declared with the __global, __constant, or __local qualifier.

Built-in functions

Those may in particular take vector type arguments.