Call OpenCL from Kotlin or embed OpenCL inside Kotlin
Embedded OpenCL inside Kotlin
GitHub: https://github.com/dickensas/kotlin-gradle-templates/tree/master/embed-opencl
OpenCL code which runs from kotlin
#pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable
__constant char hw[] = "Hello World";
__kernel void hello(__global char * A) {
size_t tid = get_global_id(0);
A[tid] = hw[tid];
}
Kotlin code which runs OpenCL