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

Function main

perf/perf_uniform_int_distribution.cpp:24–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22namespace compute = boost::compute;
23
24int main(int argc, char *argv[])
25{
26 perf_parse_args(argc, argv);
27 std::cout << "size: " << PERF_N << std::endl;
28
29 compute::device device = compute::system::default_device();
30 compute::context context(device);
31 compute::command_queue queue(context, device);
32
33 compute::vector<compute::uint_> vector(PERF_N, context);
34
35 compute::default_random_engine rng(queue);
36 compute::uniform_int_distribution<compute::uint_> dist(0, 1);
37
38 perf_timer t;
39 t.start();
40 dist.generate(vector.begin(), vector.end(), rng, queue);
41 queue.finish();
42 t.stop();
43 std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl;
44
45 return 0;
46}

Callers

nothing calls this directly

Calls 8

perf_parse_argsFunction · 0.85
startMethod · 0.80
stopMethod · 0.80
min_timeMethod · 0.80
generateMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected