Commit a2ce3c87 authored by BRAMAS Berenger's avatar BRAMAS Berenger

Update Quicksort to have somthing clean in openmp and to enable parallel shared memory without task

parent cff73953
This diff is collapsed.
......@@ -70,10 +70,40 @@ class TestQuickSort : public FUTester<TestQuickSort> {
delete [] array;
}
void reversed(){
const long Size = 10000000;//100000000;
long long* const array = new long long[Size];
for(long idx = 0 ; idx < Size ; ++idx){
array[idx] = Size-idx;
}
FQuickSort<long long, long long, long>::QsOmp(array, Size);
uassert(IsSorted(array,Size));
delete [] array;
}
void alreadySorted(){
const long Size = 10000000;//100000000;
long long* const array = new long long[Size];
for(long idx = 0 ; idx < Size ; ++idx){
array[idx] = idx;
}
FQuickSort<long long, long long, long>::QsOmp(array, Size);
uassert(IsSorted(array,Size));
delete [] array;
}
// set test
void SetTests(){
AddTest(&TestQuickSort::manyThreads,"Many threads");
AddTest(&TestQuickSort::bigSize,"Big sort");
AddTest(&TestQuickSort::reversed,"Reversed");
AddTest(&TestQuickSort::alreadySorted,"Already Sorted");
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment