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, NumericT, OPTAG) \
54 case OPNAME: viennacl::linalg::element_op(*result.vector_##NumericT, \
55 viennacl::vector_expression<const vector_base<NumericT>, const vector_base<NumericT>, \
56 op_element_unary<OPTAG> >(*x.vector_##NumericT, *x.vector_##NumericT)); break;
101 #undef VIENNACL_SCHEDULER_GENERATE_UNARY_ELEMENT_OP
115 #define VIENNACL_SCHEDULER_GENERATE_UNARY_ELEMENT_OP(OPNAME, NumericT, OPTAG) \
116 case OPNAME: viennacl::linalg::element_op(*result.matrix_##NumericT, \
117 viennacl::matrix_expression<const matrix_base<NumericT>, const matrix_base<NumericT>, \
118 op_element_unary<OPTAG> >(*x.matrix_##NumericT, *x.matrix_##NumericT)); break;
170 #undef VIENNACL_SCHEDULER_GENERATE_UNARY_ELEMENT_OP
A tag class representing the cosh() function.
A tag class representing the tan() function.
#define VIENNACL_SCHEDULER_GENERATE_UNARY_ELEMENT_OP(OPNAME, NumericT, OPTAG)
Implementations of dense matrix related operations including matrix-vector products.
Implementations of vector operations.
viennacl::context extract_context(statement_node const &root_node)
Helper routine for extracting the context in which a statement is executed.
A tag class representing the modulus function for integers.
statement_node_subtype subtype
Expression template class for representing a tree of expressions which ultimately result in a matrix...
A tag class representing the ceil() function.
This file provides the forward declarations for the main types used within ViennaCL.
statement_node_type_family type_family
A class representing the 'data' for the LHS or RHS operand of the respective node.
container_type const & array() const
void execute_element_composite(statement const &s, statement_node const &root_node)
Deals with x = RHS where RHS is a vector expression.
An expression template class that represents a binary operation that yields a vector.
void element_op(matrix_base< T > &A, matrix_expression< const matrix_base< T >, const matrix_base< T >, OP > const &proxy)
Implementation of the element-wise operation A = B .* C and A = B ./ C for matrices (using MATLAB syn...
A tag class representing the log() function.
operation_node_type_family type_family
A tag class representing the tanh() function.
A tag class representing the fabs() function.
viennacl::matrix_base< double > * matrix_double
void delete_element(lhs_rhs_element &elem)
Represents a generic 'context' similar to an OpenCL context, but is backend-agnostic and thus also su...
A tag class representing the atan() function.
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
A tag class representing the sinh() function.
A tag class representing the exp() function.
statement_node_numeric_type numeric_type
viennacl::vector_base< float > * vector_float
viennacl::matrix_base< float > * matrix_float
A tag class representing the sqrt() function.
viennacl::vector_base< double > * vector_double
Provides the datastructures for dealing with a single statement such as 'x = y + z;'.
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...
operation_node_type
Enumeration for identifying the possible operations.
A tag class representing the sin() function.
void new_element(lhs_rhs_element &new_elem, lhs_rhs_element const &old_element, viennacl::context const &ctx)
A tag class representing the floor() function.
A tag class representing the asin() function.
A tag class representing element-wise binary operations (like multiplication) on vectors or matrices...
The main class for representing a statement such as x = inner_prod(y,z); at runtime.
A tag class representing the acos() function.
A tag class representing the log10() function.
void element_op(lhs_rhs_element result, lhs_rhs_element const &x, operation_node_type op_type)
Provides various utilities for implementing the execution of statements.
A tag class representing the cos() function.
Main datastructure for an node in the statement tree.
Exception for the case the scheduler is unable to deal with the operation.