1 #ifndef VIENNACL_SCHEDULER_EXECUTE_ELEMENTWISE_HPP
2 #define VIENNACL_SCHEDULER_EXECUTE_ELEMENTWISE_HPP
48 assert( result.
subtype == x.
subtype &&
bool(
"result not of vector type for unary elementwise operation"));
53 #define VIENNACL_SCHEDULER_GENERATE_UNARY_ELEMENT_OP(OPNAME, SCALARTYPE, OPTAG) \
54 case OPNAME: viennacl::linalg::element_op(*result.vector_##SCALARTYPE, \
55 viennacl::vector_expression<const vector_base<SCALARTYPE>, const vector_base<SCALARTYPE>, \
56 op_element_unary<OPTAG> >(*x.vector_##SCALARTYPE, *x.vector_##SCALARTYPE)); break;
101 #undef VIENNACL_SCHEDULER_GENERATE_UNARY_ELEMENT_OP
115 #define VIENNACL_SCHEDULER_GENERATE_UNARY_ELEMENT_OP(OPNAME, SCALARTYPE, OPTAG) \
116 case OPNAME: viennacl::linalg::element_op(*result.matrix_row_##SCALARTYPE, \
117 viennacl::matrix_expression<const matrix_base<SCALARTYPE, viennacl::row_major>, const matrix_base<SCALARTYPE, viennacl::row_major>, \
118 op_element_unary<OPTAG> >(*x.matrix_row_##SCALARTYPE, *x.matrix_row_##SCALARTYPE)); break;
170 #undef VIENNACL_SCHEDULER_GENERATE_UNARY_ELEMENT_OP
179 #define VIENNACL_SCHEDULER_GENERATE_UNARY_ELEMENT_OP(OPNAME, SCALARTYPE, OPTAG) \
180 case OPNAME: viennacl::linalg::element_op(*result.matrix_col_##SCALARTYPE, \
181 viennacl::matrix_expression<const matrix_base<SCALARTYPE, viennacl::column_major>, const matrix_base<SCALARTYPE, viennacl::column_major>, \
182 op_element_unary<OPTAG> >(*x.matrix_col_##SCALARTYPE, *x.matrix_col_##SCALARTYPE)); break;
234 #undef VIENNACL_SCHEDULER_GENERATE_UNARY_ELEMENT_OP
statement_node_subtype subtype
Definition: forwards.h:270
viennacl::matrix_base< float > * matrix_row_float
Definition: forwards.h:339
A tag class representing the cosh() function.
Definition: forwards.h:107
A tag class representing the tan() function.
Definition: forwards.h:133
Definition: forwards.h:182
Implementations of dense matrix related operations including matrix-vector products.
vcl_size_t node_index
Definition: forwards.h:276
void new_element(lhs_rhs_element &new_elem, lhs_rhs_element const &old_element)
Definition: execute_util.hpp:102
Implementations of vector operations.
Definition: forwards.h:56
lhs_rhs_element lhs
Definition: forwards.h:422
Definition: forwards.h:217
Definition: forwards.h:81
A tag class representing the modulus function for integers.
Definition: forwards.h:93
A tag class representing the ceil() function.
Definition: forwards.h:103
Definition: forwards.h:66
Definition: forwards.h:190
This file provides the forward declarations for the main types used within ViennaCL.
A class representing the 'data' for the LHS or RHS operand of the respective node.
Definition: forwards.h:267
operation_node_type_family type_family
Definition: forwards.h:415
void execute_element_composite(statement const &s, statement_node const &root_node)
Deals with x = RHS where RHS is a vector expression.
Definition: execute_elementwise.hpp:390
A tag class representing the log() function.
Definition: forwards.h:123
lhs_rhs_element rhs
Definition: forwards.h:424
Definition: forwards.h:80
A tag class representing the tanh() function.
Definition: forwards.h:135
A tag class representing the fabs() function.
Definition: forwards.h:111
viennacl::matrix_base< float, viennacl::column_major > * matrix_col_float
Definition: forwards.h:351
void delete_element(lhs_rhs_element &elem)
Definition: execute_util.hpp:179
A dense matrix class.
Definition: forwards.h:290
A tag class representing the atan() function.
Definition: forwards.h:99
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
Definition: cpu_ram.hpp:29
A tag class representing the sinh() function.
Definition: forwards.h:129
viennacl::matrix_base< double, viennacl::column_major > * matrix_col_double
Definition: forwards.h:352
viennacl::vector_base< float > * vector_float
Definition: forwards.h:315
Definition: forwards.h:82
statement_node_numeric_type numeric_type
Definition: forwards.h:271
Definition: forwards.h:70
A tag class representing the exp() function.
Definition: forwards.h:109
Definition: forwards.h:74
viennacl::vector_base< double > * vector_double
Definition: forwards.h:316
#define VIENNACL_SCHEDULER_GENERATE_UNARY_ELEMENT_OP(OPNAME, SCALARTYPE, OPTAG)
Definition: forwards.h:73
An expression template class that represents a binary operation that yields a vector.
Definition: forwards.h:181
Definition: forwards.h:69
A tag class representing the sqrt() function.
Definition: forwards.h:131
Definition: forwards.h:205
Definition: forwards.h:78
Definition: forwards.h:76
void element_op(matrix_base< T, F > &A, matrix_expression< const matrix_base< T, F >, const matrix_base< T, F >, OP > const &proxy)
Implementation of the element-wise operation A = B .* C and A = B ./ C for matrices (using MATLAB syn...
Definition: matrix_operations.hpp:598
Definition: forwards.h:75
Definition: forwards.h:99
Expression template class for representing a tree of expressions which ultimately result in a matrix...
Definition: forwards.h:283
Provides the datastructures for dealing with a single statement such as 'x = y + z;'.
operation_node_type
Enumeration for identifying the possible operations.
Definition: forwards.h:61
A tag class representing the sin() function.
Definition: forwards.h:127
Definition: forwards.h:90
Definition: forwards.h:77
Definition: forwards.h:71
Definition: forwards.h:100
container_type const & array() const
Definition: forwards.h:473
void execute_composite(statement const &s, statement_node const &root_node)
Deals with x = RHS where RHS is an expression and x is either a scalar, a vector, or a matrix...
Definition: execute.hpp:41
A tag class representing the floor() function.
Definition: forwards.h:115
A tag class representing the asin() function.
Definition: forwards.h:97
Definition: forwards.h:79
viennacl::matrix_base< double > * matrix_row_double
Definition: forwards.h:340
A tag class representing element-wise binary operations (like multiplication) on vectors or matrices...
Definition: forwards.h:86
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
Definition: forwards.h:68
Definition: forwards.h:57
A tag class representing the acos() function.
Definition: forwards.h:95
Definition: forwards.h:187
A tag class representing the log10() function.
Definition: forwards.h:125
op_element op
Definition: forwards.h:423
void element_op(lhs_rhs_element result, lhs_rhs_element const &x, operation_node_type op_type)
Definition: execute_elementwise.hpp:39
Definition: forwards.h:216
Provides various utilities for implementing the execution of statements.
A tag class representing the cos() function.
Definition: forwards.h:105
Main datastructure for an node in the statement tree.
Definition: forwards.h:420
Definition: forwards.h:67
Definition: forwards.h:72
Exception for the case the scheduler is unable to deal with the operation.
Definition: forwards.h:36
operation_node_type type
Definition: forwards.h:416
Definition: forwards.h:191
Definition: forwards.h:167