4#if defined(_GLIBCXX_PARALLEL)
5 #include <parallel/algorithm>
7#elif defined (_MSC_VER) || defined (__ICL)
35 #if defined(_MSC_VER) || defined(__ICL)
36 stream <<
"Testing either MSVC or Intel C++ compiler"<<
nL;
38 stream <<
"Testing either GNU g++ or clang++"<<
nL;
49 using container_t = std::vector<element_t>;
59 auto generator = crd::random_generator<element_t>(1, 100);
61 size_t count = 1'000'000;
62 size_t test_count = 5;
66 for(
size_t i = 0; i < test_count; ++ i)
68 stream <<i <<
" - Filling the container with random numbers..."<<
nl;
72 stream <<
"Before sort: front - " << v.front() <<
", back - " << v.back() <<
nl;
77 #if defined(_MSC_VER) || defined(__ICL)
78 std::sort(std::execution::par_unseq, v.begin(), v.end());
83 stream <<
"After sort: front - " << v.front() <<
", back - " << v.back()
84 <<
", Elapsed: " << sw.elapsed_time() <<
nL;
void examples_for_parallel_sort_algorithm()
tpf::chrono_random::stop_watch stop_watch
void random_fill(Type(&container)[N], RandomGeneratorType const &random_generator)
Implements random number generator and stop watch.
ContainerType< EleType > sort(ContainerType< EleType, Types... > container, sort_order order=sort_order::ascending, sort_method method=sort_method::size)
Stream output operators << are implemented.