Repository navigation
Runtime Dispatch and ABI
Bogdan edited this page Jun 21, 2026
·
2 revisions
- compile
@GPU - generate OpenCL
- generate launcher
- rewrite direct calls
- dispatch through
GpuRuntime
try (OpenClGpuRuntimeBackend backend = new OpenClGpuRuntimeBackend()) {
GpuRuntime.setBackend(backend);
Demo.kernel(input, output);
} finally {
GpuRuntime.setBackend(GpuRuntime.defaultBackend());
}-Ajavatogpu.debugAbi=true-Djavatogpu.opencl.debugAbi=true
Use -Ajavatogpu.debugAbi=true when you want compile-time diagnostics about how parameters and struct fields are interpreted by the processor.
Use -Djavatogpu.opencl.debugAbi=true when you want runtime diagnostics about final OpenCL-side marshalling and layout before launch.
This is especially useful for:
@GPUStruct- vector arrays
- packed and aligned data
- launcher argument mismatches
Processor diagnostics:
tasks.withType(JavaCompile).configureEach {
options.compilerArgs += ['-Ajavatogpu.debugAbi=true']
}Runtime diagnostics:
tasks.withType(Test).configureEach {
jvmArgs '-Djavatogpu.opencl.debugAbi=true'
}
tasks.withType(JavaExec).configureEach {
jvmArgs '-Djavatogpu.opencl.debugAbi=true'
}