All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mapped_objects.hpp
Go to the documentation of this file.
#ifndef VIENNACL_DEVICE_SPECIFIC_MAPPED_TYPE_HPP
#define VIENNACL_DEVICE_SPECIFIC_MAPPED_TYPE_HPP
/* =========================================================================
Copyright (c) 2010-2016, Institute for Microelectronics,
Institute for Analysis and Scientific Computing,
TU Wien.
Portions of this software are copyright by UChicago Argonne, LLC.
-----------------
ViennaCL - The Vienna Computing Library
-----------------
Project Head: Karl Rupp rupp@iue.tuwien.ac.at
(A list of authors and contributors can be found in the manual)
License: MIT (X11), see file LICENSE in the base directory
============================================================================= */
#include <string>
#include "viennacl/scheduler/forwards.h"
#include "viennacl/device_specific/forwards.h"
#include "viennacl/device_specific/utils.hpp"
namespace viennacl
{
namespace device_specific
{
class mapped_object
{
private:
virtual void postprocess(std::string &) const { }
protected:
struct MorphBase { virtual ~MorphBase(){} };
struct MorphBase1D : public MorphBase { public: virtual std::string operator()(std::string const & i) const = 0; };
struct MorphBase2D : public MorphBase { public: virtual std::string operator()(std::string const & i, std::string const & j) const = 0; };
static void replace_offset(std::string & str, MorphBase const & morph)
{
vcl_size_t pos = 0;
while ((pos=str.find("$OFFSET", pos))!=std::string::npos)
{
std::string postprocessed;
vcl_size_t pos_po = str.find('{', pos);
vcl_size_t pos_pe = str.find('}', pos_po);
if (MorphBase2D const * p2d = dynamic_cast<MorphBase2D const *>(&morph))
{
vcl_size_t pos_comma = str.find(',', pos_po);
std::string i = str.substr(pos_po + 1, pos_comma - pos_po - 1);
std::string j = str.substr(pos_comma + 1, pos_pe - pos_comma - 1);
postprocessed = (*p2d)(i, j);
}
else if (MorphBase1D const * p1d = dynamic_cast<MorphBase1D const *>(&morph))
{
std::string i = str.substr(pos_po + 1, pos_pe - pos_po - 1);
postprocessed = (*p1d)(i);
}
str.replace(pos, pos_pe + 1 - pos, postprocessed);
pos = pos_pe;
}
}
void register_attribute(std::string & attribute, std::string const & key, std::string const & value)
{
attribute = value;
keywords_[key] = attribute;
}
public:
struct node_info
{
node_info(mapping_type const * _mapping, scheduler::statement const * _statement, vcl_size_t _root_idx) :
mapping(_mapping), statement(_statement), root_idx(_root_idx) { }
mapping_type const * mapping;
scheduler::statement const * statement;
vcl_size_t root_idx;
};
public:
mapped_object(std::string const & scalartype, unsigned int id, std::string const & type_key) : type_key_(type_key)
{
register_attribute(scalartype_, "#scalartype", scalartype);
register_attribute(name_, "#name", "obj" + tools::to_string(id));
}
virtual ~mapped_object(){ }
virtual std::string & append_kernel_arguments(std::set<std::string> &, std::string & str, unsigned int) const { return str; }
std::string type_key() const { return type_key_; }
std::string const & name() const { return name_; }
std::string process(std::string const & in) const
{
std::string res(in);
for (std::map<std::string,std::string>::const_iterator it = keywords_.begin(); it != keywords_.end(); ++it)
tools::find_and_replace(res, it->first, it->second);
postprocess(res);
return res;
}
std::string evaluate(std::map<std::string, std::string> const & accessors) const
{
if (accessors.find(type_key_)==accessors.end())
return name_;
return process(at(accessors, type_key_));
}
protected:
std::string name_;
std::string scalartype_;
std::string type_key_;
std::map<std::string, std::string> keywords_;
};
class binary_leaf
{
public:
binary_leaf(mapped_object::node_info info) : info_(info){ }
void process_recursive(utils::kernel_generation_stream & stream, leaf_t leaf, std::string const & key, std::string const & process_str, std::set<std::string> & already_fetched)
{
tree_parsing::process(stream, leaf, key, process_str, *info_.statement, info_.root_idx, *info_.mapping, already_fetched);
}
std::string evaluate_recursive(leaf_t leaf, std::map<std::string, std::string> const & accessors)
{
return tree_parsing::evaluate(leaf, accessors, *info_.statement, info_.root_idx, *info_.mapping);
}
protected:
mapped_object::node_info info_;
};
class mapped_matrix_product : public mapped_object, public binary_leaf
{
public:
mapped_matrix_product(std::string const & scalartype, unsigned int id, node_info info) : mapped_object(scalartype, id, "matrix_product"), binary_leaf(info) { }
};
class mapped_reduction : public mapped_object, public binary_leaf
{
public:
mapped_reduction(std::string const & scalartype, unsigned int id, node_info info, std::string const & type_key) : mapped_object(scalartype, id, type_key), binary_leaf(info){ }
vcl_size_t root_idx() const { return info_.root_idx; }
scheduler::statement const & statement() const { return *info_.statement; }
scheduler::statement_node root_node() const { return statement().array()[root_idx()]; }
bool is_index_reduction() const { return utils::is_index_reduction(info_.statement->array()[info_.root_idx].op); }
scheduler::op_element root_op() const
{
scheduler::op_element res = info_.statement->array()[info_.root_idx].op;
if (res.type==scheduler::OPERATION_BINARY_MAT_VEC_PROD_TYPE
||res.type==scheduler::OPERATION_BINARY_INNER_PROD_TYPE)
res.type = scheduler::OPERATION_BINARY_ADD_TYPE;
return res;
}
};
class mapped_scalar_reduction : public mapped_reduction
{
public:
mapped_scalar_reduction(std::string const & scalartype, unsigned int id, node_info info) : mapped_reduction(scalartype, id, info, "scalar_reduction"){ }
};
class mapped_row_wise_reduction : public mapped_reduction
{
public:
mapped_row_wise_reduction(std::string const & scalartype, unsigned int id, node_info info) : mapped_reduction(scalartype, id, info, "row_wise_reduction") { }
};
class mapped_host_scalar : public mapped_object
{
public:
mapped_host_scalar(std::string const & scalartype, unsigned int id) : mapped_object(scalartype, id, "host_scalar"){ }
std::string & append_kernel_arguments(std::set<std::string> & already_generated, std::string & str, unsigned int width) const
{
if (already_generated.insert(name_).second)
str += generate_value_kernel_argument(utils::append_width(scalartype_, width), name_);
return str;
}
};
class mapped_handle : public mapped_object
{
private:
virtual void append_optional_arguments(std::string &) const = 0;
public:
mapped_handle(std::string const & scalartype, unsigned int id, std::string const & type_key) : mapped_object(scalartype, id, type_key)
{
register_attribute(pointer_, "#pointer", name_ + "_pointer");
}
std::string & append_kernel_arguments(std::set<std::string> & already_generated, std::string & str, unsigned int width) const
{
if (already_generated.insert(name_).second)
{
str += generate_pointer_kernel_argument("__global", utils::append_width(scalartype_, width), pointer_);
append_optional_arguments(str);
}
return str;
}
private:
std::string pointer_;
};
class mapped_scalar : public mapped_handle
{
private:
void append_optional_arguments(std::string &) const{ }
public:
mapped_scalar(std::string const & scalartype, unsigned int id) : mapped_handle(scalartype, id, "scalar") { }
};
class mapped_buffer : public mapped_handle
{
public:
mapped_buffer(std::string const & scalartype, unsigned int id, std::string const & type_key) : mapped_handle(scalartype, id, type_key){ }
};
class mapped_vector : public mapped_buffer
{
void append_optional_arguments(std::string & str) const
{
str += generate_value_kernel_argument("unsigned int", start_);
str += generate_value_kernel_argument("unsigned int", stride_);
}
public:
mapped_vector(std::string const & scalartype, unsigned int id) : mapped_buffer(scalartype, id, "vector")
{
register_attribute(start_, "#start", name_ + "_start");
register_attribute(stride_, "#stride", name_ + "_stride");
}
private:
std::string start_;
std::string stride_;
};
class mapped_matrix : public mapped_buffer
{
private:
void append_optional_arguments(std::string & str) const
{
str += generate_value_kernel_argument("unsigned int", ld_);
str += generate_value_kernel_argument("unsigned int", start1_);
str += generate_value_kernel_argument("unsigned int", start2_);
str += generate_value_kernel_argument("unsigned int", stride1_);
str += generate_value_kernel_argument("unsigned int", stride2_);
}
void postprocess(std::string & str) const
{
struct Morph : public MorphBase2D
{
Morph(bool _is_row_major, std::string const & _ld) : is_row_major(_is_row_major), ld(_ld){ }
std::string operator()(std::string const & i, std::string const & j) const
{
if (is_row_major)
return "(" + i + ") * " + ld + " + (" + j + ")";
return "(" + i + ") + (" + j + ") * " + ld;
}
private:
bool is_row_major;
std::string const & ld;
};
replace_offset(str, Morph(row_major_, ld_));
}
public:
mapped_matrix(std::string const & scalartype, unsigned int id, bool row_major) : mapped_buffer(scalartype, id, "matrix"), row_major_(row_major)
{
register_attribute(ld_, "#ld", name_ + "_ld");
register_attribute(start1_, "#start1", name_ + "_start1");
register_attribute(start2_, "#start2", name_ + "_start2");
register_attribute(stride1_, "#stride1", name_ + "_stride1");
register_attribute(stride2_, "#stride2", name_ + "_stride2");
if (row_major_)
keywords_["#nldstride"] = "#stride1";
else
keywords_["#nldstride"] = "#stride2";
if (row_major_)
{
std::swap(start1_, start2_);
std::swap(stride1_, stride2_);
}
}
bool row_major() const
{
return row_major_;
}
private:
std::string ld_;
std::string start1_;
std::string start2_;
std::string stride1_;
std::string stride2_;
bool row_major_;
};
class mapped_vector_diag : public mapped_object, public binary_leaf
{
private:
void postprocess(std::string &res) const
{
std::map<std::string, std::string> accessors;
tools::find_and_replace(res, "#diag_offset", tree_parsing::evaluate(RHS_NODE_TYPE, accessors, *info_.statement, info_.root_idx, *info_.mapping));
accessors["vector"] = res;
res = tree_parsing::evaluate(LHS_NODE_TYPE, accessors, *info_.statement, info_.root_idx, *info_.mapping);
}
public:
mapped_vector_diag(std::string const & scalartype, unsigned int id, node_info info) : mapped_object(scalartype, id, "vector_diag"), binary_leaf(info){ }
};
class mapped_trans: public mapped_object, public binary_leaf
{
private:
void postprocess(std::string &res) const
{
std::map<std::string, std::string> accessors;
accessors["matrix"] = res;
res = tree_parsing::evaluate(LHS_NODE_TYPE, accessors, *info_.statement, info_.root_idx, *info_.mapping);
}
public:
mapped_trans(std::string const & scalartype, unsigned int id, node_info info) : mapped_object(scalartype, id, "matrix_trans"), binary_leaf(info){ }
};
class mapped_matrix_row : public mapped_object, binary_leaf
{
private:
void postprocess(std::string &res) const
{
std::map<std::string, std::string> accessors;
tools::find_and_replace(res, "#row", tree_parsing::evaluate(RHS_NODE_TYPE, accessors, *info_.statement, info_.root_idx, *info_.mapping));
accessors["matrix"] = res;
res = tree_parsing::evaluate(LHS_NODE_TYPE, accessors, *info_.statement, info_.root_idx, *info_.mapping);
}
public:
mapped_matrix_row(std::string const & scalartype, unsigned int id, node_info info) : mapped_object(scalartype, id, "matrix_row"), binary_leaf(info)
{ }
};
class mapped_matrix_column : public mapped_object, binary_leaf
{
private:
void postprocess(std::string &res) const
{
std::map<std::string, std::string> accessors;
tools::find_and_replace(res, "#column", tree_parsing::evaluate(RHS_NODE_TYPE, accessors, *info_.statement, info_.root_idx, *info_.mapping));
accessors["matrix"] = res;
res = tree_parsing::evaluate(LHS_NODE_TYPE, accessors, *info_.statement, info_.root_idx, *info_.mapping);
}
public:
mapped_matrix_column(std::string const & scalartype, unsigned int id, node_info info) : mapped_object(scalartype, id, "matrix_column"), binary_leaf(info)
{ }
};
class mapped_matrix_diag : public mapped_object, binary_leaf
{
private:
void postprocess(std::string &res) const
{
std::map<std::string, std::string> accessors;
tools::find_and_replace(res, "#diag_offset", tree_parsing::evaluate(RHS_NODE_TYPE, accessors, *info_.statement, info_.root_idx, *info_.mapping));
accessors["matrix"] = res;
res = tree_parsing::evaluate(LHS_NODE_TYPE, accessors, *info_.statement, info_.root_idx, *info_.mapping);
}
public:
mapped_matrix_diag(std::string const & scalartype, unsigned int id, node_info info) : mapped_object(scalartype, id, "matrix_diag"), binary_leaf(info)
{ }
};
class mapped_implicit_vector : public mapped_object
{
public:
mapped_implicit_vector(std::string const & scalartype, unsigned int id) : mapped_object(scalartype, id, "implicit_vector")
{ }
std::string & append_kernel_arguments(std::set<std::string> & /*already_generated*/, std::string & str, unsigned int width) const
{
str += generate_value_kernel_argument(utils::append_width(scalartype_, width), name_);
return str;
}
};
class mapped_implicit_matrix : public mapped_object
{
public:
mapped_implicit_matrix(std::string const & scalartype, unsigned int id) : mapped_object(scalartype, id, "implicit_matrix")
{ }
std::string & append_kernel_arguments(std::set<std::string> & /*already_generated*/, std::string & str, unsigned int width) const
{
str += generate_value_kernel_argument(utils::append_width(scalartype_, width), name_);
return str;
}
};
}
}
#endif
viennacl::device_specific::mapped_implicit_vector::append_kernel_arguments
std::string & append_kernel_arguments(std::set< std::string > &, std::string &str, unsigned int width) const
Definition: mapped_objects.hpp:485
viennacl::device_specific::mapped_implicit_matrix::mapped_implicit_matrix
mapped_implicit_matrix(std::string const &scalartype, unsigned int id)
Definition: mapped_objects.hpp:499
viennacl::device_specific::mapped_handle::append_kernel_arguments
std::string & append_kernel_arguments(std::set< std::string > &already_generated, std::string &str, unsigned int width) const
Definition: mapped_objects.hpp:246
viennacl::device_specific::mapped_object::type_key
std::string type_key() const
Definition: mapped_objects.hpp:107
viennacl::scheduler::OPERATION_BINARY_MAT_VEC_PROD_TYPE
Definition: forwards.h:144
viennacl::device_specific::mapped_reduction::root_idx
vcl_size_t root_idx() const
Definition: mapped_objects.hpp:179
viennacl::device_specific::mapped_object::name_
std::string name_
Definition: mapped_objects.hpp:129
viennacl::device_specific::binary_leaf
Binary leaf interface.
Definition: mapped_objects.hpp:141
viennacl::is_row_major
Helper class for checking whether a matrix has a row-major layout.
Definition: forwards.h:484
viennacl::device_specific::mapped_trans
Trans.
Definition: mapped_objects.hpp:400
viennacl::device_specific::binary_leaf::evaluate_recursive
std::string evaluate_recursive(leaf_t leaf, std::map< std::string, std::string > const &accessors)
Definition: mapped_objects.hpp:151
viennacl::device_specific::mapped_host_scalar::append_kernel_arguments
std::string & append_kernel_arguments(std::set< std::string > &already_generated, std::string &str, unsigned int width) const
Definition: mapped_objects.hpp:223
viennacl::device_specific::mapped_implicit_matrix
Implicit matrix.
Definition: mapped_objects.hpp:496
viennacl::device_specific::mapped_handle::mapped_handle
mapped_handle(std::string const &scalartype, unsigned int id, std::string const &type_key)
Definition: mapped_objects.hpp:241
viennacl::device_specific::leaf_t
leaf_t
Definition: forwards.h:180
viennacl::device_specific::mapped_object::append_kernel_arguments
virtual std::string & append_kernel_arguments(std::set< std::string > &, std::string &str, unsigned int) const
Definition: mapped_objects.hpp:105
viennacl::device_specific::mapped_object::type_key_
std::string type_key_
Definition: mapped_objects.hpp:131
viennacl::device_specific::mapped_vector_diag
Vector diag.
Definition: mapped_objects.hpp:380
viennacl::device_specific::mapped_implicit_matrix::append_kernel_arguments
std::string & append_kernel_arguments(std::set< std::string > &, std::string &str, unsigned int width) const
Definition: mapped_objects.hpp:502
viennacl::scheduler::statement::array
container_type const & array() const
Definition: forwards.h:528
viennacl::device_specific::mapped_object::~mapped_object
virtual ~mapped_object()
Definition: mapped_objects.hpp:103
viennacl::device_specific::mapped_object::evaluate
std::string evaluate(std::map< std::string, std::string > const &accessors) const
Definition: mapped_objects.hpp:120
viennacl::scheduler::op_element
Struct for holding the type family as well as the type of an operation (could be addition, subtraction, norm, etc.)
Definition: forwards.h:471
viennacl::device_specific::mapped_matrix_product
Matrix product.
Definition: mapped_objects.hpp:164
viennacl::device_specific::mapped_implicit_vector::mapped_implicit_vector
mapped_implicit_vector(std::string const &scalartype, unsigned int id)
Definition: mapped_objects.hpp:482
viennacl::device_specific::mapped_matrix_column
Matrix column.
Definition: mapped_objects.hpp:439
viennacl::device_specific::mapped_object::node_info::root_idx
vcl_size_t root_idx
Definition: mapped_objects.hpp:93
viennacl::device_specific::mapped_object::MorphBase2D::operator()
virtual std::string operator()(std::string const &i, std::string const &j) const =0
viennacl::device_specific::mapped_matrix_product::mapped_matrix_product
mapped_matrix_product(std::string const &scalartype, unsigned int id, node_info info)
Definition: mapped_objects.hpp:167
viennacl::device_specific::mapped_matrix::row_major
bool row_major() const
Definition: mapped_objects.hpp:362
viennacl::device_specific::mapped_matrix_diag::mapped_matrix_diag
mapped_matrix_diag(std::string const &scalartype, unsigned int id, node_info info)
Definition: mapped_objects.hpp:471
viennacl::device_specific::mapped_host_scalar
Host scalar.
Definition: mapped_objects.hpp:218
viennacl::device_specific::mapped_buffer
Buffered.
Definition: mapped_objects.hpp:278
viennacl::device_specific::mapped_trans::mapped_trans
mapped_trans(std::string const &scalartype, unsigned int id, node_info info)
Definition: mapped_objects.hpp:411
viennacl::device_specific::utils::kernel_generation_stream
Definition: utils.hpp:404
viennacl::traits::ld
vcl_size_t ld(matrix_base< NumericT > const &mat)
Helper routine for obtaining the internal number of entries per row of a ViennaCL matrix...
Definition: size.hpp:398
viennacl::scheduler::OPERATION_BINARY_INNER_PROD_TYPE
Definition: forwards.h:146
viennacl::tools::find_and_replace
int find_and_replace(std::string &source, std::string const &find, std::string const &replace)
Replace in a source string a pattern by another.
Definition: tools.hpp:160
viennacl::device_specific::RHS_NODE_TYPE
Definition: forwards.h:184
viennacl::device_specific::mapped_object::node_info::mapping
mapping_type const * mapping
Definition: mapped_objects.hpp:91
viennacl::device_specific::LHS_NODE_TYPE
Definition: forwards.h:182
viennacl::device_specific::mapped_object::MorphBase1D::operator()
virtual std::string operator()(std::string const &i) const =0
viennacl::device_specific::mapped_object::register_attribute
void register_attribute(std::string &attribute, std::string const &key, std::string const &value)
Definition: mapped_objects.hpp:80
viennacl::device_specific::mapped_reduction::is_index_reduction
bool is_index_reduction() const
Definition: mapped_objects.hpp:182
viennacl::device_specific::mapped_host_scalar::mapped_host_scalar
mapped_host_scalar(std::string const &scalartype, unsigned int id)
Definition: mapped_objects.hpp:221
viennacl::device_specific::tree_parsing::evaluate
std::string evaluate(leaf_t leaf, std::map< std::string, std::string > const &accessors, scheduler::statement const &statement, vcl_size_t root_idx, mapping_type const &mapping)
Definition: tree_parsing.hpp:293
viennacl::device_specific::mapped_scalar
Scalar.
Definition: mapped_objects.hpp:265
viennacl::device_specific::mapped_implicit_vector
Implicit vector.
Definition: mapped_objects.hpp:479
viennacl::device_specific::mapped_object::MorphBase2D
Definition: mapped_objects.hpp:51
viennacl::device_specific::mapped_object::MorphBase1D
Definition: mapped_objects.hpp:50
viennacl::device_specific::mapped_matrix_diag
Matrix diag.
Definition: mapped_objects.hpp:459
viennacl::device_specific::mapped_object::keywords_
std::map< std::string, std::string > keywords_
Definition: mapped_objects.hpp:132
forwards.h
Forwards declaration.
viennacl::device_specific::binary_leaf::binary_leaf
binary_leaf(mapped_object::node_info info)
Definition: mapped_objects.hpp:144
viennacl::vcl_size_t
std::size_t vcl_size_t
Definition: forwards.h:75
viennacl::device_specific::mapped_object::process
std::string process(std::string const &in) const
Definition: mapped_objects.hpp:111
viennacl::device_specific::mapped_reduction
Reduction.
Definition: mapped_objects.hpp:174
viennacl::device_specific::mapped_vector::mapped_vector
mapped_vector(std::string const &scalartype, unsigned int id)
Definition: mapped_objects.hpp:297
viennacl::device_specific::mapped_vector
Vector.
Definition: mapped_objects.hpp:288
forwards.h
Provides the datastructures for dealing with a single statement such as 'x = y + z;'.
viennacl::device_specific::mapped_object::MorphBase
Definition: mapped_objects.hpp:49
viennacl::linalg::cuda::swap
viennacl::enable_if< viennacl::is_scalar< ScalarT1 >::value &&viennacl::is_scalar< ScalarT2 >::value >::type swap(ScalarT1 &s1, ScalarT2 &s2)
Swaps the contents of two scalars, data is copied.
Definition: scalar_operations.hpp:361
viennacl::device_specific::mapped_object::node_info::node_info
node_info(mapping_type const *_mapping, scheduler::statement const *_statement, vcl_size_t _root_idx)
Definition: mapped_objects.hpp:89
viennacl::device_specific::mapped_matrix_row::mapped_matrix_row
mapped_matrix_row(std::string const &scalartype, unsigned int id, node_info info)
Definition: mapped_objects.hpp:430
viennacl::device_specific::mapping_type
std::map< mapping_key, tools::shared_ptr< mapped_object > > mapping_type
Definition: forwards.h:191
viennacl::device_specific::mapped_object
Mapped Object.
Definition: mapped_objects.hpp:43
viennacl::device_specific::mapped_object::scalartype_
std::string scalartype_
Definition: mapped_objects.hpp:130
viennacl::device_specific::mapped_row_wise_reduction::mapped_row_wise_reduction
mapped_row_wise_reduction(std::string const &scalartype, unsigned int id, node_info info)
Definition: mapped_objects.hpp:211
viennacl::device_specific::mapped_object::node_info
Definition: mapped_objects.hpp:87
viennacl::device_specific::mapped_matrix::mapped_matrix
mapped_matrix(std::string const &scalartype, unsigned int id, bool row_major)
Definition: mapped_objects.hpp:343
viennacl::device_specific::mapped_scalar_reduction
Scalar reduction.
Definition: mapped_objects.hpp:198
viennacl::device_specific::mapped_handle
Handle.
Definition: mapped_objects.hpp:235
viennacl::device_specific::mapped_buffer::mapped_buffer
mapped_buffer(std::string const &scalartype, unsigned int id, std::string const &type_key)
Definition: mapped_objects.hpp:281
utils.hpp
Internal utils.
viennacl::scheduler::op_element::type
operation_node_type type
Definition: forwards.h:474
viennacl::device_specific::mapped_object::mapped_object
mapped_object(std::string const &scalartype, unsigned int id, std::string const &type_key)
Definition: mapped_objects.hpp:97
viennacl::device_specific::mapped_scalar_reduction::mapped_scalar_reduction
mapped_scalar_reduction(std::string const &scalartype, unsigned int id, node_info info)
Definition: mapped_objects.hpp:201
viennacl::device_specific::binary_leaf::process_recursive
void process_recursive(utils::kernel_generation_stream &stream, leaf_t leaf, std::string const &key, std::string const &process_str, std::set< std::string > &already_fetched)
Definition: mapped_objects.hpp:146
viennacl::device_specific::utils::is_index_reduction
bool is_index_reduction(scheduler::op_element const &op)
Definition: utils.hpp:370
viennacl::device_specific::mapped_scalar::mapped_scalar
mapped_scalar(std::string const &scalartype, unsigned int id)
Definition: mapped_objects.hpp:271
viennacl::device_specific::mapped_vector_diag::mapped_vector_diag
mapped_vector_diag(std::string const &scalartype, unsigned int id, node_info info)
Definition: mapped_objects.hpp:392
viennacl::device_specific::mapped_matrix_row
Matrix row.
Definition: mapped_objects.hpp:418
viennacl::scheduler::statement
The main class for representing a statement such as x = inner_prod(y,z); at runtime.
Definition: forwards.h:502
viennacl::scheduler::OPERATION_BINARY_ADD_TYPE
Definition: forwards.h:118
viennacl::device_specific::mapped_reduction::root_op
scheduler::op_element root_op() const
Definition: mapped_objects.hpp:184
viennacl::device_specific::binary_leaf::info_
mapped_object::node_info info_
Definition: mapped_objects.hpp:157
viennacl::device_specific::at
ValueT const & at(std::map< KeyT, ValueT > const &map, KeyT const &key)
Emulation of C++11's .at() member for std::map<>, const-version.
Definition: forwards.h:142
viennacl::device_specific::mapped_matrix
Matrix.
Definition: mapped_objects.hpp:312
viennacl::tools::to_string
std::string to_string(T const t)
Definition: tools.hpp:304
viennacl::device_specific::mapped_object::name
std::string const & name() const
Definition: mapped_objects.hpp:109
viennacl::device_specific::mapped_reduction::mapped_reduction
mapped_reduction(std::string const &scalartype, unsigned int id, node_info info, std::string const &type_key)
Definition: mapped_objects.hpp:177
viennacl::device_specific::mapped_object::replace_offset
static void replace_offset(std::string &str, MorphBase const &morph)
Definition: mapped_objects.hpp:53
viennacl::row_major
A tag for row-major storage of a dense matrix.
Definition: forwards.h:304
viennacl::device_specific::mapped_reduction::statement
scheduler::statement const & statement() const
Definition: mapped_objects.hpp:180
viennacl::device_specific::mapped_object::MorphBase::~MorphBase
virtual ~MorphBase()
Definition: mapped_objects.hpp:49
viennacl::device_specific::mapped_row_wise_reduction
Vector reduction.
Definition: mapped_objects.hpp:208
viennacl::scheduler::statement_node
Main datastructure for an node in the statement tree.
Definition: forwards.h:478
viennacl::device_specific::mapped_matrix_column::mapped_matrix_column
mapped_matrix_column(std::string const &scalartype, unsigned int id, node_info info)
Definition: mapped_objects.hpp:451
viennacl::device_specific::mapped_reduction::root_node
scheduler::statement_node root_node() const
Definition: mapped_objects.hpp:181
viennacl::device_specific::tree_parsing::process
void process(utils::kernel_generation_stream &stream, leaf_t leaf, std::string const &type_key, std::string const &to_process, scheduler::statement const &statement, vcl_size_t root_idx, mapping_type const &mapping, std::set< std::string > &already_processed)
Definition: tree_parsing.hpp:360
viennacl::device_specific::utils::append_width
std::string append_width(std::string const &str, unsigned int width)
Definition: utils.hpp:558
viennacl::device_specific::mapped_object::node_info::statement
scheduler::statement const * statement
Definition: mapped_objects.hpp:92