Discontinuous Galerkin Library
#include "dg/algorithm.h"
|
\( f( x_{0i}, x_{1i}, x_{2i}, ...) \) and \( x^T y\) More...
Namespaces | |
namespace | dg::blas1 |
BLAS Level 1 routines. | |
Functions | |
template<class ContainerType1 , class ContainerType2 > | |
get_value_type< ContainerType1 > | dg::blas1::dot (const ContainerType1 &x, const ContainerType2 &y) |
\( x^T y\) Binary reproducible Euclidean dot product between two vectors More... | |
template<class ContainerType , class OutputType , class BinaryOp , class UnaryOp = IDENTITY> | |
OutputType | dg::blas1::reduce (const ContainerType &x, OutputType zero, BinaryOp binary_op, UnaryOp unary_op=UnaryOp()) |
\( f(x_0) \otimes f(x_1) \otimes \dots \otimes f(x_{N-1}) \) Custom (transform) reduction More... | |
template<class ContainerTypeIn , class ContainerTypeOut > | |
void | dg::blas1::copy (const ContainerTypeIn &source, ContainerTypeOut &target) |
\( y=x \) More... | |
template<class ContainerType > | |
void | dg::blas1::scal (ContainerType &x, get_value_type< ContainerType > alpha) |
\( x = \alpha x\) More... | |
template<class ContainerType > | |
void | dg::blas1::plus (ContainerType &x, get_value_type< ContainerType > alpha) |
\( x = x + \alpha \) More... | |
template<class ContainerType , class ContainerType1 > | |
void | dg::blas1::axpby (get_value_type< ContainerType > alpha, const ContainerType1 &x, get_value_type< ContainerType > beta, ContainerType &y) |
\( y = \alpha x + \beta y\) More... | |
template<class ContainerType , class ContainerType1 , class ContainerType2 > | |
void | dg::blas1::axpbypgz (get_value_type< ContainerType > alpha, const ContainerType1 &x, get_value_type< ContainerType > beta, const ContainerType2 &y, get_value_type< ContainerType > gamma, ContainerType &z) |
\( z = \alpha x + \beta y + \gamma z\) More... | |
template<class ContainerType , class ContainerType1 , class ContainerType2 > | |
void | dg::blas1::axpby (get_value_type< ContainerType > alpha, const ContainerType1 &x, get_value_type< ContainerType > beta, const ContainerType2 &y, ContainerType &z) |
\( z = \alpha x + \beta y\) More... | |
template<class ContainerType , class ContainerType1 , class ContainerType2 > | |
void | dg::blas1::pointwiseDot (get_value_type< ContainerType > alpha, const ContainerType1 &x1, const ContainerType2 &x2, get_value_type< ContainerType > beta, ContainerType &y) |
\( y = \alpha x_1 x_2 + \beta y\) More... | |
template<class ContainerType , class ContainerType1 , class ContainerType2 > | |
void | dg::blas1::pointwiseDot (const ContainerType1 &x1, const ContainerType2 &x2, ContainerType &y) |
\( y = x_1 x_2 \) More... | |
template<class ContainerType , class ContainerType1 , class ContainerType2 , class ContainerType3 > | |
void | dg::blas1::pointwiseDot (get_value_type< ContainerType > alpha, const ContainerType1 &x1, const ContainerType2 &x2, const ContainerType3 &x3, get_value_type< ContainerType > beta, ContainerType &y) |
\( y = \alpha x_1 x_2 x_3 + \beta y\) More... | |
template<class ContainerType , class ContainerType1 , class ContainerType2 > | |
void | dg::blas1::pointwiseDivide (get_value_type< ContainerType > alpha, const ContainerType1 &x1, const ContainerType2 &x2, get_value_type< ContainerType > beta, ContainerType &y) |
\( y = \alpha x_1/ x_2 + \beta y \) More... | |
template<class ContainerType , class ContainerType1 , class ContainerType2 > | |
void | dg::blas1::pointwiseDivide (const ContainerType1 &x1, const ContainerType2 &x2, ContainerType &y) |
\( y = x_1/ x_2\) More... | |
template<class ContainerType , class ContainerType1 , class ContainerType2 , class ContainerType3 , class ContainerType4 > | |
void | dg::blas1::pointwiseDot (get_value_type< ContainerType > alpha, const ContainerType1 &x1, const ContainerType2 &y1, get_value_type< ContainerType > beta, const ContainerType3 &x2, const ContainerType4 &y2, get_value_type< ContainerType > gamma, ContainerType &z) |
\( z = \alpha x_1y_1 + \beta x_2y_2 + \gamma z\) More... | |
template<class ContainerType , class ContainerType1 , class UnaryOp > | |
void | dg::blas1::transform (const ContainerType1 &x, ContainerType &y, UnaryOp op) |
\( y = op(x)\) More... | |
template<class ContainerType , class BinarySubroutine , class Functor , class ContainerType0 , class ... ContainerTypes> | |
void | dg::blas1::evaluate (ContainerType &y, BinarySubroutine f, Functor g, const ContainerType0 &x0, const ContainerTypes &...xs) |
\( f(g(x_0,x_1,...), y)\) More... | |
template<class Subroutine , class ContainerType , class ... ContainerTypes> | |
void | dg::blas1::subroutine (Subroutine f, ContainerType &&x, ContainerTypes &&... xs) |
\( f(x_0, x_1, ...)\); Customizable and generic blas1 function More... | |
\( f( x_{0i}, x_{1i}, x_{2i}, ...) \) and \( x^T y\)
|
inline |
\( z = \alpha x + \beta y\)
This routine computes
\[ z_i = \alpha x_i + \beta y_i \]
where i
iterates over all elements inside the given vectors. The order of iterations is undefined. Scalar arguments to container types are interpreted as vectors with all elements constant. If ContainerType
has the RecursiveVectorTag
, i
recursively loops over all entries. If the vector sizes do not match, the result is undefined. The compiler chooses the implementation and parallelization of this function based on given template parameters. For a full set of rules please refer to The dg dispatch system.
alpha | Scalar |
x | ContainerType x may alias z |
beta | Scalar |
y | ContainerType y may alias z |
z | (write-only) ContainerType z contains solution on output |
dg::blas1::scal( y, 0 )
does not remove NaN or Inf from y while dg::blas1::copy( 0, y )
does.ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
ContainerTypes in the argument list, then TensorTraits must exist for all of them |
|
inline |
\( y = \alpha x + \beta y\)
This routine computes
\[ y_i = \alpha x_i + \beta y_i \]
where i
iterates over all elements inside the given vectors. The order of iterations is undefined. Scalar arguments to container types are interpreted as vectors with all elements constant. If ContainerType
has the RecursiveVectorTag
, i
recursively loops over all entries. If the vector sizes do not match, the result is undefined. The compiler chooses the implementation and parallelization of this function based on given template parameters. For a full set of rules please refer to The dg dispatch system.
alpha | Scalar |
x | ContainerType x may alias y |
beta | Scalar |
y | (read/write) ContainerType y contains solution on output |
dg::blas1::scal( y, 0 )
does not remove NaN or Inf from y while dg::blas1::copy( 0, y )
does.ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
ContainerTypes in the argument list, then TensorTraits must exist for all of them |
|
inline |
\( z = \alpha x + \beta y + \gamma z\)
This routine computes
\[ z_i = \alpha x_i + \beta y_i + \gamma z_i \]
where i
iterates over all elements inside the given vectors. The order of iterations is undefined. Scalar arguments to container types are interpreted as vectors with all elements constant. If ContainerType
has the RecursiveVectorTag
, i
recursively loops over all entries. If the vector sizes do not match, the result is undefined. The compiler chooses the implementation and parallelization of this function based on given template parameters. For a full set of rules please refer to The dg dispatch system.
alpha | Scalar |
x | ContainerType x may alias result |
beta | Scalar |
y | ContainerType y may alias result |
gamma | Scalar |
z | (read/write) ContainerType contains solution on output |
dg::blas1::scal( y, 0 )
does not remove NaN or Inf from y while dg::blas1::copy( 0, y )
does.ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
ContainerTypes in the argument list, then TensorTraits must exist for all of them |
|
inline |
\( y=x \)
explicit pointwise assignment \( y_i = x_i\)
where i
iterates over all elements inside the given vectors. The order of iterations is undefined. Scalar arguments to container types are interpreted as vectors with all elements constant. If ContainerType
has the RecursiveVectorTag
, i
recursively loops over all entries. If the vector sizes do not match, the result is undefined. The compiler chooses the implementation and parallelization of this function based on given template parameters. For a full set of rules please refer to The dg dispatch system.
source | vector to copy |
target | (write-only) destination |
dg::assign
functions the copy
function uses the execution policy to determine the implementation and thus works only on types with same execution policy dg::blas1::scal( y, 0 )
does not remove NaN or Inf from y while dg::blas1::copy( 0, y )
does.ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
ContainerTypes in the argument list, then TensorTraits must exist for all of them |
|
inline |
\( x^T y\) Binary reproducible Euclidean dot product between two vectors
This routine computes
\[ x^T y = \sum_{i=0}^{N-1} x_i y_i \]
where i
iterates over all elements inside the given vectors. The order of iterations is undefined. Scalar arguments to container types are interpreted as vectors with all elements constant. If ContainerType
has the RecursiveVectorTag
, i
recursively loops over all entries. If the vector sizes do not match, the result is undefined. The compiler chooses the implementation and parallelization of this function based on given template parameters. For a full set of rules please refer to The dg dispatch system.
For example
Inf
or NaN
or the product of the input numbers reaches Inf
or Nan
then the behaviour is undefined and the function may throw. See dg::ISNFINITE and dg::ISNSANE in that case dg::exblas
library and works for single and double precision.x | Left Container |
y | Right Container may alias x |
ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
ContainerTypes in the argument list, then TensorTraits must exist for all of them |
|
inline |
\( f(g(x_0,x_1,...), y)\)
This routine elementwise evaluates
\[ f(g(x_{0i}, x_{1i}, ...), y_i) \]
where i
iterates over all elements inside the given vectors. The order of iterations is undefined. Scalar arguments to container types are interpreted as vectors with all elements constant. If ContainerType
has the RecursiveVectorTag
, i
recursively loops over all entries. If the vector sizes do not match, the result is undefined. The compiler chooses the implementation and parallelization of this function based on given template parameters. For a full set of rules please refer to The dg dispatch system.
BinarySubroutine | Functor with signature: void ( value_type_g, value_type_y&) i.e. it reads the first (and second) and writes into the second argument |
Functor | signature: value_type_g operator()( value_type_x0, value_type_x1, ...) |
BinarySubroutine
and Functor
must be callable on the device in use. In particular, with CUDA they must be functor tpyes (not functions) and their signatures must contain the __device__ specifier. (s.a. DG_DEVICE) y | contains result |
f | The subroutine, for example dg::equals or dg::plus_equals , see dg::blas1::evaluate binary operators for a collection of predefined functors to use here |
g | The functor to evaluate, see A large collection and dg::blas1::evaluate variadic functors for a collection of predefined functors to use here |
x0 | first input |
xs | more input |
dg::blas1::scal( y, 0 )
does not remove NaN or Inf from y while dg::blas1::copy( 0, y )
does.ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
ContainerTypes in the argument list, then TensorTraits must exist for all of them |
|
inline |
\( x = x + \alpha \)
This routine computes
\[ x_i + \alpha \]
where i
iterates over all elements inside the given vectors. The order of iterations is undefined. Scalar arguments to container types are interpreted as vectors with all elements constant. If ContainerType
has the RecursiveVectorTag
, i
recursively loops over all entries. If the vector sizes do not match, the result is undefined. The compiler chooses the implementation and parallelization of this function based on given template parameters. For a full set of rules please refer to The dg dispatch system.
alpha | Scalar |
x | (read/write) x |
dg::blas1::scal( y, 0 )
does not remove NaN or Inf from y while dg::blas1::copy( 0, y )
does.ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
ContainerTypes in the argument list, then TensorTraits must exist for all of them |
|
inline |
\( y = x_1/ x_2\)
Divides two vectors element by element:
\[ y_i = x_{1i}/x_{2i}\]
where i
iterates over all elements inside the given vectors. The order of iterations is undefined. Scalar arguments to container types are interpreted as vectors with all elements constant. If ContainerType
has the RecursiveVectorTag
, i
recursively loops over all entries. If the vector sizes do not match, the result is undefined. The compiler chooses the implementation and parallelization of this function based on given template parameters. For a full set of rules please refer to The dg dispatch system.
x1 | ContainerType x1 |
x2 | ContainerType x2 may alias x1 |
y | (write-only) ContainerType y contains result on output ( may alias x1 and/or x2) |
dg::blas1::scal( y, 0 )
does not remove NaN or Inf from y while dg::blas1::copy( 0, y )
does.ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
ContainerTypes in the argument list, then TensorTraits must exist for all of them |
|
inline |
\( y = \alpha x_1/ x_2 + \beta y \)
Divides two vectors element by element:
\[ y_i = \alpha x_{1i}/x_{2i} + \beta y_i \]
where i
iterates over all elements inside the given vectors. The order of iterations is undefined. Scalar arguments to container types are interpreted as vectors with all elements constant. If ContainerType
has the RecursiveVectorTag
, i
recursively loops over all entries. If the vector sizes do not match, the result is undefined. The compiler chooses the implementation and parallelization of this function based on given template parameters. For a full set of rules please refer to The dg dispatch system.
alpha | scalar |
x1 | ContainerType x1 |
x2 | ContainerType x2 may alias x1 |
beta | scalar |
y | (read/write) ContainerType y contains result on output ( may alias x1 and/or x2) |
dg::blas1::scal( y, 0 )
does not remove NaN or Inf from y while dg::blas1::copy( 0, y )
does.ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
ContainerTypes in the argument list, then TensorTraits must exist for all of them |
|
inline |
\( y = x_1 x_2 \)
Multiplies two vectors element by element:
\[ y_i = x_{1i}x_{2i}\]
where i
iterates over all elements inside the given vectors. The order of iterations is undefined. Scalar arguments to container types are interpreted as vectors with all elements constant. If ContainerType
has the RecursiveVectorTag
, i
recursively loops over all entries. If the vector sizes do not match, the result is undefined. The compiler chooses the implementation and parallelization of this function based on given template parameters. For a full set of rules please refer to The dg dispatch system.
x1 | ContainerType x1 |
x2 | ContainerType x2 may alias x1 |
y | (write-only) ContainerType y contains result on output ( may alias x1 or x2) |
dg::blas1::scal( y, 0 )
does not remove NaN or Inf from y while dg::blas1::copy( 0, y )
does.ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
ContainerTypes in the argument list, then TensorTraits must exist for all of them |
|
inline |
\( y = \alpha x_1 x_2 x_3 + \beta y\)
Multiplies three vectors element by element:
\[ y_i = \alpha x_{1i}x_{2i}x_{3i} + \beta y_i\]
where i
iterates over all elements inside the given vectors. The order of iterations is undefined. Scalar arguments to container types are interpreted as vectors with all elements constant. If ContainerType
has the RecursiveVectorTag
, i
recursively loops over all entries. If the vector sizes do not match, the result is undefined. The compiler chooses the implementation and parallelization of this function based on given template parameters. For a full set of rules please refer to The dg dispatch system.
alpha | scalar |
x1 | ContainerType x1 |
x2 | ContainerType x2 may alias x1 |
x3 | ContainerType x3 may alias x1 and/or x2 |
beta | scalar |
y | (read/write) ContainerType y contains result on output ( may alias x1,x2 or x3) |
dg::blas1::scal( y, 0 )
does not remove NaN or Inf from y while dg::blas1::copy( 0, y )
does.ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
ContainerTypes in the argument list, then TensorTraits must exist for all of them |
|
inline |
\( y = \alpha x_1 x_2 + \beta y\)
Multiplies two vectors element by element:
\[ y_i = \alpha x_{1i}x_{2i} + \beta y_i\]
where i
iterates over all elements inside the given vectors. The order of iterations is undefined. Scalar arguments to container types are interpreted as vectors with all elements constant. If ContainerType
has the RecursiveVectorTag
, i
recursively loops over all entries. If the vector sizes do not match, the result is undefined. The compiler chooses the implementation and parallelization of this function based on given template parameters. For a full set of rules please refer to The dg dispatch system.
alpha | scalar |
x1 | ContainerType x1 |
x2 | ContainerType x2 may alias x1 |
beta | scalar |
y | (read/write) ContainerType y contains result on output ( may alias x1 or x2) |
dg::blas1::scal( y, 0 )
does not remove NaN or Inf from y while dg::blas1::copy( 0, y )
does.ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
ContainerTypes in the argument list, then TensorTraits must exist for all of them |
void dg::blas1::pointwiseDot | ( | get_value_type< ContainerType > | alpha, |
const ContainerType1 & | x1, | ||
const ContainerType2 & | y1, | ||
get_value_type< ContainerType > | beta, | ||
const ContainerType3 & | x2, | ||
const ContainerType4 & | y2, | ||
get_value_type< ContainerType > | gamma, | ||
ContainerType & | z | ||
) |
\( z = \alpha x_1y_1 + \beta x_2y_2 + \gamma z\)
Multiplies and adds vectors element by element:
\[ z_i = \alpha x_{1i}y_{1i} + \beta x_{2i}y_{2i} + \gamma z_i \]
where i
iterates over all elements inside the given vectors. The order of iterations is undefined. Scalar arguments to container types are interpreted as vectors with all elements constant. If ContainerType
has the RecursiveVectorTag
, i
recursively loops over all entries. If the vector sizes do not match, the result is undefined. The compiler chooses the implementation and parallelization of this function based on given template parameters. For a full set of rules please refer to The dg dispatch system.
alpha | scalar |
x1 | ContainerType x1 |
y1 | ContainerType y1 |
beta | scalar |
x2 | ContainerType x2 |
y2 | ContainerType y2 |
gamma | scalar |
z | (read/write) ContainerType z contains result on output |
dg::blas1::scal( y, 0 )
does not remove NaN or Inf from y while dg::blas1::copy( 0, y )
does.ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
ContainerTypes in the argument list, then TensorTraits must exist for all of them |
|
inline |
\( f(x_0) \otimes f(x_1) \otimes \dots \otimes f(x_{N-1}) \) Custom (transform) reduction
This routine computes
\[ s = f(x_0) \otimes f(x_1) \otimes \dots \otimes f(x_i) \otimes \dots \otimes f(x_{N-1}) \]
where \( \otimes \) is an arbitrary commutative and associative binary operator, \( f\) is an optional unary operator and
where i
iterates over all elements inside the given vectors. The order of iterations is undefined. Scalar arguments to container types are interpreted as vectors with all elements constant. If ContainerType
has the RecursiveVectorTag
, i
recursively loops over all entries. If the vector sizes do not match, the result is undefined. The compiler chooses the implementation and parallelization of this function based on given template parameters. For a full set of rules please refer to The dg dispatch system.
For example
x | Container to reduce |
zero | The neutral element with respect to binary_op that is x == binary_op( zero, x) . Determines the OutputType so make sure to make the type clear to the compiler (e.g. write (double)0 instead of 0 if you want double output) |
zero
is used to initialize partial sums e.g. when reducing MPI Vectors so it is important that zero
is actually the neutral element. The reduction will yield wrong results if it is not. binary_op | an associative and commutative binary operator |
unary_op | a unary operator applies to each element of x |
BinaryOp | Functor with signature: value_type operator()(
value_type, value_type) , must be associative and commutative. value_tpye must be compatible with OutputType |
UnaryOp | a unary operator. The argument type must be compatible with get_value_type<ContainerType> . The return type must be convertible to OutputType |
OutputType | The type of the result. Infered from zero so make sure zero's type is clear to the compiler. |
ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
ContainerTypes in the argument list, then TensorTraits must exist for all of them |
|
inline |
\( x = \alpha x\)
This routine computes
\[ \alpha x_i \]
where i
iterates over all elements inside the given vectors. The order of iterations is undefined. Scalar arguments to container types are interpreted as vectors with all elements constant. If ContainerType
has the RecursiveVectorTag
, i
recursively loops over all entries. If the vector sizes do not match, the result is undefined. The compiler chooses the implementation and parallelization of this function based on given template parameters. For a full set of rules please refer to The dg dispatch system.
alpha | Scalar |
x | (read/write) x |
dg::blas1::scal( y, 0 )
does not remove NaN or Inf from y while dg::blas1::copy( 0, y )
does.ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
ContainerTypes in the argument list, then TensorTraits must exist for all of them |
|
inline |
\( f(x_0, x_1, ...)\); Customizable and generic blas1 function
This routine evaluates an arbitrary user-defined subroutine f
with an arbitrary number of arguments \( x_s\) elementwise
\[ f(x_{0i}, x_{1i}, ...) \]
where i
iterates over all elements inside the given vectors. The order of iterations is undefined. Scalar arguments to container types are interpreted as vectors with all elements constant. If ContainerType
has the RecursiveVectorTag
, i
recursively loops over all entries. If the vector sizes do not match, the result is undefined. The compiler chooses the implementation and parallelization of this function based on given template parameters. For a full set of rules please refer to The dg dispatch system.
f | the subroutine, see dg::blas1::subroutine subroutines for a collection of predefind subroutines to use here |
x | the first argument |
xs | other arguments |
blas1
functions except the scalar product, which is not trivially parallel. Subroutine | a function or functor with an arbitrary number of arguments and no return type; taking a value_type argument for each input argument in the call and a value_type& argument for each output argument. Subroutine must be callable on the device in use. In particular, with CUDA it must be a functor (not a function) and its signature must contain the __device__ specifier. (s.a. DG_DEVICE) |
dg::blas1::scal( y, 0 )
does not remove NaN or Inf from y while dg::blas1::copy( 0, y )
does.ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
ContainerTypes in the argument list, then TensorTraits must exist for all of them |
|
inline |
\( y = op(x)\)
This routine computes
\[ y_i = op(x_i) \]
where i
iterates over all elements inside the given vectors. The order of iterations is undefined. Scalar arguments to container types are interpreted as vectors with all elements constant. If ContainerType
has the RecursiveVectorTag
, i
recursively loops over all entries. If the vector sizes do not match, the result is undefined. The compiler chooses the implementation and parallelization of this function based on given template parameters. For a full set of rules please refer to The dg dispatch system.
x | ContainerType x may alias y |
y | (write-only) ContainerType y contains result, may alias x |
op | unary Operator to use on every element |
UnaryOp | Functor with signature: value_type operator()( value_type) |
UnaryOp
must be callable on the device in use. In particular, with CUDA it must be of functor tpye (not a function) and its signatures must contain the __device__ specifier. (s.a. DG_DEVICE)dg::blas1::scal( y, 0 )
does not remove NaN or Inf from y while dg::blas1::copy( 0, y )
does.ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
ContainerTypes in the argument list, then TensorTraits must exist for all of them |