Sort: implementation of sorting algorithms in C and CUDA
sort
Repository of sorting algorithms in C and CUDA.
Proof of work
Information
The program generates and fills arrays in four different ways:
- arrays with totally random elements
- arrays already ordered
- arrays ordered in descending order
- arrays 90% ordered.
Sorting methods implemented
- Selection sort
- Insertion sort
- Shell sort
- Quick sort
- Heap sort
- Merge sort
- CUDA Quick sort
- CUDA Merge sort
Requirements
NVIDIA CUDA Toolkit 6.0, NVCC v6.0.1, GCC and G++
Follow these instructions to set up your environment:
prosciens’s tutorial to set up CUDA 6 compiler environment on Debian testing/sid
Our CUDA sorting code requires devices with CUDA compute capability 3.5 or higher, in order to use
the Dinamic Parallelism technology, read more about it here:
NVIDIA blog describing Dinamic Parallelism in Kepler GPUs
Compiling
Run the MAKEFILE
Instructions
To run the program, type:
./a.out -a $algorithm -n $number_of_elements -s $state [-P]
Parameters
- -a sorting algorithm
- -n number of elements
- -s array state
- -P print results
| Param | Value |
|---|---|
| -a | selection |
| insertion | |
| shell | |
| quick | |
| heap | |
| merge | |
| gpuquick | |
| gpumerge | |
| -n | int > 0 |
| -s | random |
| ascending | |
| descending | |
| almost | |
| -P |
Tested
CUDA code tested on a GeForce GT 740M
| GeForce GT 740M | Features |
|---|---|
| CUDA Driver Version / Runtime Version | 6.5 / 6.0 |
| CUDA Capability Major/Minor version number: | 3.5 |
| Total amount of global memory: | 2048 MBytes (2147352576 bytes) |
| ( 2) Multiprocessors, (192) CUDA Cores/MP: | 384 CUDA Cores |
Posted on Utopian.io - Rewarding Open Source Contributors
Leave Sort: implementation of sorting algorithms in C and CUDA to:
Read more #utopian-io posts
Best Posts From Ícaro Harry
We have not curated any of icaro's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Ícaro Harry
- Dev Diaries #0 - A fresh start at Utopian.io
- Is it okay for a dapp to be partially centralized, and if so, why?
- Moderation feed on moderators profile
- Fixed bug when contributions had the same title
- November and December contributions for Swapy Exchange
- My first contribution to Utopian: fixed bug when loading GitHub repos
- Sort: implementation of sorting algorithms in C and CUDA
- Commit: compete with your teammates!
- Getting started with Ganache: your personal blockchain for Ethereum development
- Commit
