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

Function main

perf/perf_stl_partial_sum.cpp:25–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25int main(int argc, char *argv[])
26{
27 using boost::compute::int_;
28
29 perf_parse_args(argc, argv);
30
31 std::cout << "size: " << PERF_N << std::endl;
32
33 // create vector of random numbers on the host
34 std::vector<int_> v(PERF_N);
35 std::vector<int_> r(PERF_N);
36
37 perf_timer t;
38 for(size_t trial = 0; trial < PERF_TRIALS; trial++){
39 std::generate(v.begin(), v.end(), rand_int);
40 t.start();
41 std::partial_sum(
42 v.begin(),
43 v.end(),
44 r.begin()
45 );
46 t.stop();
47 }
48 std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl;
49
50 return 0;
51}

Callers

nothing calls this directly

Calls 8

perf_parse_argsFunction · 0.85
partial_sumFunction · 0.85
startMethod · 0.80
stopMethod · 0.80
min_timeMethod · 0.80
generateFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected