partiall workin cuda version

This commit is contained in:
Evghenii
2014-01-29 13:20:41 +01:00
parent 2f5eb9f6d3
commit 97253354ac
2 changed files with 31 additions and 40 deletions

View File

@@ -63,14 +63,11 @@ void sortPass(
const uniform int mask = (1 << NUMBITS) - 1;
const int unitScan = exclusive_scan_add(1);
/* copy digit offset from Gmem to Lmem */
/* copy digit offset from Gmem to Lmem */
uniform int digitOffsets[NUMDIGITS];
foreach (digit = 0 ... NUMDIGITS)
digitOffsets[digit] = digitOffsetsAll[blockIdx*NUMDIGITS + digit];
foreach (i = 0 ... nloc)
{
const int key = mask & ((unsigned int)keys[i] >> bit);
@@ -78,7 +75,7 @@ void sortPass(
/* not a vector friendly loop */
foreach_active(iv)
scatter = digitOffsets[key]++;
sorted [scatter] = keys[i];
sorted[scatter] = keys[i];
}
}
@@ -237,7 +234,7 @@ export void radixSort_free()
delete memoryPool;
memoryPool = NULL;
radixSort_freeBufKeys;
radixSort_freeBufKeys();
}
export void radixSort(