1 #ifndef VIENNACL_GENERATOR_ENQUEUE_TREE_HPP
2 #define VIENNACL_GENERATOR_ENQUEUE_TREE_HPP
59 template<
class ScalarType>
62 kernel_.
arg(current_arg_++, cl_scalartype(scal));
66 template<
class ScalarType>
68 if(memory_.insert((
void*)&scal).second)
69 kernel_.
arg(current_arg_++, scal.
handle().opencl_handle());
73 template<
class ScalarType>
75 if(memory_.insert((
void*)&vec).second){
76 kernel_.
arg(current_arg_++, vec.
handle().opencl_handle());
85 template<
class ScalarType>
88 if(memory_.insert((
void*)&vec).second){
90 kernel_.
arg(current_arg_++, cl_scalartype(vec.
value()));
92 kernel_.
arg(current_arg_++, cl_uint(vec.
index()));
97 template<
class ScalarType,
class Layout>
100 if(memory_.insert((
void*)&mat).second){
101 kernel_.
arg(current_arg_++, mat.
handle().opencl_handle());
114 template<
class ScalarType>
117 kernel_.
arg(current_arg_++, mat.
value());
123 utils::call_on_element(root_node->
lhs, *
this);
125 utils::call_on_element(root_node->
rhs, *
this);
129 std::set<void *> & memory_;
130 unsigned int & current_arg_;
bool is_value_static() const
Definition: vector.hpp:64
void arg(unsigned int pos, cl_char val)
Sets a char argument at the provided position.
Definition: kernel.hpp:124
This class represents a single scalar value on the GPU and behaves mostly like a built-in scalar type...
Definition: forwards.h:172
void result_type
Definition: set_arguments_functor.hpp:55
result_of::size_type< matrix_base< NumericT, F > >::type stride2(matrix_base< NumericT, F > const &s)
Definition: stride.hpp:68
set_arguments_functor(std::set< void * > &memory, unsigned int ¤t_arg, viennacl::ocl::kernel &kernel)
Definition: set_arguments_functor.hpp:57
void operator()(scheduler::statement const *, scheduler::statement_node const *root_node, detail::node_type node_type) const
Traversal functor:
Definition: set_arguments_functor.hpp:121
Internal utils for a dynamic OpenCL kernel generation.
Represents an OpenCL kernel within ViennaCL.
Definition: kernel.hpp:59
Implementation of the dense matrix class.
lhs_rhs_element lhs
Definition: forwards.h:422
vcl_size_t index() const
Definition: vector.hpp:66
bool has_index() const
Definition: vector.hpp:68
A dense matrix class.
Definition: forwards.h:290
result_of::size_type< viennacl::vector_base< T > >::type stride(viennacl::vector_base< T > const &s)
Definition: stride.hpp:46
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
bool is_value_static() const
Definition: matrix.hpp:57
lhs_rhs_element rhs
Definition: forwards.h:424
result_type operator()(ScalarType const &scal) const
Definition: set_arguments_functor.hpp:60
result_type operator()(scalar< ScalarType > const &scal) const
Scalar mapping.
Definition: set_arguments_functor.hpp:67
result_type operator()(vector_base< ScalarType > const &vec) const
Vector mapping.
Definition: set_arguments_functor.hpp:74
Helper class for setting the arguments of a kernel.
Definition: set_arguments_functor.hpp:53
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
SCALARTYPE value() const
Definition: matrix.hpp:56
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
handle_type & handle()
Returns the memory handle, non-const version.
Definition: scalar.hpp:704
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
result_type operator()(implicit_matrix_base< ScalarType > const &mat) const
Implicit matrix mapping.
Definition: set_arguments_functor.hpp:115
Provides the datastructures for dealing with a single statement such as 'x = y + z;'.
result_type operator()(matrix_base< ScalarType, Layout > const &mat) const
Matrix mapping.
Definition: set_arguments_functor.hpp:98
T type
Definition: result_of.hpp:590
node_type
Definition: forwards.h:112
Definition: forwards.h:115
Representation of an OpenCL kernel in ViennaCL.
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
handle_type & handle()
Returns the OpenCL handle, non-const-version.
Definition: matrix.hpp:654
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
const handle_type & handle() const
Returns the memory handle.
Definition: vector.hpp:878
result_type operator()(implicit_vector_base< ScalarType > const &vec) const
Implicit vector mapping.
Definition: set_arguments_functor.hpp:86
A collection of compile time type deductions.
cpu_value_type value() const
Definition: vector.hpp:62
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
Definition: forwards.h:167