MCPcopy Create free account
hub / github.com/boostorg/compute / main

Function main

perf/perf_stl_is_permutation.cpp:23–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23int main(int argc, char *argv[])
24{
25 perf_parse_args(argc, argv);
26 std::cout << "size: " << PERF_N << std::endl;
27
28 // create vector of random numbers on the host
29 std::vector<int> host_vector(PERF_N);
30 std::generate(host_vector.begin(), host_vector.end(), rand_int);
31
32 std::vector<int> host_vector2(PERF_N);
33 std::copy(host_vector.rbegin(), host_vector.rend(), host_vector2.begin());
34
35 perf_timer t;
36 for(size_t trial = 0; trial < PERF_TRIALS; trial++){
37 t.start();
38 std::is_permutation(host_vector.begin(), host_vector.end(),
39 host_vector2.begin());
40 t.stop();
41 }
42 std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl;
43
44 return 0;
45}

Callers

nothing calls this directly

Calls 11

perf_parse_argsFunction · 0.85
copyFunction · 0.85
is_permutationFunction · 0.85
startMethod · 0.80
stopMethod · 0.80
min_timeMethod · 0.80
generateFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
rbeginMethod · 0.45
rendMethod · 0.45

Tested by

no test coverage detected