1 #ifndef VIENNACL_LINALG_VECTOR_OPERATIONS_HPP_
2 #define VIENNACL_LINALG_VECTOR_OPERATIONS_HPP_
36 #ifdef VIENNACL_WITH_OPENCL
40 #ifdef VIENNACL_WITH_CUDA
48 template <
typename T,
typename ScalarType1>
50 vector_base<T> const & vec2, ScalarType1
const & alpha,
vcl_size_t len_alpha,
bool reciprocal_alpha,
bool flip_sign_alpha)
59 #ifdef VIENNACL_WITH_OPENCL
64 #ifdef VIENNACL_WITH_CUDA
77 template <
typename T,
typename ScalarType1,
typename ScalarType2>
79 vector_base<T> const & vec2, ScalarType1
const & alpha,
vcl_size_t len_alpha,
bool reciprocal_alpha,
bool flip_sign_alpha,
80 vector_base<T> const & vec3, ScalarType2
const & beta,
vcl_size_t len_beta,
bool reciprocal_beta,
bool flip_sign_beta)
89 vec2, alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
90 vec3, beta, len_beta, reciprocal_beta, flip_sign_beta);
92 #ifdef VIENNACL_WITH_OPENCL
95 vec2, alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
96 vec3, beta, len_beta, reciprocal_beta, flip_sign_beta);
99 #ifdef VIENNACL_WITH_CUDA
102 vec2, alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
103 vec3, beta, len_beta, reciprocal_beta, flip_sign_beta);
114 template <
typename T,
typename ScalarType1,
typename ScalarType2>
116 vector_base<T> const & vec2, ScalarType1
const & alpha,
vcl_size_t len_alpha,
bool reciprocal_alpha,
bool flip_sign_alpha,
117 vector_base<T> const & vec3, ScalarType2
const & beta,
vcl_size_t len_beta,
bool reciprocal_beta,
bool flip_sign_beta)
126 vec2, alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
127 vec3, beta, len_beta, reciprocal_beta, flip_sign_beta);
129 #ifdef VIENNACL_WITH_OPENCL
132 vec2, alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
133 vec3, beta, len_beta, reciprocal_beta, flip_sign_beta);
136 #ifdef VIENNACL_WITH_CUDA
139 vec2, alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
140 vec3, beta, len_beta, reciprocal_beta, flip_sign_beta);
157 template <
typename T>
165 #ifdef VIENNACL_WITH_OPENCL
170 #ifdef VIENNACL_WITH_CUDA
188 template <
typename T>
198 #ifdef VIENNACL_WITH_OPENCL
203 #ifdef VIENNACL_WITH_CUDA
225 template <
typename T,
typename OP>
236 #ifdef VIENNACL_WITH_OPENCL
241 #ifdef VIENNACL_WITH_CUDA
256 #define VIENNACL_GENERATE_BINARY_ELEMENTOPERATION_OVERLOADS(OPNAME) \
257 template <typename T> \
258 viennacl::vector_expression<const vector_base<T>, const vector_base<T>, op_element_binary<op_##OPNAME> > \
259 element_##OPNAME(vector_base<T> const & v1, vector_base<T> const & v2) \
261 return viennacl::vector_expression<const vector_base<T>, const vector_base<T>, op_element_binary<op_##OPNAME> >(v1, v2); \
264 template <typename V1, typename V2, typename OP, typename T> \
265 viennacl::vector_expression<const vector_expression<const V1, const V2, OP>, const vector_base<T>, op_element_binary<op_##OPNAME> > \
266 element_##OPNAME(vector_expression<const V1, const V2, OP> const & proxy, vector_base<T> const & v2) \
268 return viennacl::vector_expression<const vector_expression<const V1, const V2, OP>, const vector_base<T>, op_element_binary<op_##OPNAME> >(proxy, v2); \
271 template <typename T, typename V2, typename V3, typename OP> \
272 viennacl::vector_expression<const vector_base<T>, const vector_expression<const V2, const V3, OP>, op_element_binary<op_##OPNAME> > \
273 element_##OPNAME(vector_base<T> const & v1, vector_expression<const V2, const V3, OP> const & proxy) \
275 return viennacl::vector_expression<const vector_base<T>, const vector_expression<const V2, const V3, OP>, op_element_binary<op_##OPNAME> >(v1, proxy); \
278 template <typename V1, typename V2, typename OP1, \
279 typename V3, typename V4, typename OP2> \
280 viennacl::vector_expression<const vector_expression<const V1, const V2, OP1>, \
281 const vector_expression<const V3, const V4, OP2>, \
282 op_element_binary<op_##OPNAME> > \
283 element_##OPNAME(vector_expression<const V1, const V2, OP1> const & proxy1, \
284 vector_expression<const V3, const V4, OP2> const & proxy2) \
286 return viennacl::vector_expression<const vector_expression<const V1, const V2, OP1>, \
287 const vector_expression<const V3, const V4, OP2>, \
288 op_element_binary<op_##OPNAME> >(proxy1, proxy2); \
291 VIENNACL_GENERATE_BINARY_ELEMENTOPERATION_OVERLOADS(
prod)
292 VIENNACL_GENERATE_BINARY_ELEMENTOPERATION_OVERLOADS(div)
293 VIENNACL_GENERATE_BINARY_ELEMENTOPERATION_OVERLOADS(pow)
295 #undef VIENNACL_GENERATE_BINARY_ELEMENTOPERATION_OVERLOADS
298 #define VIENNACL_MAKE_UNARY_ELEMENT_OP(funcname) \
299 template <typename T> \
300 viennacl::vector_expression<const vector_base<T>, const vector_base<T>, op_element_unary<op_##funcname> > \
301 element_##funcname(vector_base<T> const & v) \
303 return viennacl::vector_expression<const vector_base<T>, const vector_base<T>, op_element_unary<op_##funcname> >(v, v); \
305 template <typename LHS, typename RHS, typename OP> \
306 viennacl::vector_expression<const vector_expression<const LHS, const RHS, OP>, \
307 const vector_expression<const LHS, const RHS, OP>, \
308 op_element_unary<op_##funcname> > \
309 element_##funcname(vector_expression<const LHS, const RHS, OP> const & proxy) \
311 return viennacl::vector_expression<const vector_expression<const LHS, const RHS, OP>, \
312 const vector_expression<const LHS, const RHS, OP>, \
313 op_element_unary<op_##funcname> >(proxy, proxy); \
334 #undef VIENNACL_MAKE_UNARY_ELEMENT_OP
350 template <
typename T>
355 assert( vec1.
size() == vec2.
size() && bool(
"Size mismatch") );
362 #ifdef VIENNACL_WITH_OPENCL
367 #ifdef VIENNACL_WITH_CUDA
380 template <
typename LHS,
typename RHS,
typename OP,
typename T>
391 template <
typename T,
typename LHS,
typename RHS,
typename OP>
402 template <
typename LHS1,
typename RHS1,
typename OP1,
403 typename LHS2,
typename RHS2,
typename OP2,
typename T>
422 template <
typename T>
427 assert( vec1.
size() == vec2.
size() && bool(
"Size mismatch") );
434 #ifdef VIENNACL_WITH_OPENCL
439 #ifdef VIENNACL_WITH_CUDA
452 template <
typename LHS,
typename RHS,
typename OP,
typename T>
463 template <
typename T,
typename LHS,
typename RHS,
typename OP>
474 template <
typename LHS1,
typename RHS1,
typename OP1,
475 typename LHS2,
typename RHS2,
typename OP2,
typename S3>
493 template <
typename T>
498 assert( x.
size() == y_tuple.
const_at(0).size() && bool(
"Size mismatch") );
499 assert( result.
size() == y_tuple.
const_size() && bool(
"Number of elements does not match result size") );
506 #ifdef VIENNACL_WITH_OPENCL
511 #ifdef VIENNACL_WITH_CUDA
529 template <
typename T>
538 #ifdef VIENNACL_WITH_OPENCL
543 #ifdef VIENNACL_WITH_CUDA
561 template <
typename LHS,
typename RHS,
typename OP,
typename S2>
576 template <
typename T>
585 #ifdef VIENNACL_WITH_OPENCL
590 #ifdef VIENNACL_WITH_CUDA
607 template <
typename LHS,
typename RHS,
typename OP,
typename S2>
623 template <
typename T>
632 #ifdef VIENNACL_WITH_OPENCL
637 #ifdef VIENNACL_WITH_CUDA
654 template <
typename LHS,
typename RHS,
typename OP,
typename T>
668 template <
typename T>
677 #ifdef VIENNACL_WITH_OPENCL
682 #ifdef VIENNACL_WITH_CUDA
699 template <
typename LHS,
typename RHS,
typename OP,
typename S2>
715 template <
typename T>
724 #ifdef VIENNACL_WITH_OPENCL
729 #ifdef VIENNACL_WITH_CUDA
746 template <
typename LHS,
typename RHS,
typename OP,
typename T>
760 template <
typename T>
769 #ifdef VIENNACL_WITH_OPENCL
774 #ifdef VIENNACL_WITH_CUDA
791 template <
typename LHS,
typename RHS,
typename OP,
typename S2>
808 template <
typename T>
815 #ifdef VIENNACL_WITH_OPENCL
819 #ifdef VIENNACL_WITH_CUDA
834 template <
typename LHS,
typename RHS,
typename OP>
851 template <
typename T>
861 #ifdef VIENNACL_WITH_OPENCL
866 #ifdef VIENNACL_WITH_CUDA
880 template <
typename T,
typename LHS,
typename RHS,
typename OP>
884 assert( (v1.
size() > 0) &&
bool(
"Vector not yet initialized!") );
891 template <
typename T,
typename LHS,
typename RHS,
typename OP>
895 assert( (v1.
size() > 0) &&
bool(
"Vector not yet initialized!") );
void vector_assign(vector_base< T > &vec1, const T &alpha, bool up_to_internal_size=false)
Assign a constant value to a vector (-range/-slice)
Definition: vector_operations.hpp:253
VectorType const & const_at(vcl_size_t i) const
Definition: vector.hpp:1174
void avbv_v(vector_base< T > &vec1, vector_base< T > const &vec2, ScalarType1 const &alpha, vcl_size_t, bool reciprocal_alpha, bool flip_sign_alpha, vector_base< T > const &vec3, ScalarType2 const &beta, vcl_size_t, bool reciprocal_beta, bool flip_sign_beta)
Definition: vector_operations.hpp:175
std::size_t vcl_size_t
Definition: forwards.h:58
This class represents a single scalar value on the GPU and behaves mostly like a built-in scalar type...
Definition: forwards.h:172
void avbv(vector_base< T > &vec1, vector_base< T > const &vec2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, vector_base< T > const &vec3, ScalarType2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
Definition: vector_operations.hpp:95
size_type size() const
Returns the length of the vector (cf. std::vector)
Definition: vector.hpp:837
Definition: forwards.h:478
void norm_2_impl(vector_base< T > const &vec, scalar< T > &result)
Computes the l^2-norm of a vector - implementation using OpenCL summation at second step...
Definition: vector_operations.hpp:776
Worker class for decomposing expression templates.
Definition: op_executor.hpp:79
void av(vector_base< T > &vec1, vector_base< T > const &vec2, ScalarType1 const &alpha, vcl_size_t, bool reciprocal_alpha, bool flip_sign_alpha)
Definition: vector_operations.hpp:66
Implementations of vector operations using OpenCL.
vcl_size_t index_norm_inf(vector_base< T > const &vec)
Computes the index of the first entry that is equal to the supremum-norm in modulus.
Definition: vector_operations.hpp:809
Exception class in case of memory errors.
Definition: forwards.h:485
void norm_1_cpu(vector_base< T > const &vec, T &result)
Computes the l^1-norm of a vector with final reduction on CPU.
Definition: vector_operations.hpp:745
Generic size and resize functionality for different vector and matrix types.
void plane_rotation(vector_base< T > &vec1, vector_base< T > &vec2, T alpha, T beta)
Computes a plane rotation of two vectors.
Definition: vector_operations.hpp:945
void inner_prod_impl(vector_base< T > const &vec1, vector_base< T > const &vec2, S3 &result)
Computes the inner product of two vectors - implementation. Library users should call inner_prod(vec1...
Definition: vector_operations.hpp:383
void inner_prod_impl(vector_base< T > const &vec1, vector_base< T > const &vec2, scalar< T > &result)
Computes the inner product of two vectors - dispatcher interface.
Definition: vector_operations.hpp:351
Extracts the underlying OpenCL start index handle from a vector, a matrix, an expression etc...
void norm_2_cpu(vector_base< T > const &vec1, T &result)
Computes the l^2-norm of a vector - implementation.
Definition: vector_operations.hpp:2561
void element_op(matrix_base< NumericT, F > &A, matrix_expression< const matrix_base< NumericT, F >, const matrix_base< NumericT, F >, op_element_binary< OP > > const &proxy)
Implementation of the element-wise operations A = B .* C and A = B ./ C (using MATLAB syntax) ...
Definition: matrix_operations.hpp:604
void plane_rotation(vector_base< T > &vec1, vector_base< T > &vec2, T alpha, T beta)
Computes a plane rotation of two vectors.
Definition: vector_operations.hpp:852
void inner_prod_impl(vector_base< T > const &vec1, vector_base< T > const &vec2, S3 &result)
Computes the inner product of two vectors - implementation. Library users should call inner_prod(vec1...
Definition: vector_operations.hpp:1736
void avbv_v(vector_base< T > &vec1, vector_base< T > const &vec2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, vector_base< T > const &vec3, ScalarType2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
Definition: vector_operations.hpp:115
void norm_inf_impl(vector_base< T > const &vec, scalar< T > &result)
Computes the supremum-norm of a vector.
Definition: vector_operations.hpp:841
This file provides the forward declarations for the main types used within ViennaCL.
Determines row and column increments for matrices and matrix proxies.
void vector_swap(vector_base< T > &vec1, vector_base< T > &vec2)
Swaps the contents of two vectors, data is copied.
Definition: vector_operations.hpp:827
An expression template class that represents a binary operation that yields a vector.
Definition: forwards.h:181
void avbv_v(vector_base< T > &vec1, vector_base< T > const &vec2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, vector_base< T > const &vec3, ScalarType2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
Definition: vector_operations.hpp:157
void plane_rotation(vector_base< T > &vec1, vector_base< T > &vec2, T alpha, T beta)
Computes a plane rotation of two vectors.
Definition: vector_operations.hpp:2758
A tag class representing inplace addition.
Definition: forwards.h:65
Definition: forwards.h:481
void avbv(vector_base< T > &vec1, vector_base< T > const &vec2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, vector_base< T > const &vec3, ScalarType2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
Definition: vector_operations.hpp:407
void av(vector_base< T > &vec1, vector_base< T > const &vec2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha)
Definition: vector_operations.hpp:118
void avbv_v(vector_base< T > &vec1, vector_base< T > const &vec2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, vector_base< T > const &vec3, ScalarType2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
Definition: vector_operations.hpp:709
memory_types get_active_handle_id() const
Returns an ID for the currently active memory buffer. Other memory buffers might contain old or no da...
Definition: mem_handle.hpp:91
vcl_size_t index_norm_inf(vector_base< T > const &vec1)
Computes the index of the first entry that is equal to the supremum-norm in modulus.
Definition: vector_operations.hpp:543
void vector_assign(vector_base< T > &vec1, const S1 &alpha, bool up_to_internal_size=false)
Assign a constant value to a vector (-range/-slice)
Definition: vector_operations.hpp:777
VectorT prod(std::vector< std::vector< T, A1 >, A2 > const &matrix, VectorT const &vector)
Definition: prod.hpp:91
vector< NumericT > operator-=(vector_base< NumericT > &v1, const viennacl::vector_expression< const matrix_base< NumericT, F >, const vector_base< NumericT >, viennacl::op_prod > &proxy)
Implementation of the operation v1 -= A * v2, where A is a matrix.
Definition: matrix_operations.hpp:817
void element_op(matrix_base< T, F > &A, matrix_expression< const matrix_base< T, F >, const matrix_base< T, F >, op_element_binary< OP > > const &proxy)
Definition: matrix_operations.hpp:489
void inner_prod_impl(vector_base< T > const &vec1, vector_base< T > const &vec2, vector_base< T > &partial_result)
Computes the partial inner product of two vectors - implementation. Library users should call inner_p...
Definition: vector_operations.hpp:360
vcl_size_t size(VectorType const &vec)
Generic routine for obtaining the size of a vector (ViennaCL, uBLAS, etc.)
Definition: size.hpp:144
Definition: forwards.h:480
void norm_1_impl(vector_base< T > const &vec, scalar< T > &result)
Computes the l^1-norm of a vector - dispatcher interface.
Definition: vector_operations.hpp:530
void norm_2_cpu(vector_base< T > const &vec, T &result)
Computes the l^1-norm of a vector with final reduction on CPU.
Definition: vector_operations.hpp:810
Tuple class holding pointers to multiple vectors. Mainly used as a temporary object returned from vie...
Definition: forwards.h:211
void plane_rotation(vector_base< T > &vec1, vector_base< T > &vec2, T alpha, T beta)
Computes a plane rotation of two vectors.
Definition: vector_operations.hpp:582
#define VIENNACL_MAKE_UNARY_ELEMENT_OP(funcname)
Definition: matrix_operations.hpp:678
void norm_1_cpu(vector_base< T > const &vec1, T &result)
Computes the l^1-norm of a vector.
Definition: vector_operations.hpp:2515
void element_op(matrix_base< T, F > &A, matrix_expression< const matrix_base< T, F >, const matrix_base< T, F >, op_element_binary< OP > > const &proxy)
Implementation of binary element-wise operations A = OP(B,C)
Definition: matrix_operations.hpp:460
vcl_size_t index_norm_inf(vector_base< T > const &vec1)
Computes the index of the first entry that is equal to the supremum-norm in modulus.
Definition: vector_operations.hpp:2698
void av(vector_base< T > &vec1, vector_base< T > const &vec2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha)
Definition: vector_operations.hpp:55
void vector_swap(vector_base< T > &vec1, vector_base< T > &vec2)
Swaps the contents of two vectors, data is copied.
Definition: vector_operations.hpp:189
void norm_inf_cpu(vector_base< T > const &vec, T &result)
Computes the supremum-norm of a vector with final reduction on the CPU.
Definition: vector_operations.hpp:761
vector< NumericT > operator+=(vector_base< NumericT > &v1, const viennacl::vector_expression< const matrix_base< NumericT, F >, const vector_base< NumericT >, viennacl::op_prod > &proxy)
Implementation of the operation v1 += A * v2, where A is a matrix.
Definition: matrix_operations.hpp:799
void norm_1_impl(vector_base< T > const &vec, scalar< T > &result)
Computes the l^1-norm of a vector.
Definition: vector_operations.hpp:711
Common base class for dense vectors, vector ranges, and vector slices.
Definition: forwards.h:205
void vector_swap(vector_base< T > &vec1, vector_base< T > &vec2)
Swaps the contents of two vectors, data is copied.
Definition: vector_operations.hpp:280
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
A vector class representing a linear memory sequence on the GPU. Inspired by boost::numeric::ublas::v...
Definition: forwards.h:208
void norm_2_cpu(vector_base< T > const &vec, T &result)
Computes the l^2-norm of a vector with final reduction on the CPU - dispatcher interface.
Definition: vector_operations.hpp:669
void avbv(vector_base< T > &vec1, vector_base< T > const &vec2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, vector_base< T > const &vec3, ScalarType2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
Definition: vector_operations.hpp:78
void norm_inf_impl(vector_base< T > const &vec1, scalar< T > &result)
Computes the supremum-norm of a vector.
Definition: vector_operations.hpp:2589
All the predicates used within ViennaCL. Checks for expressions to be vectors, etc.
void avbv(vector_base< T > &vec1, vector_base< T > const &vec2, ScalarType1 const &alpha, vcl_size_t, bool reciprocal_alpha, bool flip_sign_alpha, vector_base< T > const &vec3, ScalarType2 const &beta, vcl_size_t, bool reciprocal_beta, bool flip_sign_beta)
Definition: vector_operations.hpp:105
void norm_1_impl(vector_base< T > const &vec1, scalar< T > &result)
Computes the l^1-norm of a vector.
Definition: vector_operations.hpp:2497
A tag class representing inplace subtraction.
Definition: forwards.h:67
void inner_prod_cpu(vector_base< T > const &vec1, vector_base< T > const &vec2, T &result)
Computes the inner product of two vectors with the final reduction step on the CPU - dispatcher inter...
Definition: vector_operations.hpp:423
void norm_2_impl(vector_base< T > const &vec1, scalar< T > &result)
Computes the l^2-norm of a vector - implementation.
Definition: vector_operations.hpp:2542
cl_uint index_norm_inf(vector_base< T > const &vec)
Computes the index of the first entry that is equal to the supremum-norm in modulus.
Definition: vector_operations.hpp:907
Definition: forwards.h:479
void av(vector_base< T > &vec1, vector_base< T > const &vec2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha)
Definition: vector_operations.hpp:49
void norm_inf_cpu(vector_base< T > const &vec, T &result)
Computes the supremum-norm of a vector.
Definition: vector_operations.hpp:875
void inner_prod_cpu(vector_base< T > const &vec1, vector_base< T > const &vec2, T &result)
Computes the inner product of two vectors - implementation. Library users should call inner_prod(vec1...
Definition: vector_operations.hpp:1768
void norm_2_impl(vector_base< T > const &vec, scalar< T > &result)
Computes the l^2-norm of a vector - dispatcher interface.
Definition: vector_operations.hpp:624
void norm_1_impl(vector_base< T > const &vec1, S2 &result)
Computes the l^1-norm of a vector.
Definition: vector_operations.hpp:454
void vector_assign(vector_base< T > &vec1, const T &alpha, bool up_to_internal_size=false)
Assign a constant value to a vector (-range/-slice)
Definition: vector_operations.hpp:158
Extracts the underlying OpenCL handle from a vector, a matrix, an expression etc. ...
void vector_assign(vector_base< T > &vec1, const T &alpha, bool up_to_internal_size=false)
Assign a constant value to a vector (-range/-slice)
Definition: vector_operations.hpp:225
viennacl::backend::mem_handle & handle(T &obj)
Returns the generic memory handle of an object. Non-const version.
Definition: handle.hpp:41
void vector_swap(vector_base< T > &vec1, vector_base< T > &vec2)
Swaps the contents of two vectors, data is copied.
Definition: vector_operations.hpp:251
void inner_prod_cpu(vector_base< T > const &vec1, vector_base< T > const &vec2, T &result)
Computes the inner product of two vectors - implementation. Library users should call inner_prod(vec1...
Definition: vector_operations.hpp:643
Implementation of the ViennaCL scalar class.
Implementations of vector operations using a plain single-threaded execution on CPU.
void norm_1_cpu(vector_base< T > const &vec, T &result)
Computes the l^1-norm of a vector with final reduction on the CPU.
Definition: vector_operations.hpp:577
void norm_inf_cpu(vector_base< T > const &vec1, T &result)
Computes the supremum-norm of a vector.
Definition: vector_operations.hpp:2609
void norm_inf_impl(vector_base< T > const &vec, scalar< T > &result)
Computes the supremum-norm of a vector.
Definition: vector_operations.hpp:716
Simple enable-if variant that uses the SFINAE pattern.
void norm_2_impl(vector_base< T > const &vec1, S2 &result)
Computes the l^2-norm of a vector - implementation.
Definition: vector_operations.hpp:482
void norm_inf_impl(vector_base< T > const &vec1, S2 &result)
Computes the supremum-norm of a vector.
Definition: vector_operations.hpp:514
vcl_size_t const_size() const
Definition: vector.hpp:1171
Implementations of vector operations using a plain single-threaded or OpenMP-enabled execution on CPU...