This commit is contained in:
Evghenii
2014-01-28 17:19:34 +01:00
parent 480dfc3879
commit 1e5476e573
2 changed files with 6 additions and 2 deletions

View File

@@ -41,7 +41,7 @@ int main (int argc, char *argv[])
#pragma omp parallel for
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);

View File

@@ -60,7 +60,11 @@ void sortPass(
const uniform int blockDim = (numElements + numBlocks - 1) / numBlocks;
#if 0
uniform int * uniform localCounts = sharedCounts + blockIdx*NUMDIGITS;
#else
uniform int localCounts[NUMDIGITS];
#endif
const uniform int keyIndex = blockIdx * blockDim;
uniform int * uniform keys = keysAll + keyIndex;
@@ -92,7 +96,7 @@ void sortPass(
}
else
{
#ifdef __NVPTX__
#if 1 //def __NVPTX__
rel = atomic_add_global(&localCounts[key],1);
#else
rel = atomic_add_local(&localCounts[key],1);