Skip to content

yordanob/7003-CEM-Coursework-Code-Submission

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 

7003 CEM Code Submission


Introduction

This repository contains several pieces of code. As per usual the source code will be contained in src directory, and all of the supporting libraries will be present in the include directory. This coursework prompts us to chose 3 sorting algorithms and parallelise them utilising the following:

  • Threads;
  • CUDA;
  • A heterogenous approach, where the one of the CPU threads manages the GPU, while the other threads do computations as well.

Merge Sort

Merge sort is is an efficient, general-purpose, and comparison-based sorting algorithm. Following the divide-and-conquer principle, it has a complexity of , same as Quick Sort.

To run the concurrent version, use the command: g++ src/merge_sort.cpp && ./a.out
To run the CUDA threaded version, move the src/cuda_merge_sort.cu file to Visual Studio, and run it.

Quick Sort

Quick Sort is one of the most popular sorting algorithms that uses comparisons to sort an array of n elements in a typical situation. Quicksort is based on the divide-and-conquer strategy.

To run the concurrent and parallel version, use the command: g++ src/quick_sort.cpp && ./a.out
To run the CUDA threaded version, move the src/cuda_quick_sort.cu file to Visual Studio, and run it.

Radix Sort

Radix Sort is a non-comparative sorting algorithm. It avoids comparison by creating and distributing elements into buckets according to their radix. This algorithm has a time complexity of , where n represents the number of elelments, and k their length.

To run the concurrent version, use the command: g++ src/radix_sort.cpp && ./a.out
To run the CUDA threaded version, move the src/cuda_radix_sort.cu file to Visual Studio, and run it.

Suggestions & Help

If there you have any suggestions or you need help running or understanding the code, do not hesitate to reach out (either by making a new Issue, or by emailing me).

//EOP

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published