| 273 | : radixCount(nullptr), src(src), tmp(tmp), N(N) {} |
| 274 | |
| 275 | void sort(const size_t blockSize) |
| 276 | { |
| 277 | assert(blockSize > 0); |
| 278 | |
| 279 | /* perform single threaded sort for small N */ |
| 280 | if (N<=blockSize) // handles also special case of 0! |
| 281 | { |
| 282 | /* do inplace sort inside destination array */ |
| 283 | std::sort(src,src+N,compare<Ty>); |
| 284 | } |
| 285 | |
| 286 | /* perform parallel sort for large N */ |
| 287 | else |
| 288 | { |
| 289 | const size_t numThreads = min((N+blockSize-1)/blockSize,TaskScheduler::threadCount(),size_t(MAX_TASKS)); |
| 290 | tbbRadixSort(numThreads); |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | ~ParallelRadixSort() |
| 295 | { |
no test coverage detected