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
//! HIP backend: emits HIP C++. The structural rewrite lives in `emit.rs`; this
//! module owns the HIP-specific banner header.

use crate::ir::TranslationUnit;
use crate::targets::TargetBackend;

pub struct HipBackend;

impl TargetBackend for HipBackend {
    fn banner(&self, src: &str) -> String {
        let _ = src;
        "// Generated by decuda. Edit with care.\n\
         // HIP is mostly source-compatible with CUDA at the kernel level.\n\
         // Compare against the original .cu file for sanity.\n\n"
            .to_string()
    }

    fn emit(&self, unit: &TranslationUnit) -> String {
        crate::emit::emit(crate::cli::Target::Hip, self, unit)
    }
}