This commit is contained in:
Evghenii
2014-01-31 20:10:47 +01:00
parent 7ef2f7352c
commit 11bc35eb6c

View File

@@ -266,17 +266,21 @@ void generateSampleRanksKernel(
if (i < segmentSamplesA)
{
ranksA[i] = i * SAMPLE_STRIDE;
#if 0
ranksB[i] = binarySearchExclusive(
srcKey[i * SAMPLE_STRIDE], srcKey + stride,
segmentElementsB, nextPowerOfTwo(segmentElementsB));
#endif
}
if (i < segmentSamplesB)
{
ranksB[(stride / SAMPLE_STRIDE) + i] = i * SAMPLE_STRIDE;
#if 0
ranksA[(stride / SAMPLE_STRIDE) + i] = binarySearchInclusive(
srcKey[stride + i * SAMPLE_STRIDE], srcKey + 0,
segmentElementsA, nextPowerOfTwo(segmentElementsA));
#endif
}
}
}
@@ -575,7 +579,7 @@ void mergeSort(
// cpu: 28 gpu: 74 M/s
{
// cpu: 356 gpu: 534 M/s
mergeSortGang(iKey, iVal, srcKey, srcVal, N/(2*programCount));
// mergeSortGang(iKey, iVal, srcKey, srcVal, N/(2*programCount));
#if 1
for (uniform int stride = 2*programCount; stride < N; stride <<= 1)
@@ -593,13 +597,13 @@ void mergeSort(
// cpu: 120 gpu: 457 M/s
//Merge ranks and indices
mergeRanksAndIndices(limitsA, limitsB, ranksA, ranksB, stride, N);
// mergeRanksAndIndices(limitsA, limitsB, ranksA, ranksB, stride, N);
}
#endif
// cpu: 287 gpu: 194 M/s
//Merge elementary intervals
mergeElementaryIntervals(oKey, oVal, iKey, iVal, limitsA, limitsB, stride, N);
// mergeElementaryIntervals(oKey, oVal, iKey, iVal, limitsA, limitsB, stride, N);
}
if (lastSegmentElements <= stride)