ViennaCL - The Vienna Computing Library: viennacl::ocl::backend< dummy > Class Template Reference

ViennaCL - The Vienna Computing Library 1.7.1 Free open-source GPU-accelerated linear algebra and solver library. |

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Static Public Member Functions | List of all members
viennacl::ocl::backend< dummy > Class Template Reference

A backend that provides contexts for ViennaCL objects (vector, matrix, etc.) More...

`#include <backend.hpp>`

## Static Public Member Functions
static void | switch_context (long i)
| Switches the current context to the context identified by i. More...
static viennacl::ocl::context & | context (long id)
| Returns the current active context. More...
static viennacl::ocl::context & | current_context ()
| Returns the current active context. More...
static viennacl::ocl::command_queue & | get_queue ()
| Returns the current queue for the active device in the active context. More...
static void | setup_context (long i, std::vector< cl_device_id > const &devices)
| Sets a number of devices for the context. More...
static void | setup_context (long i, cl_context c, std::vector< cl_device_id > const &devices, std::map< cl_device_id, std::vector< cl_command_queue > > const &queues)
| Initializes ViennaCL with an already existing context. More...
static void | setup_context (long i, cl_context c, std::vector< cl_device_id > const &devices, std::vector< cl_command_queue > const &queue)
| Initializes ViennaCL with an already existing context. More...
static void | add_context (long i, viennacl::ocl::context &c)
| Add an existing context object to the backend. More...
static void | set_context_device_type (long i, cl_device_type t)
| Sets the context device type. More...
static void | set_context_device_num (long i, vcl_size_t num)
| Sets the maximum number of devices per context. Ignored if a device array is provided as well. More...
static void | set_context_platform_index (long i, vcl_size_t pf_index)
| Sets the context device type. More...

## Detailed Description

### template<bool dummy = false>
class viennacl::ocl::backend< dummy >

A backend that provides contexts for ViennaCL objects (vector, matrix, etc.)

Definition at line 36 of file backend.hpp.

## Member Function Documentation

template<bool dummy = false>

static void viennacl::ocl::backend< dummy >::add_context | ( | long | i,
|  | viennacl::ocl::context & | c
| ) |  |
| inlinestatic

Add an existing context object to the backend.

Definition at line 168 of file backend.hpp.

template<bool dummy = false>

static viennacl::ocl::context& viennacl::ocl::backend< dummy >::context | ( | long | id | ) |
| inlinestatic

Returns the current active context.

Definition at line 49 of file backend.hpp.

template<bool dummy = false>

static viennacl::ocl::context& viennacl::ocl::backend< dummy >::current_context | ( |  | ) |
| inlinestatic

Returns the current active context.

Definition at line 73 of file backend.hpp.

template<bool dummy = false>

static viennacl::ocl::command_queue& viennacl::ocl::backend< dummy >::get_queue | ( |  | ) |
| inlinestatic

Returns the current queue for the active device in the active context.

Definition at line 85 of file backend.hpp.

template<bool dummy = false>

static void viennacl::ocl::backend< dummy >::set_context_device_num | ( | long | i,
|  | vcl_size_t | num
| ) |  |
| inlinestatic

Sets the maximum number of devices per context. Ignored if a device array is provided as well.

Definition at line 185 of file backend.hpp.

template<bool dummy = false>

static void viennacl::ocl::backend< dummy >::set_context_device_type | ( | long | i,
|  | cl_device_type | t
| ) |  |
| inlinestatic

Sets the context device type.

Definition at line 179 of file backend.hpp.

template<bool dummy = false>

static void viennacl::ocl::backend< dummy >::set_context_platform_index | ( | long | i,
|  | vcl_size_t | pf_index
| ) |  |
| inlinestatic

Sets the context device type.

Definition at line 191 of file backend.hpp.

template<bool dummy = false>

static void viennacl::ocl::backend< dummy >::setup_context | ( | long | i,
|  | std::vector< cl_device_id > const & | devices
| ) |  |
| inlinestatic

Sets a number of devices for the context.

Parameters

  i | ID of the context to be set up
  devices | A vector of OpenCL device-IDs that should be added to the context

Definition at line 95 of file backend.hpp.

template<bool dummy = false>

static void viennacl::ocl::backend< dummy >::setup_context | ( | long | i,
|  | cl_context | c,
|  | std::vector< cl_device_id > const & | devices,
|  | std::map< cl_device_id, std::vector< cl_command_queue > > const & | queues
| ) |  |
| inlinestatic

Initializes ViennaCL with an already existing context.

Parameters

  i | ID of the context to be set up
  c | The OpenCL handle of the existing context
  devices | A vector of OpenCL device-IDs that should be added to the context
  queues | A map of queues for each device

Definition at line 115 of file backend.hpp.

template<bool dummy = false>

static void viennacl::ocl::backend< dummy >::setup_context | ( | long | i,
|  | cl_context | c,
|  | std::vector< cl_device_id > const & | devices,
|  | std::vector< cl_command_queue > const & | queue
| ) |  |
| inlinestatic

Initializes ViennaCL with an already existing context.

Parameters

  i | ID of the context to be set up
  c | The OpenCL handle of the existing context
  devices | A vector of OpenCL device-IDs that should be added to the context
  queue | One queue per device

Definition at line 155 of file backend.hpp.

template<bool dummy = false>

static void viennacl::ocl::backend< dummy >::switch_context | ( | long | i | ) |
| inlinestatic

Switches the current context to the context identified by i.

Parameters

  i | ID of the new active context

Definition at line 43 of file backend.hpp.

The documentation for this class was generated from the following file:

- viennacl/ocl/backend.hpp