File: futhark-pyopencl.rst

package info (click to toggle)
haskell-futhark 0.25.32-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 18,236 kB
  • sloc: haskell: 100,484; ansic: 12,100; python: 3,440; yacc: 785; sh: 561; javascript: 558; lisp: 399; makefile: 277
file content (42 lines) | stat: -rw-r--r-- 1,186 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
.. role:: ref(emphasis)

.. _futhark-pyopencl(1):

================
futhark-pyopencl
================

SYNOPSIS
========

futhark pyopencl [options...] infile

DESCRIPTION
===========

``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 ``-p`` and ``-d`` options to
the generated program (not to ``futhark pyopencl`` itself).

The resulting program will otherwise behave exactly as one compiled
with ``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
parallel sections.

The generated code requires at least PyOpenCL version 2015.2.

OPTIONS
=======

Accepts the same options as :ref:`futhark-opencl(1)`.

SEE ALSO
========

:ref:`futhark-py(1)`, :ref:`futhark-opencl(1)`