diff --git a/pyopencl/scan.py b/pyopencl/scan.py index 3566103eba57e539cfb0dda56321adbceca619d0..61cf90a94c87875c846806e4ffa24732fb9efd54 100644 --- a/pyopencl/scan.py +++ b/pyopencl/scan.py @@ -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):