FUTHARK-HIP(1)

πŸ“¦
version 0.25.32 Β· 5 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– 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 to cc.
  • 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


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