|
CCCC
C bytecode compiler + VM interpreter
|
Work-item builtins and the launch builtin for [[cccc::kernel]] functions. See docs/kernels.md. More...
#include <stddef.h>

Go to the source code of this file.
Data Structures | |
| struct | cccc_range |
| An NDRange extent of one to three dimensions. Build one with CCCC_RANGE. More... | |
Macros | |
| #define | CCCC_LOCAL_FENCE 1 |
| Memory fence flags for cccc_barrier(). Every flag orders the same in the VM. | |
| #define | CCCC_GLOBAL_FENCE 2 |
| #define | CCCC_RANGE_DIMS_(_1, _2, _3, N, ...) N |
| #define | CCCC_RANGE(...) ((cccc_range){CCCC_RANGE_DIMS_(__VA_ARGS__, 3, 2, 1), {__VA_ARGS__}}) |
CCCC_RANGE(x), CCCC_RANGE(x, y) or CCCC_RANGE(x, y, z). | |
| #define | cccc_launch(k, g, l, ...) __builtin_kernel_launch(k, g, l, ##__VA_ARGS__) |
Launches a kernel over global work-items in work-groups of local. | |
| #define | CCCC_LOCAL(bytes) __builtin_kernel_local(bytes) |
Argument for a [[cccc::local]] pointer parameter: bytes of work-group memory. | |
Functions | |
| size_t | cccc_global_id (unsigned dim) |
| Index of the calling work-item in the whole range, per dimension. | |
| size_t | cccc_local_id (unsigned dim) |
| Index of the calling work-item within its work-group. | |
| size_t | cccc_group_id (unsigned dim) |
| Index of the calling work-item's work-group. | |
| size_t | cccc_global_size (unsigned dim) |
| Size of the whole range. | |
| size_t | cccc_local_size (unsigned dim) |
| Size of a work-group. | |
| size_t | cccc_num_groups (unsigned dim) |
| Number of work-groups. | |
| unsigned | cccc_work_dim (void) |
| Dimensions of the launch (1 outside a launch). | |
| void | cccc_barrier (unsigned fences) |
| Waits until every work-item of the group has reached the barrier. | |
Work-item builtins and the launch builtin for [[cccc::kernel]] functions. See docs/kernels.md.
| #define CCCC_GLOBAL_FENCE 2 |
| #define cccc_launch | ( | k, | |
| g, | |||
| l, | |||
| ... | |||
| ) | __builtin_kernel_launch(k, g, l, ##__VA_ARGS__) |
Launches a kernel over global work-items in work-groups of local.
| k | Kernel function (or pointer to one) marked [[cccc::kernel]]. |
| g | Global range, a cccc_range. |
| l | Work-group range, a cccc_range of the same dimensions. |
| #define CCCC_LOCAL | ( | bytes | ) | __builtin_kernel_local(bytes) |
Argument for a [[cccc::local]] pointer parameter: bytes of work-group memory.
| #define CCCC_LOCAL_FENCE 1 |
Memory fence flags for cccc_barrier(). Every flag orders the same in the VM.
| #define CCCC_RANGE | ( | ... | ) | ((cccc_range){CCCC_RANGE_DIMS_(__VA_ARGS__, 3, 2, 1), {__VA_ARGS__}}) |
| #define CCCC_RANGE_DIMS_ | ( | _1, | |
| _2, | |||
| _3, | |||
| N, | |||
| ... | |||
| ) | N |
| void cccc_barrier | ( | unsigned | fences | ) |
Waits until every work-item of the group has reached the barrier.
| size_t cccc_global_id | ( | unsigned | dim | ) |
Index of the calling work-item in the whole range, per dimension.
| size_t cccc_global_size | ( | unsigned | dim | ) |
Size of the whole range.
| size_t cccc_group_id | ( | unsigned | dim | ) |
Index of the calling work-item's work-group.
| size_t cccc_local_id | ( | unsigned | dim | ) |
Index of the calling work-item within its work-group.
| size_t cccc_local_size | ( | unsigned | dim | ) |
Size of a work-group.
| size_t cccc_num_groups | ( | unsigned | dim | ) |
Number of work-groups.
| unsigned cccc_work_dim | ( | void | ) |
Dimensions of the launch (1 outside a launch).