Use at your own risk.
Tested with Jai 0.2.012
Copy the CUDA Toolkit into the same directory as generate.jai, matching up the path with the definitions in that file.
Usually I'll have a routine like the following in my metaprogram that rebuilds the kernel code alongside the jai host program.
compile_kernels :: ()
{
files := file_list("./src");
cuda_kernel_files: [..] string;
for files
{
if ends_with(it, ".cu") array_add(*cuda_kernel_files, it);
}
nvcc_options :: string.[
"--gpu-architecture=sm_89",
"--cubin",
"-Wno-deprecated-gpu-targets",
"-g",
"-lineinfo",
];
debug_options :: string.[
"--optimize",
"0",
"--keep-device-functions"
];
{
command: [..] string;
array_add(*command, "nvcc");
array_add(*command, ..nvcc_options);
array_add(*command, ..cuda_kernel_files);
array_add(*command, "-o", "out/cuda_output.cubin");
run_command(..command, print_captured_output=true);
}
}