FUTHARK-PYOPENCL(1)

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

✨ FUTHARK-PYOPENCL ✨

okay bestie, welcome to the futhark-pyopencl girlies club πŸ’… this one lives over in the Futhark manual section, and it is literally the "compile Futhark to Python and OpenCL" situation. buckle up πŸŽ€


🌸 NAME 🌸

futhark-pyopencl β€” compile Futhark to Python and OpenCL πŸ¦‹


🫢 SYNOPSIS 🫢

futhark pyopencl [options...] infile

πŸ’– DESCRIPTION πŸ’–

so what does futhark pyopencl actually do, you ask? πŸ₯Ί it takes a Futhark program and translates it into Python code that goes and invokes OpenCL kernels. that generated Python depends on Numpy and PyOpenCL, so like, don't forget your dependencies, girlypop πŸ“

by default, the program uses the first device of the first OpenCL platform β€” and yes you can change that! but listen, this is the important part: you change it by passing the -p and -d options to the generated program, not to futhark pyopencl itself. okay? okay. no cap πŸ”₯

other than that, the resulting program behaves exactly like one compiled with futhark py. so here's the tea β˜• the sequential host-level code is pure Python and just as slow as it is in futhark py, but the parallel sections? those got compiled to OpenCL, and they run just as fast as when you're using futhark opencl. ate, honestly πŸ‘‘

BUT β€” and I cannot stress this enough β€” the kernel launch overhead is significantly higher 😭 so the good rule of thumb when you're using futhark pyopencl is to aim for having fewer but longer-lasting parallel sections. fewer lil short ones, more big chonky ones. that's the vibe check bestie ✨

also! the generated code requires at least PyOpenCL version 2015.2. old PyOpenCL is not it, bestie, upgrade 🧚


πŸ‘‘ OPTIONS πŸ‘‘

  • accepts the same options as futhark-opencl πŸ’œ go check that page, it's giving the full menu

🌈 SEE ALSO 🌈

  • futhark-python πŸ’–
  • futhark-opencl πŸ”₯

2013-2020, DIKU, University of Copenhagen


that's the whole page, babe β€” this was Futhark version 0.25.32, dated Mar 11, 2026. go forth and compile something iconic πŸŽ€βœ¨πŸ’…

πŸ“¦ where this page comes from