taichi.algorithms
#
- class taichi.algorithms.PrefixSumExecutor(length)#
Parallel Prefix Sum (Scan) Helper
Use this helper to perform an inclusive in-place’s parallel prefix sum.
References
https://developer.download.nvidia.com/compute/cuda/1.1-Beta/x86_website/projects/scan/doc/scan.pdf https://github.com/NVIDIA/cuda-samples/blob/master/Samples/2_Concepts_and_Techniques/shfl_scan/shfl_scan.cu
- run(self, input_arr)#
- taichi.algorithms.parallel_sort(keys, values=None)#
Odd-even merge sort
References
https://developer.nvidia.com/gpugems/gpugems2/part-vi-simulation-and-numerical-algorithms/chapter-46-improved-gpu-sorting https://en.wikipedia.org/wiki/Batcher_odd%E2%80%93even_mergesort