Counting and occurrence sort for GPUs using an embedded language

Josef David Svenningsson, Bo Joel Svensson, Mary Sheeran
2013 Proceedings of the 2nd ACM SIGPLAN workshop on Functional high-performance computing - FHPC '13  
This paper investigates two sorting algorithms: counting sort and a variation, occurrence sort, which also removes duplicate elements, and examines their suitability for running on the GPU. The duplicate removing variation turns out to have a natural functional, dataparallel implementation which makes it particularly interesting for GPUs. The algorithms are implemented in Obsidian, a high-level domain specific language for GPU programming. Measurements show that our implementations in many
more » ... ations in many cases outperform the sorting algorithm provided by the library Thrust. Furthermore, occurrence sort is another factor of two faster than ordinary counting sort. We conclude that counting sort is an important contender when considering sorting algorithms for the GPU, and that occurrence sort is highly preferable when applicable. We also show that Obsidian can produce very competitive code.
doi:10.1145/2502323.2502325 dblp:conf/icfp/SvenningssonSS13 fatcat:7xsny4aizbcgzmudfyrdxnbmai