From 5a131ae36e4b0010a96ddbb0cf57eb740c0518c2 Mon Sep 17 00:00:00 2001 From: Yora <13516067@std.stei.itb.ac.id> Date: Thu, 11 Apr 2019 20:06:15 +0700 Subject: [PATCH] add radix --- src/radix_sort_par3.cu | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/radix_sort_par3.cu b/src/radix_sort_par3.cu index d23ea58..22ef443 100644 --- a/src/radix_sort_par3.cu +++ b/src/radix_sort_par3.cu @@ -40,13 +40,13 @@ void countSort(int arr[], int n, int exp) // Change count[i] so that count[i] now contains actual // position of this digit in output[] for (i = 1; i < 10; i++) - count[i] += count[i - 1]; + h_count[i] += h_count[i - 1]; // Build the output array for (i = n - 1; i >= 0; i--) { - output[count[ (arr[i]/exp)%10 ] - 1] = arr[i]; - count[ (arr[i]/exp)%10 ]--; + output[h_count[ (arr[i]/exp)%10 ] - 1] = arr[i]; + h_count[ (arr[i]/exp)%10 ]--; } // Copy the output array to arr[], so that arr[] now -- GitLab