summaryrefslogtreecommitdiff
path: root/expt_0502.cu
diff options
context:
space:
mode:
Diffstat (limited to 'expt_0502.cu')
-rw-r--r--expt_0502.cu11
1 files changed, 6 insertions, 5 deletions
diff --git a/expt_0502.cu b/expt_0502.cu
index eb4ff5b..0c89535 100644
--- a/expt_0502.cu
+++ b/expt_0502.cu
@@ -1,5 +1,7 @@
// Experimental content: Test the correctness of binary search and
// special(single thread) search
+#define ENABLE_SORT_TEST
+#define SORT_FIRST_VERSION
#include "sortlib.cuh"
#include <algorithm>
@@ -58,8 +60,7 @@ __global__ void kernel(unsigned long step, const double slice_size) {
// printf("%d\n", tid);
auto index = (int)(custom_sort.sample_cdf_custom_version(
- cudaSampleItem, cudaSampleItem + SAMPLE_LENGTH,
- cudaPopulationItem[tid]) /
+ cudaSampleItem, cudaPopulationItem[tid]) /
slice_size) -
1;
@@ -90,9 +91,9 @@ __global__ void kernel2(unsigned long step, const double _slice_size) {
// printf("%d\n", tid);
auto index = custom_sort.calculate_index(
- custom_sort.binary_search(cudaSampleItem,
- cudaSampleItem + SAMPLE_LENGTH,
- cudaPopulationItem[tid]) -
+ custom_sort.original_binary_search(cudaSampleItem,
+ cudaSampleItem + SAMPLE_LENGTH,
+ cudaPopulationItem[tid]) -
cudaSampleItem);
auto index2 =