+1
This commit is contained in:
@@ -41,7 +41,7 @@ int main (int argc, char *argv[])
|
|||||||
|
|
||||||
#pragma omp parallel for
|
#pragma omp parallel for
|
||||||
for (int i = 0; i < n; i++)
|
for (int i = 0; i < n; i++)
|
||||||
keys[i] = drand48() * (1<<30);
|
keys[i] = 10*i; //drand48() * (1<<30);
|
||||||
|
|
||||||
std::random_shuffle(keys, keys + n);
|
std::random_shuffle(keys, keys + n);
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,11 @@ void sortPass(
|
|||||||
const uniform int blockDim = (numElements + numBlocks - 1) / numBlocks;
|
const uniform int blockDim = (numElements + numBlocks - 1) / numBlocks;
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
uniform int * uniform localCounts = sharedCounts + blockIdx*NUMDIGITS;
|
uniform int * uniform localCounts = sharedCounts + blockIdx*NUMDIGITS;
|
||||||
|
#else
|
||||||
|
uniform int localCounts[NUMDIGITS];
|
||||||
|
#endif
|
||||||
|
|
||||||
const uniform int keyIndex = blockIdx * blockDim;
|
const uniform int keyIndex = blockIdx * blockDim;
|
||||||
uniform int * uniform keys = keysAll + keyIndex;
|
uniform int * uniform keys = keysAll + keyIndex;
|
||||||
@@ -92,7 +96,7 @@ void sortPass(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef __NVPTX__
|
#if 1 //def __NVPTX__
|
||||||
rel = atomic_add_global(&localCounts[key],1);
|
rel = atomic_add_global(&localCounts[key],1);
|
||||||
#else
|
#else
|
||||||
rel = atomic_add_local(&localCounts[key],1);
|
rel = atomic_add_local(&localCounts[key],1);
|
||||||
|
|||||||
Reference in New Issue
Block a user