Skip to content
Snippets Groups Projects
Commit 1ee0e671 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Scan docs: Provide usage example for generic scan.

parent f0629644
Branches
Tags
No related merge requests found
......@@ -1019,6 +1019,20 @@ class _GenericScanKernelBase(object):
class GenericScanKernel(_GenericScanKernelBase):
"""Generates and executes code that performs prefix sums ("scans") on
arbitrary types, with many possible tweaks.
Usage example::
from pyopencl.scan import GenericScanKernel
knl = GenericScanKernel(
context, np.int32,
arguments="__global int *ary",
input_expr="ary[i]",
scan_expr="a+b", neutral="0",
output_statement="ary[i+1] = item;")
a = cl.array.arange(queue, 10000, dtype=np.int32)
scan_kernel(a, queue=queue)
"""
def finish_setup(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment