31 #ifndef ELEMENTWISE_OPERATIONS_H_
32 #define ELEMENTWISE_OPERATIONS_H_
55 template <
class Operand,
class UnaryOp>
57 ->
typename Operand::template container_type<decltype(unary_op(operand.data()[0]))>
59 typedef decltype(unary_op(operand.data()[0])) ST;
60 typedef typename Operand::template container_type<ST> ReturnType;
65 ReturnType, UnaryOp>::compute(operand, result, unary_op);
79 template <
class Operand,
class UnaryOp>
82 typedef typename Operand::Scalar T;
83 typedef decltype(unary_op(operand.data()[0])) ST;
84 static_assert(std::is_same<T,ST>::value,
"Scalar type mismatch!\n");
87 Operand, UnaryOp>::compute(operand, operand, unary_op);
101 template <
class Operand>
105 operations::ocl_operation operation(unary_op);
107 implementation::elementwise_unary_operation<Backend::VIENNACL, Operand,
108 Operand, operations::ocl_operation>::compute(operand, result, operation);
122 template <
class Operand>
125 operations::ocl_operation operation(unary_op);
126 implementation::elementwise_unary_operation<Backend::VIENNACL, Operand,
127 Operand, operations::ocl_operation>::compute(operand, operand, operation);
129 #endif // HAVE_VIENNACL
139 template <Backend backend,
class Operand>
140 typename Operand::template container_type<typename operations::sin<typename Operand::Scalar>::return_type>
143 typedef typename Operand::Scalar T;
145 typedef typename Operand::template container_type<ST> ReturnType;
164 template <Backend backend,
class Operand>
167 typedef typename Operand::Scalar T;
169 static_assert(std::is_same<T,ST>::value,
"Scalar type mismatch!\n");
179 #endif // ELEMENTWISE_OPERATIONS_H_
void elementwise_sin_inplace(Operand operand)
auto elementwise_compute(Operand operand, UnaryOp unary_op) -> typename Operand::template container_type< decltype(unary_op(operand.data()[0]))>
Template struct elementwise_unary_operation. This struct is specialized for computing element-wise op...
Operand::template container_type< typename operations::sin< typename Operand::Scalar >::return_type > elementwise_sin(Operand operand)
all of classes and functions are contained in the shogun namespace
static ReturnType alloc(Operand op)
void elementwise_compute_inplace(Operand operand, UnaryOp unary_op)