2
0
mirror of https://github.com/boostorg/compute.git synced 2026-01-26 06:22:37 +00:00
Files
compute/test/context_setup.hpp
Kyle Lutz 4ab37ada07 Add system-wide default command queue
This adds a system-wide default command queue. This queue is
accessible via the new static system::default_queue() method.
The default command queue is created for the default compute
device in the default context and is analogous to the default
stream in CUDA.

This changes how algorithms operate when invoked without an
explicit command queue. Previously, each algorithm had two
overloads, the first expected a command queue to be explicitly
passed and the second would create and use a temporary command
queue. Now, all algorithms take a command queue argument which
has a default value equal to system::default_queue().

This fixes a number of race-conditions and performance issues
througout the library associated with create, using, and
destroying many separate command queues.
2013-05-15 20:59:56 -04:00

21 lines
544 B
C++

#ifndef BOOST_COMPUTE_TEST_CONTEXT_SETUP_HPP
#define BOOST_COMPUTE_TEST_CONTEXT_SETUP_HPP
#include <boost/compute/command_queue.hpp>
struct Context {
boost::compute::device device;
boost::compute::context context;
boost::compute::command_queue queue;
Context() :
device ( boost::compute::system::default_device() ),
context( boost::compute::system::default_context() ),
queue ( boost::compute::system::default_queue() )
{}
};
BOOST_FIXTURE_TEST_SUITE(compute_test, Context)
#endif