futhark pyopencl [options…] infile
futhark pyopencl translates a Futhark program to Python code
invoking OpenCL kernels, which depends on Numpy and PyOpenCL. By
default, the program uses the first device of the first OpenCL
platform - this can be changed by passing
-d options to
the generated program (not to
futhark pyopencl itself).
The resulting program will otherwise behave exactly as one compiled
futhark py. While the sequential host-level code is pure
Python and just as slow as in
futhark py, parallel sections will
have been compiled to OpenCL, and runs just as fast as when using
futhark opencl. The kernel launch overhead is significantly
higher, however, so a good rule of thumb when using
futhark pyopencl is to aim for having fewer but longer-lasting
The generated code requires at least PyOpenCL version 2015.2.
Accepts the same options as futhark-opencl.