This example implements inclusive and exclusive scans. For details on the algorithm used, please refer to the relevant CUDA blog entry.
Inclusive scan, or prefix sum, converts an input vector
To run, call the executable with -t 0:
$ ./scan -t 0Exclusive scan (or "all-prefix-sums") is the same as inclusive scan, but excludes the
To run, call the executable with -t 1:
$ ./scan -t 1To run this example use the following:
$ mkdir build && cd build
$ ccmake .. # configure your backends, configure and generate (make sure to enable examples)
$ cmake --build . --target=scan -j
$ ./example/scan/scanThe example is also added as a test, where it runs 2^24 elements and inclusive scan by default. To change the number of elements scanned, use -n N. To change between inclusive/exclusive scan, use -t 0 or -t 1.