Repository navigation
OpenCL Features
Bogdan edited this page Jun 21, 2026
·
2 revisions
get_work_dim()get_global_size(int dim)get_global_id(int dim)get_local_size(int dim)get_local_id(int dim)get_num_groups(int dim)get_group_id(int dim)
Supported math helpers live on GPU.
Common examples:
sincostanexploglog2powsqrtrsqrtfminfmaxmadclampmixstepsmoothstep
GPU.barrier(...)GPU.local_mem_fence()GPU.local_barrier()
Fence constants:
GPU.CLK_LOCAL_MEM_FENCEGPU.CLK_GLOBAL_MEM_FENCE
Basic image and sampler kernel parameters and OpenCL image intrinsics are supported.
Typical operations:
GPU.read_imagei(...)GPU.read_imagef(...)GPU.write_imagei(...)GPU.write_imagef(...)GPU.get_image_width(...)GPU.get_image_height(...)
Current limitation:
- code generation is implemented
- runtime marshalling for real image and sampler objects is still pending
@GPUGlobal@GPUConstant@GPULocal
Mappings:
-
@GPUGlobal->__global -
@GPUGlobal(constant = true)->__global const -
@GPUConstant->__constant -
@GPULocal->__local
@OpenCLAttributes
Typical use:
@OpenCLAttributes({"reqd_work_group_size(16, 1, 1)"})
@net.sixik.ga_utils.javatogpu.api.anotations.GPU
static void kernel(@GPUGlobal float[] output) {
output[0] = 1.0f;
}