decuda 0.1.1

CUDA to HIP, SYCL, OpenCL, and Rust GPU migration tool — automatic source-code translator for porting CUDA C++ kernels to AMD ROCm HIP, Intel oneAPI SYCL, Khronos OpenCL, and Rust GPU (cust / rust-gpu)
Documentation
// Generated by decuda.
// OpenCL device code is the bulk of this file. The host-side calls
// (`cudaXxx`) have been rewritten to OpenCL equivalents inline; the
// surrounding host program still needs a cl_context + cl_queue, not
// included here. Look for TODO(decuda) markers for items requiring
// manual attention.

// Fixture: kernel-launch syntax inside comments and string literals must
// NOT be captured by the preprocessor. Only the real launch on the last
// line should be harvested.
#include <CL/cl.h> /* was: cuda_runtime.h */

// Here is a fake launch in a line comment: foo<<<1, 1>>>(a);
/* block comment: bar<<<2, 2>>>(b, c); */
const char* code = "k<<<1, 1>>>(x);";

__kernel void real_kernel(int* x) {
    x[get_local_id(0)] = 1;
}

void launch(int* x) {
    clEnqueueNDRangeKernel(queue, real_kernel_kernel, 1, NULL, (size_t[1]){1}, (size_t[1]){32}, 0, NULL, NULL) /* args: x */;
}