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.
// SYCL kernels replace CUDA kernels with parallel_for lambdas; this
// output is a *starting point* and almost always requires manual
// follow-up. Look for the `TODO(decuda)` markers in this file.

#include <sycl/sycl.hpp>

// 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 <sycl/sycl.hpp> /* 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);";

// TODO(decuda): rewrite as SYCL kernel lambda
 void real_kernel(int* x) {
    x[item.get_local_id()] = 1;
}

void launch(int* x) {
    { /* decuda SYCL launch: queue.submit([&](sycl::handler& h) { h.parallel_for(sycl::range<3>{1}, [=](sycl::item<3> it) { /* kernel `real_kernel` body with thread indices from it.get_*() */ }); }); smem=none stream=default args=x */ };
}