|
CCCC
C bytecode compiler + VM interpreter
|
Maps OpenCL C 1.2 onto the kernel model of <cccc/kernel.h>. Included automatically ahead of every input read as OpenCL C (-x cl, .cl). See docs/opencl.md.
More...
#include <cccc/kernel.h>
Go to the source code of this file.
Macros | |
| #define | __CL_VECTOR(base, name, bytes) typedef base name __attribute__((vector_size(bytes))) |
| #define | __CL_VECTOR3(base, name, bytes) typedef base name __attribute__((vector_size(bytes), cccc_visible_lanes(3))) |
Version | |
| #define | __OPENCL_C_VERSION__ 120 |
| #define | __OPENCL_VERSION__ 120 |
| #define | CL_VERSION_1_0 100 |
| #define | CL_VERSION_1_1 110 |
| #define | CL_VERSION_1_2 120 |
| #define | __ENDIAN_LITTLE__ 1 |
Qualifiers | |
| #define | __kernel [[cccc::__kernel__]] |
| #define | kernel [[cccc::__kernel__]] |
| #define | __global [[cccc::__global__]] |
| #define | global [[cccc::__global__]] |
| #define | __local [[cccc::__local__]] |
| #define | local [[cccc::__local__]] |
| #define | __constant [[cccc::__constant__]] |
| #define | constant [[cccc::__constant__]] |
| #define | __private [[cccc::__private__]] |
| #define | private [[cccc::__private__]] |
Work-item functions | |
Map onto the cccc_* builtins of kernel.h. | |
| #define | get_work_dim() cccc_work_dim() |
| #define | get_global_id(d) cccc_global_id(d) |
| #define | get_local_id(d) cccc_local_id(d) |
| #define | get_group_id(d) cccc_group_id(d) |
| #define | get_global_size(d) cccc_global_size(d) |
| #define | get_local_size(d) cccc_local_size(d) |
| #define | get_num_groups(d) cccc_num_groups(d) |
| #define | get_global_offset(d) ((size_t)0) |
Barriers and fences | |
| #define | CLK_LOCAL_MEM_FENCE CCCC_LOCAL_FENCE |
| #define | CLK_GLOBAL_MEM_FENCE CCCC_GLOBAL_FENCE |
| #define | barrier(flags) cccc_barrier(flags) |
| #define | mem_fence(flags) __atomic_thread_fence(__ATOMIC_SEQ_CST) |
| #define | read_mem_fence(flags) __atomic_thread_fence(__ATOMIC_SEQ_CST) |
| #define | write_mem_fence(flags) __atomic_thread_fence(__ATOMIC_SEQ_CST) |
Atomics | |
Return the old value. Also available under the OpenCL 1.0 | |
| #define | atomic_add(p, v) __atomic_fetch_add(p, v, __ATOMIC_SEQ_CST) |
| #define | atomic_sub(p, v) __atomic_fetch_sub(p, v, __ATOMIC_SEQ_CST) |
| #define | atomic_and(p, v) __atomic_fetch_and(p, v, __ATOMIC_SEQ_CST) |
| #define | atomic_or(p, v) __atomic_fetch_or(p, v, __ATOMIC_SEQ_CST) |
| #define | atomic_xor(p, v) __atomic_fetch_xor(p, v, __ATOMIC_SEQ_CST) |
| #define | atomic_inc(p) __atomic_fetch_add(p, 1, __ATOMIC_SEQ_CST) |
| #define | atomic_dec(p) __atomic_fetch_sub(p, 1, __ATOMIC_SEQ_CST) |
| #define | __CL_XCHG_F32(p, val) |
| #define | atomic_xchg(p, val) |
| #define | atomic_cmpxchg(p, cmp, val) |
| #define | __CL_ATOMIC_EXTREMUM(p, val, stops) |
| #define | atomic_min(p, val) __CL_ATOMIC_EXTREMUM(p, val, __cl_v < __cl_o) |
| #define | atomic_max(p, val) __CL_ATOMIC_EXTREMUM(p, val, __cl_v > __cl_o) |
| #define | atom_add atomic_add |
| #define | atom_sub atomic_sub |
| #define | atom_and atomic_and |
| #define | atom_or atomic_or |
| #define | atom_xor atomic_xor |
| #define | atom_xchg atomic_xchg |
| #define | atom_inc atomic_inc |
| #define | atom_dec atomic_dec |
| #define | atom_cmpxchg atomic_cmpxchg |
| #define | atom_min atomic_min |
| #define | atom_max atomic_max |
Typedefs | |
| typedef unsigned | __cl_generic_uint |
Scalar typedefs | |
| typedef unsigned char | uchar |
| typedef unsigned short | ushort |
| typedef unsigned int | uint |
| typedef unsigned long | ulong |
Functions | |
| __CL_VECTOR (signed char, char16, 16) | |
| __CL_VECTOR (unsigned char, uchar16, 16) | |
| __CL_VECTOR (short, short8, 16) | |
| __CL_VECTOR (short, short16, 32) | |
| __CL_VECTOR (unsigned short, ushort8, 16) | |
| __CL_VECTOR (unsigned short, ushort16, 32) | |
| __CL_VECTOR3 (int, int3, 16) | |
| __CL_VECTOR (int, int4, 16) | |
| __CL_VECTOR (int, int8, 32) | |
| __CL_VECTOR (int, int16, 64) | |
| __CL_VECTOR3 (unsigned int, uint3, 16) | |
| __CL_VECTOR (unsigned int, uint4, 16) | |
| __CL_VECTOR (unsigned int, uint8, 32) | |
| __CL_VECTOR (unsigned int, uint16, 64) | |
| __CL_VECTOR (long, long2, 16) | |
| __CL_VECTOR3 (long, long3, 32) | |
| __CL_VECTOR (long, long4, 32) | |
| __CL_VECTOR (long, long8, 64) | |
| __CL_VECTOR (unsigned long, ulong2, 16) | |
| __CL_VECTOR3 (unsigned long, ulong3, 32) | |
| __CL_VECTOR (unsigned long, ulong4, 32) | |
| __CL_VECTOR (unsigned long, ulong8, 64) | |
| __CL_VECTOR3 (float, float3, 16) | |
| __CL_VECTOR (float, float4, 16) | |
| __CL_VECTOR (float, float8, 32) | |
| __CL_VECTOR (float, float16, 64) | |
Maps OpenCL C 1.2 onto the kernel model of <cccc/kernel.h>. Included automatically ahead of every input read as OpenCL C (-x cl, .cl). See docs/opencl.md.
| #define __CL_ATOMIC_EXTREMUM | ( | p, | |
| val, | |||
| stops | |||
| ) |
| #define __CL_VECTOR | ( | base, | |
| name, | |||
| bytes | |||
| ) | typedef base name __attribute__((vector_size(bytes))) |
| #define __CL_VECTOR3 | ( | base, | |
| name, | |||
| bytes | |||
| ) | typedef base name __attribute__((vector_size(bytes), cccc_visible_lanes(3))) |
| #define __CL_XCHG_F32 | ( | p, | |
| val | |||
| ) |
| #define __constant [[cccc::__constant__]] |
| #define __ENDIAN_LITTLE__ 1 |
| #define __global [[cccc::__global__]] |
| #define __kernel [[cccc::__kernel__]] |
| #define __local [[cccc::__local__]] |
| #define __OPENCL_C_VERSION__ 120 |
| #define __OPENCL_VERSION__ 120 |
| #define __private [[cccc::__private__]] |
| #define atom_add atomic_add |
| #define atom_and atomic_and |
| #define atom_cmpxchg atomic_cmpxchg |
| #define atom_dec atomic_dec |
| #define atom_inc atomic_inc |
| #define atom_max atomic_max |
| #define atom_min atomic_min |
| #define atom_or atomic_or |
| #define atom_sub atomic_sub |
| #define atom_xchg atomic_xchg |
| #define atom_xor atomic_xor |
| #define atomic_add | ( | p, | |
| v | |||
| ) | __atomic_fetch_add(p, v, __ATOMIC_SEQ_CST) |
| #define atomic_and | ( | p, | |
| v | |||
| ) | __atomic_fetch_and(p, v, __ATOMIC_SEQ_CST) |
| #define atomic_cmpxchg | ( | p, | |
| cmp, | |||
| val | |||
| ) |
| #define atomic_dec | ( | p | ) | __atomic_fetch_sub(p, 1, __ATOMIC_SEQ_CST) |
| #define atomic_inc | ( | p | ) | __atomic_fetch_add(p, 1, __ATOMIC_SEQ_CST) |
| #define atomic_max | ( | p, | |
| val | |||
| ) | __CL_ATOMIC_EXTREMUM(p, val, __cl_v > __cl_o) |
| #define atomic_min | ( | p, | |
| val | |||
| ) | __CL_ATOMIC_EXTREMUM(p, val, __cl_v < __cl_o) |
| #define atomic_or | ( | p, | |
| v | |||
| ) | __atomic_fetch_or(p, v, __ATOMIC_SEQ_CST) |
| #define atomic_sub | ( | p, | |
| v | |||
| ) | __atomic_fetch_sub(p, v, __ATOMIC_SEQ_CST) |
| #define atomic_xchg | ( | p, | |
| val | |||
| ) |
| #define atomic_xor | ( | p, | |
| v | |||
| ) | __atomic_fetch_xor(p, v, __ATOMIC_SEQ_CST) |
| #define barrier | ( | flags | ) | cccc_barrier(flags) |
| #define CL_VERSION_1_0 100 |
| #define CL_VERSION_1_1 110 |
| #define CL_VERSION_1_2 120 |
| #define CLK_GLOBAL_MEM_FENCE CCCC_GLOBAL_FENCE |
| #define CLK_LOCAL_MEM_FENCE CCCC_LOCAL_FENCE |
| #define constant [[cccc::__constant__]] |
| #define get_global_id | ( | d | ) | cccc_global_id(d) |
| #define get_global_offset | ( | d | ) | ((size_t)0) |
| #define get_global_size | ( | d | ) | cccc_global_size(d) |
| #define get_group_id | ( | d | ) | cccc_group_id(d) |
| #define get_local_id | ( | d | ) | cccc_local_id(d) |
| #define get_local_size | ( | d | ) | cccc_local_size(d) |
| #define get_num_groups | ( | d | ) | cccc_num_groups(d) |
| #define get_work_dim | ( | ) | cccc_work_dim() |
| #define global [[cccc::__global__]] |
| #define kernel [[cccc::__kernel__]] |
| #define local [[cccc::__local__]] |
| #define mem_fence | ( | flags | ) | __atomic_thread_fence(__ATOMIC_SEQ_CST) |
| #define private [[cccc::__private__]] |
| #define read_mem_fence | ( | flags | ) | __atomic_thread_fence(__ATOMIC_SEQ_CST) |
| #define write_mem_fence | ( | flags | ) | __atomic_thread_fence(__ATOMIC_SEQ_CST) |
| typedef unsigned __cl_generic_uint |
| typedef unsigned char uchar |
| typedef unsigned int uint |
| typedef unsigned long ulong |
| typedef unsigned short ushort |
| __CL_VECTOR | ( | float | , |
| float16 | , | ||
| 64 | |||
| ) |
| __CL_VECTOR | ( | float | , |
| float4 | , | ||
| 16 | |||
| ) |
| __CL_VECTOR | ( | float | , |
| float8 | , | ||
| 32 | |||
| ) |
| __CL_VECTOR | ( | int | , |
| int16 | , | ||
| 64 | |||
| ) |
| __CL_VECTOR | ( | int | , |
| int4 | , | ||
| 16 | |||
| ) |
| __CL_VECTOR | ( | int | , |
| int8 | , | ||
| 32 | |||
| ) |
| __CL_VECTOR | ( | long | , |
| long2 | , | ||
| 16 | |||
| ) |
| __CL_VECTOR | ( | long | , |
| long4 | , | ||
| 32 | |||
| ) |
| __CL_VECTOR | ( | long | , |
| long8 | , | ||
| 64 | |||
| ) |
| __CL_VECTOR | ( | short | , |
| short16 | , | ||
| 32 | |||
| ) |
| __CL_VECTOR | ( | short | , |
| short8 | , | ||
| 16 | |||
| ) |
| __CL_VECTOR | ( | signed char | , |
| char16 | , | ||
| 16 | |||
| ) |
| __CL_VECTOR | ( | unsigned char | , |
| uchar16 | , | ||
| 16 | |||
| ) |
| __CL_VECTOR | ( | unsigned int | , |
| uint16 | , | ||
| 64 | |||
| ) |
| __CL_VECTOR | ( | unsigned int | , |
| uint4 | , | ||
| 16 | |||
| ) |
| __CL_VECTOR | ( | unsigned int | , |
| uint8 | , | ||
| 32 | |||
| ) |
| __CL_VECTOR | ( | unsigned long | , |
| ulong2 | , | ||
| 16 | |||
| ) |
| __CL_VECTOR | ( | unsigned long | , |
| ulong4 | , | ||
| 32 | |||
| ) |
| __CL_VECTOR | ( | unsigned long | , |
| ulong8 | , | ||
| 64 | |||
| ) |
| __CL_VECTOR | ( | unsigned short | , |
| ushort16 | , | ||
| 32 | |||
| ) |
| __CL_VECTOR | ( | unsigned short | , |
| ushort8 | , | ||
| 16 | |||
| ) |
| __CL_VECTOR3 | ( | float | , |
| float3 | , | ||
| 16 | |||
| ) |
| __CL_VECTOR3 | ( | int | , |
| int3 | , | ||
| 16 | |||
| ) |
| __CL_VECTOR3 | ( | long | , |
| long3 | , | ||
| 32 | |||
| ) |
| __CL_VECTOR3 | ( | unsigned int | , |
| uint3 | , | ||
| 16 | |||
| ) |
| __CL_VECTOR3 | ( | unsigned long | , |
| ulong3 | , | ||
| 32 | |||
| ) |