diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2017-12-26 20:59:23 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2017-12-26 20:59:23 +0100 |
commit | 2a72714b6e5fc9a966489720b4dd787d08899f2c (patch) | |
tree | d88085b29d3a9e930ef12a15dc6f6bd52b5c76eb /docs | |
parent | 429fa5cf173d1dc914faa15be9d79ff926718bff (diff) | |
download | ufo-filters-2a72714b6e5fc9a966489720b4dd787d08899f2c.tar.gz ufo-filters-2a72714b6e5fc9a966489720b4dd787d08899f2c.tar.bz2 ufo-filters-2a72714b6e5fc9a966489720b4dd787d08899f2c.tar.xz ufo-filters-2a72714b6e5fc9a966489720b4dd787d08899f2c.zip |
Document reduction kernels
Diffstat (limited to 'docs')
-rw-r--r-- | docs/filters.rst | 5 | ||||
-rw-r--r-- | docs/kernels.rst | 33 |
2 files changed, 37 insertions, 1 deletions
diff --git a/docs/filters.rst b/docs/filters.rst index f6b914d..719719f 100644 --- a/docs/filters.rst +++ b/docs/filters.rst @@ -518,7 +518,7 @@ Reducing with OpenCL kernel void sum (global float *in, global float *out) { size_t idx = get_global_id (1) * get_global_size (0) + get_global_id (0); - in[idx] += out[idx]; + out[idx] += in[idx]; } kernel void divide (global float *out, uint count) @@ -531,6 +531,9 @@ Reducing with OpenCL ufo-launch ... ! opencl-reduce kernel=sum finish=divide ! ... + If :gobj:prop:`filename` is not set, a default kernel file is loaded. See + :ref:`opencl-reduction-default-kernels` for a list of possible kernels. + .. gobj:prop:: filename:string Filename with kernel sources to load. diff --git a/docs/kernels.rst b/docs/kernels.rst index f2f77e1..cd0020c 100644 --- a/docs/kernels.rst +++ b/docs/kernels.rst @@ -17,3 +17,36 @@ This section lists all kernel functions that are available to the .. c:function:: void nlm_noise_reduction () Smooths data within a local neighbourhood. + + +.. _opencl-reduction-default-kernels: + + +OpenCL reduction default kernels +================================ + +This section lists all kernel functions that are available to the +:gobj:class:`opencl-reduce` filter if no filename is specified. These kernels +are supposed to be used for the ``kernel`` argument. + +.. c:function:: void minimum () + + Computes the minimum of each pixel in the stream. + +.. c:function:: void maximum () + + Computes the maximum of each pixel in the stream. + +.. c:function:: void sum () + + Computes the sum of each pixel in the stream. + + +These kernels are supposed to be used in the ``finish`` argument: + +.. c:function:: void divide () + + Divides each pixel by the stream count. Together with ``sum`` this can be + used to compute the average, i.e.:: + + ufo-launch .. ! opencl-reduce kernel=sum finish=divide ! .. |