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

Function main

perf/perf_fill.cpp:17–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15#include "perf.hpp"
16
17int main(int argc, char *argv[])
18{
19 perf_parse_args(argc, argv);
20 std::cout << "size: " << PERF_N << std::endl;
21
22 // setup context and queue for the default device
23 boost::compute::device device = boost::compute::system::default_device();
24 boost::compute::context context(device);
25 boost::compute::command_queue queue(context, device);
26 std::cout << "device: " << device.name() << std::endl;
27
28 // create vector on the device (filled with zeros)
29 boost::compute::vector<int> vec(PERF_N, 0, queue);
30
31 perf_timer t;
32 for(size_t trial = 0; trial < PERF_TRIALS; trial++){
33 t.start();
34 boost::compute::fill(vec.begin(), vec.end(), int(trial), queue);
35 queue.finish();
36 t.stop();
37 }
38 std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl;
39
40 return 0;
41}

Callers

nothing calls this directly

Calls 9

perf_parse_argsFunction · 0.85
fillFunction · 0.85
startMethod · 0.80
stopMethod · 0.80
min_timeMethod · 0.80
nameMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected