decuda 0.1.0

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. Edit with care.
// HIP is mostly source-compatible with CUDA at the kernel level.
// Compare against the original .cu file for sanity.

// 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 <hip/hip_runtime.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);";

__global__ void real_kernel(int* x) {
    x[threadIdx.x] = 1;
}

void launch(int* x) {
    hipLaunchKernelGGL(real_kernel, dim3(1), dim3(32), 0, 0, x);
}