# decuda TODO
## Done
- [x] Core pipeline: preprocess → parse → IR → emit → write
- [x] HIP backend (near-1:1 with CUDA)
- [x] SYCL backend (placeholder blocks)
- [x] Rust backend (cust/rust-gpu scaffold)
- [x] OpenCL backend
- [x] CUDA API database (memory, streams, events, errors, types, math intrinsics)
- [x] Kernel launch preprocessor (comment/string skipping)
- [x] Byte-precise span rewriter with overlap detection
- [x] Migration report (JSON + human-readable)
- [x] CLI: migrate, inspect, list-apis
- [x] 15 CUDA example/fixture files covering basic through advanced constructs
- [x] 115 tests (43 unit + 72 integration)
- [x] 3 runnable examples (inspect, migrate, list_apis)
- [x] Root docs: README, SPEC, ARCHITECTURE, AGENTS, MEMORY
- [x] Expand CUDA API database: `cudaDeviceSynchronize`, `cudaMallocManaged`, `cudaFreeHost`, `cudaMemcpyToSymbol`, `cudaMemcpyFromSymbol`, `cudaDeviceReset`, `cudaDeviceGetAttribute` (HIP mappings; SYCL/Rust/OpenCL flagged as semantic)
- [x] Warp primitive builtins: `__shfl_sync`, `__ballot_sync`, `__any_sync`, `__all_sync`, `__activemask` (harvested as BuiltinRef, per-target name swap with args preserved)
- [x] Inline PTX assembly detection: `asm("...")` / `asm volatile("...")` flagged as Warning nodes, preserved verbatim, reported in migration report
- [x] SEO-friendly Cargo.toml and README.md
## In Progress
- [ ] Expand CUDA API database coverage (see Brainstorming below)
## Planned
- [ ] Cooperative groups API
- [ ] Texture/surface references (`texture<>`, `surface<>`)
## Brainstorming
### Competitive intelligence (vs. HIPIFY, SYCLomatic, cu2clang)
- [ ] **Batch mode**: process multiple directories in one invocation
- [ ] **Config file**: user-supplied API mapping overrides (`.decuda.toml`)
- [ ] **Diff mode**: show only what changed vs. input
- [ ] **Round-trip validation**: re-parse emitted output to check it's valid target code
- [ ] **CMake integration**: `decuda_add_library()` CMake macro
- [ ] **Incremental migration**: only re-emit files that changed since last run
- [ ] **More HIP coverage**: `cudaDeviceSynchronize`, `cudaDeviceReset`, `cudaDeviceGetAttribute`
- [ ] **SYCL 2020 features**: `sycl::malloc_device`, `sycl::queue::submit` with reductions
- [ ] **Rust-gpu**: real SPIR-V kernel fn emission (not just placeholder)
- [ ] **OpenCL 2.0+**: `pipe`, `svm`, `device-side enqueue`
- [ ] **Thrust → stdpar / SYCL ranges**: detect Thrust calls and map to target equivalents
- [ ] **CUB**: detect CUB block-level primitives and map to target equivalents
- [ ] **cuBLAS → hipBLAS / oneMKL**: linear algebra library mapping
- [ ] **cuDNN → MIOpen / oneDNN**: neural network library mapping
### Quality of life
- [ ] `--color` flag for colored stdout output
- [ ] `--report-format` (json, text, sarif)
- [ ] Exit codes: non-zero if any errors, zero if only warnings
- [ ] `decuda version` subcommand
- [ ] Shell completions (`--generate-completions bash/zsh/fish`)