FUTHARK-CUDA(1) | Futhark | FUTHARK-CUDA(1) |
futhark-cuda - compile Futhark to CUDA
futhark cuda [options...] <program.fut>
futhark cuda translates a Futhark program to C code invoking CUDA kernels, and either compiles that C code with a C compiler to an executable binary program, or produces a .h and .c file that can be linked with other code. The standard Futhark optimisation pipeline is used.
futhark cuda uses -lcuda -lcudart -lnvrtc to link. If using --library, you will need to do the same when linking the final binary.
The generated CUDA code can be called from multiple CPU threads, as it brackets every API operation with cuCtxPushCurrent() and cuCtxPopCurrent().
Accepts the same options as futhark-c.
CC
CFLAGS
Generated executables accept the same options as those generated by futhark-c. The -t option behaves as with futhark-opencl.
The following additional options are accepted.
If run without --library, futhark cuda will invoke a C compiler to compile the generated C program into a binary. This only works if the C compiler can find the necessary CUDA libraries. On most systems, CUDA is installed in /usr/local/cuda, which is usually not part of the default compiler search path. You may need to set the following environment variables before running futhark cuda:
LIBRARY_PATH=/usr/local/cuda/lib64 LD_LIBRARY_PATH=/usr/local/cuda/lib64/ CPATH=/usr/local/cuda/include
At runtime the generated program must be able to find the CUDA installation directory, which is normally located at /usr/local/cuda. If you have CUDA installed elsewhere, set any of the CUDA_HOME, CUDA_ROOT, or CUDA_PATH environment variables to the proper directory.
futhark-opencl
2013-2020, DIKU, University of Copenhagen
January 6, 2025 | 0.25.23 |