Skip to content

feat/cuda: I1 - CUDA backend skeleton (probe+create/free real, 100 op stubs) - #20

Open
magiodev wants to merge 6 commits into
antirez:mainfrom
magiodev:cuda/01-scaffold
Open

feat/cuda: I1 - CUDA backend skeleton (probe+create/free real, 100 op stubs)#20
magiodev wants to merge 6 commits into
antirez:mainfrom
magiodev:cuda/01-scaffold

Conversation

@magiodev

Copy link
Copy Markdown

Stacked PR 1/2 of the h3.c CUDA port (ds4-style, Metal preserved).

I1 scaffold: h3_cuda.cu (real h3_cuda_probe + create/free/error, compute ops stubbed), cuda-spark/cuda-generic Makefile targets (nvcc+cuBLAS, sm_121 for GB10), Linux host-deps (h3_tokenizer.c stub, vImage->bilinear, POSIX guards), extern "C" linkage fix. Build-gated on DGX Spark: make cuda-spark compiles clean, h3 binary runs. Metal files untouched.

…l, 100 op stubs)

- Add h3_cuda.cu: implements the existing plain-C h3_gpu.h API against CUDA/cuBLAS.
  h3_cuda_probe + h3_gpu_create/free/error real; all compute ops are stubs returning
  'not yet implemented'. Metal backend (h3_gpu.m/h3_shaders.metal) preserved untouched.
- Add h3_cuda.h (probe decl); h3.c probes via H3_CUDA guard.
- Add h3_tokenizer.c C stub (Linux has no Foundation; Metal keeps h3_tokenizer.m).
- h3_host.c: vImage high-quality scale guarded, portable bilinear fallback for CUDA build.
- h3.c/h3_cli.c/h3_ffmpeg.c: Linux portability guards (st_mtimespec->st_mtim,
  arc4random_buf->getrandom, SSIZE_MAX define).
- Makefile: cuda-spark/cuda-generic/cuda targets (nvcc + cuBLAS, .cuda.o objects,
  CUDA_ARCH=sm_121 for DGX Spark GB10), mirroring ds4's pattern.
…h in h3_cuda.cu

nvcc compiles .cu as C++; without C linkage the GPU API symbols were mangled
and the host C objects could not link. extern "C" guards are compile-time
only and inert for the Metal build (.c/.m never define __cplusplus).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant