FUTHARK-HIP(1)
π FUTHARK-HIP(1) π
okay bestie, welcome to the Futhark manual, and this specific little icon is futhark-hip β yes it says "hip" and yes it's giving caffeinated older sibling energy to futhark-cuda. let's get into it π«Ά
β¨ NAME β¨
futhark-hip β compile Futhark to HIP π
β¨ SYNOPSIS β¨
futhark hip [options...] <program.fut>
β¨ DESCRIPTION β¨
so like. futhark hip takes your Futhark program and translates it into C code that invokes HIP kernels. then it does one of two things: either it hands that C code to a C compiler and out pops an executable binary, or it gives you back a .h and a .c file that you can link with your other code. your call, main character. β¨
and no cap, it runs the whole standard Futhark optimisation pipeline. the usual glow-up. π
for linking, futhark hip uses -lhiprtc -lamdhip64. important: if you're rolling with --library, you gotta do the exact same linking when you link your final binary β don't skip it, it will not slay. π
also real talk: yeah, the HIP backend can be made to work on NVIDIA GPUs, but honestly? you're probably better off using the very similar futhark-cuda. just saying. π
β¨ OPTIONS β¨
it accepts the same options as futhark-c. that's it, that's the tea. π
β¨ ENVIRONMENT VARIABLES β¨
CCβ the C compiler it uses to compile your program. if it's unset, it lowkey just defaults tocc.CFLAGSβ a space-separated list of options that get passed to the C compiler. if unset, defaults to-O -std=c99.
β¨ EXECUTABLE OPTIONS β¨
the executables it generates accept the same options as the ones from futhark-c. π« and for commonality purposes, the options use OpenCL nomenclature β so it says "group" instead of "thread block". iykyk. πΈ
and here are the additional options it accepts, bestie:
--default-group-size=INTβ the default size of the thread blocks that get launched. it'll get capped to the hardware limit if it needs to be, no stress.--default-num-groups=INTβ the default number of thread blocks that get launched.--default-threshold=INTβ the default parallelism threshold, used for comparisons when it's selecting between code versions generated by incremental flattening. intuitively? it's the amount of parallelism you need to saturate the GPU. π₯--default-tile-size=INTβ the default tile size used when doing two-dimensional tiling. heads up: the workgroup size will be the square of the tile size, so math accordingly. β¨--dump-hip=FILEβ don't run the program, just dump the embedded HIP kernels into the file you point at. obsessed with this one honestly, it's perfect if you wanna see what's actually being executed. π--load-hip=FILEβ instead of using the embedded HIP kernels, load them from the file you specify.--build-option=OPTβ adds an extra build option to the string that gets passed to the kernel compiler (HIPRTC). go read the HIP documentation to see which options are supported. be careful tho β some options can very easily give you invalid results. like, easily. π
β¨ ENVIRONMENT β¨
if you run it without --library, futhark hip 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 HIP libraries. that's the whole vibe check. π¦
β¨ SEE ALSO β¨
futhark
β¨ Copyright β¨
2013-2020, DIKU, University of Copenhagen
and that's the whole page, bestie π version 0.25.32, dated Mar 11, 2026 β go compile something iconic. periodt. ππ
π¦ where this page comes from
- ubuntu resolute: futhark 0.25.32-3build1 Β· ISC
- ubuntu stonking: futhark 0.25.32-3build1 Β· ISC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms