From a9637541441bf1388bb2a25ad347771b37309293 Mon Sep 17 00:00:00 2001
From: Yora <13516067@std.stei.itb.ac.id>
Date: Thu, 11 Apr 2019 20:52:35 +0700
Subject: [PATCH] add radix
---
src/radix_sort_par3.cu | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/radix_sort_par3.cu b/src/radix_sort_par3.cu
index b0701f5..cb91cab 100644
--- a/src/radix_sort_par3.cu
+++ b/src/radix_sort_par3.cu
@@ -15,7 +15,10 @@ int getMax(int arr[], int n)
}
__global__ void storeCount(int *count, int *arr, int n, int exp){
- for (int i = 0; i < n; i++)
+ int index = threadIdx.x;
+ int stride = blockDim.x;
+
+ for (int i = index; i < n; i+=stride)
count[ (arr[i]/exp)%10 ]++;
}
--
GitLab