FUTHARK-OPENCL(1)
β¨ FUTHARK-OPENCL β¨
okay bestie, welcome to the futhark-opencl manual page β it's a section 1 command, and it's literally your gateway to compiling Futhark to OpenCL π
π NAME π
futhark-opencl β compile Futhark to OpenCL
π¦ SYNOPSIS π¦
futhark opencl [options...] <program.fut>
π DESCRIPTION π
so like, what does futhark opencl even do? bestie. it takes your Futhark program and translates it into C code that invokes OpenCL kernels. then it does one of two things, and it's giving β¨choicesβ¨:
- it either compiles that C code with a C compiler into an executable binary program,
- or it produces a
.hand.cfile that can be linked with other code.
and yes, the standard Futhark optimisation pipeline is used β the good pipeline, the one you know and love π
one thing to know: futhark opencl links with -lOpenCL (and on macOS it's -framework OpenCL, iconic). so if you're using --library, you're gonna need to do the same thing when you link the final binary. no cap. don't skip that step or it's over for you π
oh also β the GPU terminology used here is derived from CUDA nomenclature (like it says "thread block" instead of "workgroup"), but OpenCL nomenclature is also supported for compatibility. so if you see "group" things floating around, that's why. iykyk π
π OPTIONS π
accepts the same options as futhark-c. that's it, that's the whole section β go read that one, bestie π«Ά
πΈ ENVIRONMENT VARIABLES πΈ
CCβ the C compiler used to compile the program. defaults toccif unset.CFLAGSβ a space-separated list of options passed to the C compiler. defaults to-O -std=c99if unset.
π₯ EXECUTABLE OPTIONS π₯
the generated executables accept the same options as those generated by futhark-c.
but listen, about the -t option β the timing tea β the time taken to perform device setup or teardown, including writing the input or reading the result, is not included in the measurement. in particular, that means timing starts after all kernels have been compiled and data has been copied to the device buffers, but before setting any kernel arguments. and timing stops after the kernels are done running, but before data has been read from the buffers or the buffers have been released. so you're timing the actual kernel work, periodt π
the following additional options are accepted:
--build-option=OPTβ add an additional build option to the string passed toclBuildProgram(). refer to the OpenCL documentation for which options are supported. be careful β some options can easily result in invalid results π like, actually, watch out.--default-thread-block-size=INT,--default-group-size=INTβ the default size of thread blocks that are launched. capped to the hardware limit if necessary.--default-num-thread-blocks,--default-num-groups=INTβ the default number of thread blocks that are launched.--default-threshold=INTβ the default parallelism threshold used for comparisons when selecting between code versions generated by incremental flattening. intuitively? the amount of parallelism needed to saturate the GPU β¨--default-tile-size=INTβ the default tile size used when performing two-dimensional tiling (the workgroup size will be the square of the tile size).-d,--device=NAMEβ use the first OpenCL device whose name contains the given string. the special string#k, wherekis an integer, can be used to pick thek-th device, numbered from zero. if used in conjunction with-p, only the devices from matching platforms are considered π―--dump-opencl=FILEβ don't run the program, but instead dump the embedded OpenCL program to the indicated file. useful if you want to see what is actually being executed π--dump-opencl-binary=FILEβ don't run the program, but instead dump the compiled version of the embedded OpenCL program to the indicated file. on NVIDIA platforms, this will be PTX code.--load-opencl=FILEβ instead of using the embedded OpenCL program, load it from the indicated file.--load-opencl-binary=FILEβ load an OpenCL binary from the indicated file.-p,--platform=NAMEβ use the first OpenCL platform whose name contains the given string. the special string#k, wherekis an integer, can be used to pick thek-th platform, numbered from zero.--list-devicesβ list all OpenCL devices and platforms available on the system π₯οΈβ¨
π SEE ALSO π
futhark-test, futhark-cuda, futhark-c
π Copyright π
2013-2020, DIKU, University of Copenhagen
and that's the whole page, bestie!! this manual page is from the Futhark manual, version 0.25.32, dated Mar 11, 2026. slay, go compile something iconic πβ¨ππ¦
π¦ 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