1 #ifndef VIENNACL_GENERATOR_STATEMENT_REPRESENTATION_HPP
2 #define VIENNACL_GENERATOR_STATEMENT_REPRESENTATION_HPP
54 unsigned int get_id(
void *
handle)
const{
57 void* current = memory_[i];
67 static void append_id(
char * & ptr,
unsigned int val){
73 *ptr++=
static_cast<char>(
'0') + static_cast<char>(val % 10);
83 template<
class ScalarType>
91 template<
class ScalarType>
95 append_id(ptr_, get_id((
void*)&scal));
99 template<
class ScalarType>
107 append_id(ptr_, get_id((
void*)&vec));
111 template<
class ScalarType>
123 template<
class ScalarType,
class Layout>
136 append_id(ptr_, get_id((
void*)&mat));
140 template<
class ScalarType>
151 utils::call_on_element(root_node->
lhs, *
this);
153 utils::call_on_element(root_node->
rhs, *
this);
157 std::memcpy(ptr_, op_expr, n);
163 void* (&memory_)[64];
bool is_value_static() const
Definition: vector.hpp:64
result_type operator()(implicit_vector_base< ScalarType > const &vec) const
Implicit vector mapping.
Definition: statement_representation_functor.hpp:112
std::size_t vcl_size_t
Definition: forwards.h:58
result_type operator()(ScalarType const &) const
Definition: statement_representation_functor.hpp:84
This class represents a single scalar value on the GPU and behaves mostly like a built-in scalar type...
Definition: forwards.h:172
result_of::size_type< matrix_base< NumericT, F > >::type stride2(matrix_base< NumericT, F > const &s)
Definition: stride.hpp:68
Internal utils for a dynamic OpenCL kernel generation.
Extracts the underlying OpenCL start index handle from a vector, a matrix, an expression etc...
result_type operator()(matrix_base< ScalarType, Layout > const &mat) const
Matrix mapping.
Definition: statement_representation_functor.hpp:124
lhs_rhs_element lhs
Definition: forwards.h:422
result_type operator()(vector_base< ScalarType > const &vec) const
Vector mapping.
Definition: statement_representation_functor.hpp:100
Helper struct for obtaining the first letter of a type. Used internally by the generator only...
Definition: utils.hpp:223
result_type operator()(scalar< ScalarType > const &scal) const
Scalar mapping.
Definition: statement_representation_functor.hpp:92
bool has_index() const
Definition: vector.hpp:68
A dense matrix class.
Definition: forwards.h:290
Definition: forwards.h:114
This file provides the forward declarations for the main types used within ViennaCL.
result_of::size_type< T >::type start1(T const &obj)
Definition: start.hpp:64
Determines row and column increments for matrices and matrix proxies.
bool is_value_static() const
Definition: matrix.hpp:57
lhs_rhs_element rhs
Definition: forwards.h:424
Helper class for the OpenCL kernel generator, representing a statement.
Definition: statement_representation_functor.hpp:52
Implementation of a shared pointer class (cf. std::shared_ptr, boost::shared_ptr). Will be used until C++11 is widely available.
result_of::size_type< matrix_base< NumericT, F > >::type stride1(matrix_base< NumericT, F > const &s)
Definition: stride.hpp:57
several code generation helpers
Base class for representing matrices where the individual entries are not all stored explicitly...
Definition: forwards.h:296
result_of::size_type< T >::type start2(T const &obj)
Definition: start.hpp:83
Map ViennaCL objects to generator wrappers.
base functor class for traversing a statement
Definition: helpers.hpp:145
result_of::size_type< T >::type start(T const &obj)
Definition: start.hpp:43
Definition: forwards.h:113
void operator()(scheduler::statement const *, scheduler::statement_node const *root_node, detail::node_type node_type) const
Definition: statement_representation_functor.hpp:149
Provides the datastructures for dealing with a single statement such as 'x = y + z;'.
Implementations of the OpenCL backend, where all contexts are stored in.
void result_type
Definition: statement_representation_functor.hpp:79
node_type
Definition: forwards.h:112
Definition: forwards.h:115
Representation of an OpenCL kernel in ViennaCL.
result_type operator()(implicit_matrix_base< ScalarType > const &mat) const
Implicit matrix mapping.
Definition: statement_representation_functor.hpp:141
statement_node_type_family type_family
Definition: forwards.h:269
The main class for representing a statement such as x = inner_prod(y,z); at runtime.
Definition: forwards.h:447
Common base class for representing vectors where the entries are not all stored explicitly.
Definition: forwards.h:190
std::string generate(std::pair< std::string, std::string > const &index, int vector_element, mapped_object const &s)
Definition: mapped_objects.hpp:325
viennacl::backend::mem_handle & handle(T &obj)
Returns the generic memory handle of an object. Non-const version.
Definition: handle.hpp:41
op_element op
Definition: forwards.h:423
statement_representation_functor(void *(&memory)[64], unsigned int, char *&ptr)
Definition: statement_representation_functor.hpp:81
Main datastructure for an node in the statement tree.
Definition: forwards.h:420
size_type stride() const
Returns the stride within the buffer (in multiples of sizeof(SCALARTYPE))
Definition: vector.hpp:871
operation_node_type type
Definition: forwards.h:416
Definition: forwards.h:167