HW3: RC4 - Add a qsort for reference
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <cstdint>
|
||||
#include <utility>
|
||||
#include <stdexcept>
|
||||
#include <algorithm>
|
||||
|
||||
#include "utils.hpp"
|
||||
|
||||
@@ -117,8 +118,15 @@ __device__ void exchange(ValueT* data, threadId_t tid, threadId_t partner, bool
|
||||
data[partner] = temp;
|
||||
}
|
||||
}
|
||||
#if CODE_VERSION == SERIAL
|
||||
|
||||
#if CODE_VERSION == V0
|
||||
template <typename DataT>
|
||||
void bitonicSort(DataT& data) {
|
||||
std::sort(data.begin(), data.end());
|
||||
}
|
||||
|
||||
|
||||
#elif CODE_VERSION == V0
|
||||
|
||||
/*!
|
||||
* This is the body of each thread. This function compare and exchange data
|
||||
|
||||
@@ -28,6 +28,7 @@ static constexpr char version[] = "0.4";
|
||||
#define V0 0
|
||||
#define V1 1
|
||||
#define V2 2
|
||||
#define SERIAL 's'
|
||||
|
||||
// Fail-safe version selection
|
||||
#if !defined CODE_VERSION
|
||||
|
||||
Reference in New Issue
Block a user