Implementations of vector operations. More...
#include "viennacl/forwards.h"
#include "viennacl/ocl/device.hpp"
#include "viennacl/ocl/handle.hpp"
#include "viennacl/ocl/kernel.hpp"
#include "viennacl/scalar.hpp"
#include "viennacl/tools/tools.hpp"
#include "viennacl/linalg/kernels/vector_kernels.h"
#include "viennacl/meta/predicate.hpp"
#include "viennacl/meta/enable_if.hpp"
#include "viennacl/traits/size.hpp"
#include "viennacl/traits/start.hpp"
#include "viennacl/traits/handle.hpp"
Go to the source code of this file.
Namespaces | |
namespace | viennacl |
namespace | viennacl::linalg |
Functions | |
template<typename V1 , typename V2 , typename V3 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_vector < V2 >::value &&viennacl::is_vector< V3 > ::value >::type | add (const V1 &vec1, const V2 &vec2, V3 &result) |
Addition of two vectors. Try to use the overloaded operators for vector instead, unless you want to fine-tune the number of GPU threads involved. | |
template<typename V1 , typename V2 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_vector < V2 >::value >::type | inplace_add (V1 &vec1, const V2 &vec2) |
Inplace addition of two vectors. Try to use the overloaded operators for vector instead, unless you want to fine-tune the number of GPU threads involved. | |
template<typename V1 , typename V2 , typename V3 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_vector < V2 >::value &&viennacl::is_vector< V3 > ::value >::type | sub (const V1 &vec1, const V2 &vec2, V3 &result) |
Subtraction of two vectors. Try to use the overloaded operators for vector instead, unless you want to fine-tune the number of GPU threads involved. | |
template<typename V1 , typename V2 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_vector < V2 >::value >::type | inplace_sub (V1 &vec1, const V2 &vec2) |
Inplace addition of two vectors. Try to use the overloaded operators for vector instead, unless you want to fine-tune the number of GPU threads involved. | |
template<typename V1 , typename S2 , typename V3 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_scalar < S2 >::value &&viennacl::is_vector< V3 > ::value >::type | mult (const V1 &vec, S2 const &alpha, V3 &result) |
Scales a vector. Try to use the overloaded operators for vector instead, unless you want to fine-tune the number of GPU threads involved. | |
template<typename V1 , typename SCALARTYPE , typename V3 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_cpu_scalar < SCALARTYPE >::value &&viennacl::is_vector< V3 > ::value >::type | mult (V1 const &vec, SCALARTYPE alpha, V3 &result) |
Scales a vector. Try to use the overloaded operators for vector instead, unless you want to fine-tune the number of GPU threads involved. | |
template<typename V1 , typename S2 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_scalar < S2 >::value >::type | inplace_mult (V1 &vec, S2 const &alpha) |
Scales a vector inplace. Try to use the overloaded operators for vector instead, unless you want to fine-tune the number of GPU threads involved. | |
template<typename V1 , typename S2 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_cpu_scalar< S2 > ::value >::type | inplace_mult (V1 &vec, S2 alpha) |
Scales a vector inplace. Try to use the overloaded operators for vector instead, unless you want to fine-tune the number of GPU threads involved. | |
template<typename V1 , typename S2 , typename V3 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_scalar < S2 >::value &&viennacl::is_vector< V3 > ::value >::type | divide (V1 const &vec, S2 const &alpha, V3 &result) |
Scales a vector. Try to use the overloaded operators for vector instead, unless you want to fine-tune the number of GPU threads involved. | |
template<typename V1 , typename S2 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_scalar < S2 >::value >::type | inplace_divide (V1 &vec, S2 const &alpha) |
Scales a vector inplace. Try to use the overloaded operators for vector instead, unless you want to fine-tune the number of GPU threads involved. | |
template<typename V1 , typename S2 , typename V3 , typename V4 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_scalar < S2 >::value &&viennacl::is_vector< V3 > ::value &&viennacl::is_vector < V4 >::value >::type | mul_add (V1 const &vec1, S2 const &alpha, V3 const &vec2, V4 &result) |
Multiply-add operation. Try to use the overloaded operators for vector instead, unless you want to fine-tune the number of GPU threads involved. | |
template<typename V1 , typename SCALARTYPE , typename V3 , typename V4 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_cpu_scalar < SCALARTYPE >::value &&viennacl::is_vector< V3 > ::value &&viennacl::is_vector < V4 >::value >::type | mul_add (V1 const &vec1, SCALARTYPE alpha, V3 const &vec2, V4 &result) |
Multiply-add operation. Try to use the overloaded operators for vector instead, unless you want to fine-tune the number of GPU threads involved. | |
template<typename V1 , typename V2 , typename S3 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_vector < V2 >::value &&viennacl::is_scalar< S3 > ::value >::type | inplace_mul_add (V1 &vec1, V2 const &vec2, S3 const &alpha) |
Inplace Multiply-add operation. Try to use the overloaded operators for vector instead, unless you want to fine-tune the number of GPU threads involved. | |
template<typename V1 , typename V2 , typename SCALARTYPE > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_vector < V2 >::value &&viennacl::is_cpu_scalar < SCALARTYPE >::value >::type | inplace_mul_add (V1 &vec1, V2 const &vec2, SCALARTYPE alpha) |
Inplace Multiply-add operation. Try to use the overloaded operators for vector instead, unless you want to fine-tune the number of GPU threads involved. | |
template<typename V1 , typename S2 , typename V3 , typename V4 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_scalar < S2 >::value &&viennacl::is_vector< V3 > ::value &&viennacl::is_vector < V4 >::value >::type | mul_sub (V1 const &vec1, S2 const &alpha, V3 const &vec2, V4 &result) |
Multiply-subtract operation. Try to use the overloaded operators for vector instead, unless you want to fine-tune the number of GPU threads involved. | |
template<typename V1 , typename V2 , typename S3 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_vector < V2 >::value &&viennacl::is_scalar< S3 > ::value >::type | inplace_mul_sub (V1 &vec1, V2 const &vec2, S3 const &alpha) |
Inplace Multiply-subtract operation. Try to use the overloaded operators for vector instead, unless you want to fine-tune the number of GPU threads involved. | |
template<typename V1 , typename V2 , typename S3 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_vector < V2 >::value &&viennacl::is_scalar< S3 > ::value >::type | inplace_div_add (V1 &vec1, V2 const &vec2, S3 const &alpha) |
Inplace divide-add operation. Try to use the overloaded operators for vector instead, unless you want to fine-tune the number of GPU threads involved. | |
template<typename V1 , typename V2 , typename S3 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_vector < V2 >::value &&viennacl::is_scalar< S3 > ::value >::type | inplace_div_sub (V1 &vec1, V2 const &vec2, S3 const &alpha) |
Inplace divide-subtract operation. Try to use the overloaded operators for vector instead, unless you want to fine-tune the number of GPU threads involved. | |
template<typename V1 , typename V2 , typename S3 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_vector < V2 >::value &&viennacl::is_scalar< S3 > ::value >::type | inner_prod_impl (V1 const &vec1, V2 const &vec2, S3 &result) |
Computes the inner product of two vectors - implementation. Library users should call inner_prod(vec1, vec2). | |
template<typename V1 , typename V2 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_vector < V2 >::value, viennacl::scalar_expression < const V1, const V2, viennacl::op_inner_prod > >::type | inner_prod_impl (V1 const &vec1, V2 const &vec2) |
Computes the inner product of two vectors. | |
template<typename V1 , typename S2 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_scalar < S2 >::value >::type | norm_1_impl (V1 const &vec, S2 &result) |
Computes the l^1-norm of a vector. | |
template<typename V1 , typename S2 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_scalar < S2 >::value >::type | norm_2_impl (V1 const &vec, S2 &result) |
Computes the l^2-norm of a vector - implementation. | |
template<typename V1 , typename S2 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_scalar < S2 >::value >::type | norm_inf_impl (V1 const &vec, S2 &result) |
Computes the supremum-norm of a vector. | |
template<typename V1 > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value, cl_uint >::type | index_norm_inf (V1 const &vec) |
Computes the index of the first entry that is equal to the supremum-norm in modulus. | |
template<typename V1 , typename V2 , typename SCALARTYPE > | |
viennacl::enable_if < viennacl::is_vector< V1 > ::value &&viennacl::is_vector < V2 >::value &&viennacl::is_cpu_scalar < SCALARTYPE >::value >::type | plane_rotation (V1 &vec1, V2 &vec2, SCALARTYPE alpha, SCALARTYPE beta) |
Computes a plane rotation of two vectors. |
Implementations of vector operations.