1 #ifndef VIENNACL_TRAITS_HANDLE_HPP_
2 #define VIENNACL_TRAITS_HANDLE_HPP_
54 inline char handle(
char val) {
return val; }
55 inline short handle(
short val) {
return val; }
56 inline int handle(
int val) {
return val; }
57 inline long handle(
long val) {
return val; }
58 inline float handle(
float val) {
return val; }
59 inline double handle(
double val) {
return val; }
61 template <
typename LHS,
typename RHS,
typename OP>
67 template <
typename LHS,
typename RHS,
typename OP>
70 template <
typename LHS,
typename RHS,
typename OP>
73 template <
typename LHS,
typename RHS,
typename OP>
100 template <
typename T>
103 return obj.get().
handle();
107 template <
typename T>
110 return obj.get().
handle();
113 template <
typename T>
116 return obj.get().
handle();
119 template <
typename LHS,
typename RHS,
typename OP>
125 template <
typename LHS,
typename RHS,
typename OP>
137 template <
typename T>
144 template <
typename T>
165 #ifdef VIENNACL_WITH_OPENCL
167 template <
typename T>
174 template <
typename T>
180 inline cl_char opencl_handle(
char val) {
return val; }
181 inline cl_short opencl_handle(
short val) {
return val; }
182 inline cl_int opencl_handle(
int val) {
return val; }
183 inline cl_long opencl_handle(
long val) {
return val; }
184 inline cl_uchar opencl_handle(
unsigned char val) {
return val; }
185 inline cl_ushort opencl_handle(
unsigned short val) {
return val; }
186 inline cl_uint opencl_handle(
unsigned int val) {
return val; }
187 inline cl_ulong opencl_handle(
unsigned long val) {
return val; }
188 inline float opencl_handle(
float val) {
return val; }
189 inline double opencl_handle(
double val) {
return val; }
200 template <
typename T>
207 template <
typename T>
210 template <
typename T>
213 template <
typename T>
216 template <
typename T>
219 template <
typename LHS,
typename RHS,
typename OP>
222 template <
typename LHS,
typename RHS,
typename OP>
228 template <
typename LHS,
typename RHS,
typename OP>
234 template <
typename LHS,
typename RHS,
typename OP>
ram_handle_type & ram_handle()
Returns the handle to a buffer in CPU RAM. NULL is returned if no such buffer has been allocated...
Definition: mem_handle.hpp:72
Class for representing strided submatrices of a bigger matrix A.
Definition: forwards.h:358
LHS & lhs() const
Returns the left hand side operand.
Definition: scalar.hpp:56
Expression template class for representing a tree of expressions which ultimately result in a matrix...
Definition: forwards.h:283
This file provides the forward declarations for the main types used within ViennaCL.
A proxy for scalar expressions (e.g. from inner vector products)
Definition: forwards.h:175
An expression template class that represents a binary operation that yields a vector.
Definition: forwards.h:181
memory_types
Definition: forwards.h:476
memory_types get_active_handle_id() const
Returns an ID for the currently active memory buffer. Other memory buffers might contain old or no da...
Definition: mem_handle.hpp:91
Definition: forwards.h:480
lhs_reference_type lhs() const
Get left hand side operand.
Definition: vector.hpp:181
Implements the multi-memory-domain handle.
Common base class for dense vectors, vector ranges, and vector slices.
Definition: forwards.h:205
viennacl::memory_types active_handle_id(T const &obj)
Returns an ID for the currently active memory domain of an object.
Definition: handle.hpp:201
handle_type & handle()
Returns the OpenCL handle, non-const-version.
Definition: matrix.hpp:654
Main abstraction class for multiple memory domains. Represents a buffer in either main RAM...
Definition: mem_handle.hpp:62
A Circulant matrix class.
Definition: circulant_matrix.hpp:41
Class for representing non-strided submatrices of a bigger matrix A.
Definition: forwards.h:355
viennacl::backend::mem_handle & handle(T &obj)
Returns the generic memory handle of an object. Non-const version.
Definition: handle.hpp:41
LHS & lhs() const
Get left hand side operand.
Definition: matrix.hpp:174
const handle_type & handle() const
Returns the memory handle.
Definition: vector.hpp:878
viennacl::backend::mem_handle::ram_handle_type & ram_handle(T &obj)
Generic helper routine for extracting the RAM handle of a ViennaCL object. Non-const version...
Definition: handle.hpp:138