MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / perf_sort

Function perf_sort

compute/perf/perf_sort.cpp:28–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27template<class T>
28double perf_sort(const std::vector<T>& data,
29 const size_t trials,
30 compute::command_queue& queue)
31{
32 compute::vector<T> vec(data.size(), queue.get_context());
33
34 perf_timer t;
35 for(size_t trial = 0; trial < trials; trial++){
36 compute::copy(data.begin(), data.end(), vec.begin(), queue);
37 t.start();
38 compute::sort(vec.begin(), vec.end(), queue);
39 queue.finish();
40 t.stop();
41
42 if(!compute::is_sorted(vec.begin(), vec.end(), queue)){
43 std::cerr << "ERROR: is_sorted() returned false" << std::endl;
44 }
45 }
46 return t.min_time();
47}
48
49template<class T>
50void tune_sort(const std::vector<T>& data,

Callers 2

tune_sortFunction · 0.85
mainFunction · 0.85

Calls 11

copyFunction · 0.85
sortFunction · 0.85
is_sortedFunction · 0.85
startMethod · 0.80
stopMethod · 0.80
min_timeMethod · 0.80
sizeMethod · 0.45
get_contextMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected