Click here to Skip to main content
15,886,362 members
Articles / Programming Languages / CUDA

Parallel Radix Sort on the GPU using C++ AMP

Rate me:
Please Sign up or sign in to vote.
5.00/5 (11 votes)
9 Feb 2013CPOL5 min read 42.3K   57   18  
Examine the various approaches to implementing Radix sort on the GPU
In this article, we will look at the details of what Radix sort really does, and examine ways to implement it on GPUs with C++ AMP. The full source code is also provided for you to learn from, hack, and improve. Most of the logic is presented as diagrams and pseudo code.
  • amp_sort.zip
    • amp_sort - Copy
      • .git
        • COMMIT_EDITMSG
        • config
        • description
        • FETCH_HEAD
        • HEAD
        • hooks
          • applypatch-msg.sample
          • commit-msg.sample
          • post-commit.sample
          • post-receive.sample
          • post-update.sample
          • pre-applypatch.sample
          • pre-commit.sample
          • prepare-commit-msg.sample
          • pre-rebase.sample
          • update.sample
        • index
        • info
          • exclude
        • logs
          • HEAD
          • refs
            • heads
              • master
            • remotes
              • origin
                • master
        • objects
          • 0a
            • 606f7786aea14625d8ae58725b378ecb4dfded
          • 15
            • 93bf77f6387a5a1abe2cb5481c0a73ee0169cf
          • 36
            • 4001c6068ae5b9163d840d3665330e7afc0e2b
          • 38
            • ce9dfd33680566600a0d993d612f541ac14f13
          • 3a
            • 8815420cc84bf8c687c1deb72b6245832fa5fb
          • 76
            • 31fff19f0ac8f4d20082ee4263d55fb0a7e3df
          • 7e
            • c8f6ba4712344073aabf42f23989f0b628a57f
          • 85
            • a8dda81c252f5f34dc577c63f3cf59be8ecf53
          • 91
            • 1b27c2604afb94cda728e2b403d3d758f36231
          • a8
            • e7d50b515298a4f2f96353e81407d650d309cc
          • ac
            • 3c9b2273350189e9fed1fdf3df6af2c7a211b9
          • b2
            • 181893ec9893de2ae4b1d52961a194eac09371
          • b5
            • 75221d06c2f1e9bf1bbacfa25d638adb380b9e
          • bb
            • 8c27b9af1abc9764992e13c34468357a066123
          • be
            • 6035602ead9fc7ca4dee2c38484c1f6126d049
          • c0
            • 7aa6f7855d7426cb2a6a5489d2c2d4999c8a9d
          • c9
            • 6785d7b9afdc041df408d312b3409191a76df4
          • dd
            • 6d0f04524433f2e7e26ca465aee7b5a69fc377
          • f1
            • 0d6e6f594180782c9dad5053e2d252e30a64a1
          • info
          • pack
        • ORIG_HEAD
        • refs
          • heads
            • master
          • remotes
            • origin
              • master
          • tags
      • amp_sort.sln
      • amp_sort
# pragma once
typedef unsigned int uint;
#include <amp.h>

namespace pal
{
	void radix_sort(uint* start,  uint num);
	void radix_sort(concurrency::array_view<uint> arr);
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Student Indian Institute of Technology, Roorkee
India India
Debdatta Basu is a student at Indian Institute of Technology, Roorkee, currently pursuing his Bachelor's Degree in Electronics and Communication Engineering. He has four years of experience with C++, C#, Computer Graphics, and Parallel Programming.

Comments and Discussions