69

Sorting and Permuting without Bank Conflicts on GPUs

Abstract

In this paper, we look at the complexity of designing algorithms without any bank conflicts in the shared memory of Graphical Processing Units (GPUs). Given input of size nn, ww processors and ww memory banks, we study three fundamental problems: sorting, permuting and ww-way partitioning (defined as sorting an input containing exactly n/wn/w copies of every integer in [w][w]). We solve sorting in optimal O(nwlogn)O(\frac{n}{w} \log n) time. When nw2n \ge w^2, we solve the partitioning problem optimally in O(n/w)O(n/w) time. We also present a general solution for the partitioning problem which takes O(nwlogn/w3w)O(\frac{n}{w} \log^3_{n/w} w) time. Finally, we solve the permutation problem using a randomized algorithm in O(nwlogloglogn/wn)O(\frac{n}{w} \log\log\log_{n/w} n) time. Our results show evidence that when working with banked memory architectures, there is a separation between these problems and the permutation and partitioning problems are not as easy as simple parallel scanning.

View on arXiv
Comments on this paper