From f63de331e49dbaf81bf23560fce2273cdd2993dd Mon Sep 17 00:00:00 2001 From: Yora <13516067@std.stei.itb.ac.id> Date: Thu, 11 Apr 2019 20:43:24 +0700 Subject: [PATCH] add radix --- src/radix_sort_par3.cu | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/radix_sort_par3.cu b/src/radix_sort_par3.cu index 3228e5d..5155392 100644 --- a/src/radix_sort_par3.cu +++ b/src/radix_sort_par3.cu @@ -30,13 +30,11 @@ void countSort(int arr[], int n, int exp) int d_count[10] = {0}; int h_count[10] = {0}; cudaMalloc((void**)&d_arr,sizeof(int)*n); - //cudaMalloc((void**)&count,sizeof(int)*10); cudaMemcpy(d_arr, arr, sizeof(int)*n,cudaMemcpyHostToDevice); - //cudaMemset(d_count,0,sizeof(int)*10); // Store count of occurrences in count[] storeCount<<<1,32>>>(d_count,d_arr,n,exp); - cudaMemcpy(h_count, d_count, sizeof(int)*10,cudaMemcpyDeviceToHost); + cudaMemcpy(h_count, d_count, sizeof(int)*n,cudaMemcpyDeviceToHost); // Change count[i] so that count[i] now contains actual // position of this digit in output[] for (i = 1; i < 10; i++) -- GitLab