1 //---------------------------------------------------------------------------// 2 // Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com> 3 // 4 // Distributed under the Boost Software License, Version 1.0 5 // See accompanying file LICENSE_1_0.txt or copy at 6 // http://www.boost.org/LICENSE_1_0.txt 7 // 8 // See http://boostorg.github.com/compute for more information. 9 //---------------------------------------------------------------------------// 10 11 #include <iostream> 12 #include <vector> 13 14 #include <tbb/parallel_sort.h> 15 16 #include "perf.hpp" 17 main(int argc,char * argv[])18int main(int argc, char *argv[]) 19 { 20 perf_parse_args(argc, argv); 21 22 std::cout << "size: " << PERF_N << std::endl; 23 std::vector<int> v(PERF_N); 24 25 perf_timer t; 26 for(size_t trial = 0; trial < PERF_TRIALS; trial++){ 27 v = generate_random_vector<int>(PERF_N); 28 t.start(); 29 tbb::parallel_sort(v.begin(), v.end()); 30 t.stop(); 31 } 32 std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl; 33 34 return 0; 35 } 36