6 #include <boost/compute/algorithm/copy.hpp> 7 #include <boost/compute/command_queue.hpp> 8 #include <boost/compute/utility/wait_list.hpp> 16 char const source[] = R
"""( 17 __kernel void empty() { 23 fixture(boost::compute::context& context, boost::compute::command_queue& q)
24 : fixture(1, context, q) {
27 int size, boost::compute::context& context,
28 boost::compute::command_queue& q)
31 context, context.get_device(), source,
"empty"))
36 boost::compute::wait_list wait;
37 for (
int i = 0; i != chain_length; ++i) {
38 auto event = queue.enqueue_task(kernel, wait);
39 wait = boost::compute::wait_list(event);
47 boost::compute::kernel kernel;
48 boost::compute::command_queue queue;
52 int main(
int argc,
char* argv[])
try {
54 cfg.process_cmdline(argc, argv);
55 std::cerr <<
"Configuration for test\n" << cfg << std::endl;
58 boost::compute::context context(device);
59 boost::compute::command_queue queue(context, device);
61 benchmark bm(cfg.microbenchmark());
63 auto r = bm.
run(context, queue);
68 std::cerr <<
"usage: " << ex.what() << std::endl;
70 }
catch (std::exception
const& ex) {
71 std::cerr <<
"standard exception raised: " << ex.what() << std::endl;
74 std::cerr <<
"unknown exception raised" << std::endl;
boost::compute::device device_selector(config const &cfg)
Select an OpenCL device matching the current configuration.
The configuration shared by all OpenCL microbenchmarks.
results run(Args &&... args)
Run the microbenchmaark.
boost::compute::kernel build_simple_kernel(boost::compute::context context, boost::compute::device device, char const *code, char const *kernel_name)
Build a simple program (one where everything is in a single string) and get a kernel from it...
A simple class to communicate the result of parsing the options.
int main(int argc, char *argv[])
Run a micro-benchmark on a given class.
The top-level namespace for the JayBeams library.