From e6d7a493cc85aab0bcf06eae97ba0e6798ffc189 Mon Sep 17 00:00:00 2001 From: Evghenii Date: Wed, 29 Jan 2014 19:39:39 +0100 Subject: [PATCH] merge sort cmopiles & runs --- examples_ptx/mergeSort/mergeSort.ispc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples_ptx/mergeSort/mergeSort.ispc b/examples_ptx/mergeSort/mergeSort.ispc index c7322846..19633839 100644 --- a/examples_ptx/mergeSort/mergeSort.ispc +++ b/examples_ptx/mergeSort/mergeSort.ispc @@ -8,7 +8,7 @@ static inline int nextPowerOfTwo(int x) { -#if 1 +#if 0 --x; x |= x >> 1; x |= x >> 2; @@ -414,7 +414,7 @@ static uniform int MAX_SAMPLE_COUNT = 0; export void openMergeSort() { - MAX_SAMPLE_COUNT = 32 * 131072 / programCount; + MAX_SAMPLE_COUNT = 8*32 * 131072 / programCount; assert(memPool == NULL); const uniform int nalloc = MAX_SAMPLE_COUNT * 4; memPool = uniform new uniform int[nalloc]; @@ -498,6 +498,7 @@ void mergeSort( copyKernel(oVal + (N - lastSegmentElements), iVal + (N - lastSegmentElements), lastSegmentElements); } +#if 1 { uniform int * uniform tmpKey = iKey; iKey = oKey; @@ -509,5 +510,6 @@ void mergeSort( iVal = oVal; oVal = tmpVal; } +#endif } }