Skip to content
Snippets Groups Projects
Commit eccf813f authored by Dinda Yora Islami's avatar Dinda Yora Islami
Browse files

add radix

parent 7039c806
Branches
No related merge requests found
......@@ -24,14 +24,13 @@ __global__ void storeCount(int *count, int *arr, int n, int exp){
void countSort(int arr[], int n, int exp)
{
int *d_arr;
int *count;
int *output= (int*)malloc(sizeof(int)*n); // output array
int i;
int i, count[10] = {0};
cudaMalloc((void**)&d_arr,sizeof(int)*n);
cudaMalloc((void**)&count,sizeof(int)*10);
//cudaMalloc((void**)&count,sizeof(int)*10);
cudaMemcpy(d_arr, arr, sizeof(int)*n,cudaMemcpyHostToDevice);
cudaMemset(count,0,sizeof(int)*10);
//cudaMemset(count,0,sizeof(int)*10);
// Store count of occurrences in count[]
storeCount<<<1,32>>>(count,d_arr,n,exp);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment