diff --git a/src/radix_sort_par3.cu b/src/radix_sort_par3.cu index d23ea5810bb2e17e8d4a3a02fc8d94a344020b9a..22ef443792ca532164d0b8e7c75c507491d94040 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