Public Member Functions |
| | context () |
| std::size_t | default_device_num () const |
| | Returns the maximum number of devices to be set up for the context.
|
| void | default_device_num (std::size_t new_num) |
| | Sets the maximum number of devices to be set up for the context.
|
| cl_device_type | default_device_type () |
| | Returns the default device type for the context.
|
| void | default_device_type (cl_device_type dtype) |
| | Sets the device type for this context.
|
std::vector
< viennacl::ocl::device >
const & | devices () const |
| | Returns a vector with all devices in this context.
|
| viennacl::ocl::device const & | current_device () const |
| | Returns the current device.
|
| void | switch_device (size_t i) |
| | Switches the current device to the i-th device in this context.
|
| void | switch_device (viennacl::ocl::device const &d) |
| | If the supplied device is used within the context, it becomes the current active device.
|
| void | add_device (viennacl::ocl::device const &d) |
| | Add a device to the context. Must be done before the context is initialized.
|
| void | add_device (cl_device_id d) |
| | Add a device to the context. Must be done before the context is initialized.
|
| void | init () |
| | Initializes a new context.
|
| void | init (cl_context c) |
| | Initializes the context from an existing, user-supplied context.
|
| viennacl::ocl::handle< cl_mem > | create_memory (cl_mem_flags flags, unsigned int size, void *ptr=NULL) |
| | Creates a memory buffer within the context.
|
| template<typename SCALARTYPE , typename A , template< typename, typename > class VectorType> |
| viennacl::ocl::handle< cl_mem > | create_memory (cl_mem_flags flags, const VectorType< SCALARTYPE, A > &_buffer) |
| | Creates a memory buffer within the context initialized from the supplied data.
|
| void | add_queue (cl_device_id dev, cl_command_queue q) |
| | Adds an existing queue for the given device to the context.
|
| void | add_queue (cl_device_id dev) |
| | Adds a queue for the given device to the context.
|
| void | add_queue (viennacl::ocl::device d) |
| | Adds a queue for the given device to the context.
|
| viennacl::ocl::command_queue & | get_queue () |
| viennacl::ocl::command_queue & | get_queue (cl_device_id dev, size_t i=0) |
| | Returns the queue with the provided index for the given device.
|
| viennacl::ocl::program & | add_program (cl_program p, std::string const &prog_name) |
| | Adds a program to the context.
|
| viennacl::ocl::program & | add_program (std::string const &source, std::string const &prog_name) |
| | Adds a new program with the provided source to the context.
|
| viennacl::ocl::program & | get_program (std::string const &name) |
| | Returns the program with the provided name.
|
| viennacl::ocl::program & | get_program (size_t id) |
| | Returns the program with the provided id.
|
| size_t | program_num () |
| | Returns the number of programs within this context.
|
| size_t | device_num () |
| | Returns the number of devices within this context.
|
const viennacl::ocl::handle
< cl_context > & | handle () const |
| | Returns the context handle.
|
| bool | operator< (context const &other) const |
| | Less-than comparable for compatibility with std:map.
|