Ginkgo  Generated from pipelines/3133041809 branch based on develop. Ginkgo version 2.0.0
A numerical linear algebra library targeting many-core architectures
Public Types | Public Member Functions | Static Public Member Functions | List of all members
gko::EnableMultiVector< ConcreteType > Class Template Referenceabstract

Mixin class to simplify the implementation of the AbstractMultiVector interface. More...

#include <ginkgo/core/base/multivector_mixin.hpp>

Inheritance diagram for gko::EnableMultiVector< ConcreteType >:
[legend]
Collaboration diagram for gko::EnableMultiVector< ConcreteType >:
[legend]

Public Types

using traits = vector_traits< ConcreteType >
 The traits providing the types related to ConcreteType.
 
using value_type = typename traits::value_type
 The value type of the stored elements.
 
using absolute_value_type = typename traits::absolute_value_type
 The real counterpart of value_type.
 
using absolute_type = typename traits::absolute_type
 The vector type holding absolute values of this vector.
 
using real_type = typename traits::real_type
 The vector type holding real or imaginary parts of this vector.
 
using complex_type = typename traits::complex_type
 The vector type holding a complex version of this vector.
 
using result_type = ConcreteType
 The target type of the conversions provided by this mixin.
 
using norm_type = matrix::MultiVector< absolute_value_type >
 The vector type used to store the results of reductions to norms.
 
using device_view = AbstractMultiVector::device_view< value_type >
 The mutable device view type of the local data.
 
using const_device_view = AbstractMultiVector::device_view< const value_type >
 The immutable device view type of the local data.
 
- Public Types inherited from gko::AbstractMultiVector
template<typename ValueType >
using device_view = matrix::view::dense< ValueType >
 
- Public Types inherited from gko::ConvertibleTo< ConcreteType >
using result_type = ConcreteType
 

Public Member Functions

std::unique_ptr< ConcreteType > clone (std::shared_ptr< const Executor > exec) const
 
std::unique_ptr< ConcreteType > clone () const
 Creates a copy of this vector on the given executor. More...
 
ConcreteType * copy_from (ptr_param< const ConcreteType > other)
 
ConcreteType * move_from (ptr_param< ConcreteType > other)
 Moves the data of other into this vector. More...
 
std::unique_ptr< ConcreteType > create_default () const
 Creates an empty vector with the same type as this vector on the given executor. More...
 
std::unique_ptr< ConcreteType > create_default (std::shared_ptr< const Executor > exec) const
 
std::unique_ptr< ConcreteType > create_subview (local_span rows, local_span columns)
 Creates a view containing the selected local rows and columns. More...
 
std::unique_ptr< const ConcreteType > create_subview (local_span rows, local_span columns) const
 Creates a view containing the selected local rows and columns. More...
 
std::unique_ptr< ConcreteType > create_subview (local_span rows, local_span columns, dim< 2 > global_size)
 Creates a view containing the selected local rows and columns. More...
 
std::unique_ptr< const ConcreteType > create_subview (local_span rows, local_span columns, dim< 2 > global_size) const
 Creates a view containing the selected local rows and columns. More...
 
std::unique_ptr< const real_type > create_real_view () const
 Create a real view of the (potentially) complex original multi-vector. More...
 
std::unique_ptr< real_type > create_real_view ()
 Create a real view of the (potentially) complex original multi-vector. More...
 
std::unique_ptr< absolute_type > compute_absolute () const
 Creates a new vector with the element-wise absolute values of this vector. More...
 
void compute_absolute (ptr_param< absolute_type > output) const
 
std::unique_ptr< complex_type > make_complex () const
 Creates a complex copy of this vector. More...
 
void make_complex (ptr_param< complex_type > output) const
 
std::unique_ptr< real_type > get_real () const
 Creates a new real vector with the real parts of this vector. More...
 
void get_real (ptr_param< real_type > output) const
 
std::unique_ptr< real_type > get_imag () const
 Creates a new real vector with the imaginary parts of this vector. More...
 
void get_imag (ptr_param< real_type > output) const
 
void convert_to (result_type *result) const override
 
void move_to (result_type *result) override
 Converts the implementer to an object of type result_type by moving data from this object. More...
 
device_view get_local_device_view ()
 Gets a local device view of this vector. More...
 
const_device_view get_const_local_device_view () const
 Gets a local device view of this vector. More...
 
template<typename ValueType >
device_view< const ValueType > get_const_local_device_view () const
 Gets a local device view of this vector. More...
 
template<typename ValueType >
device_view< ValueType > get_local_device_view ()
 Gets a local device view of this vector for the specified value type. More...
 
- Public Member Functions inherited from gko::AbstractMultiVector
std::unique_ptr< AbstractMultiVector > clone (std::shared_ptr< const Executor > exec) const
 Creates a copy of this vector on the given executor. More...
 
std::unique_ptr< AbstractMultiVector > clone () const
 Creates a copy of this vector on this vector's executor. More...
 
AbstractMultiVector * copy_from (ptr_param< const AbstractMultiVector > other)
 Copies the data of other into this vector. More...
 
AbstractMultiVector * move_from (ptr_param< AbstractMultiVector > other)
 Moves the data of other into this vector. More...
 
std::unique_ptr< AbstractMultiVector > create_default (std::shared_ptr< const Executor > exec) const
 Creates an empty vector with the same type as this vector on the given executor. More...
 
std::unique_ptr< AbstractMultiVector > create_default () const
 Creates an empty vector with the same type as this vector on this vector's executor. More...
 
std::unique_ptr< AbstractMultiVector > compute_absolute () const
 Creates a new vector with the element-wise absolute values of this vector. More...
 
void compute_absolute (ptr_param< AbstractMultiVector > output) const
 Writes the element-wise absolute values of this vector into output. More...
 
void compute_absolute_inplace ()
 Replaces each element of this vector with its absolute value. More...
 
std::unique_ptr< AbstractMultiVector > make_complex () const
 Creates a complex copy of this vector. More...
 
void make_complex (ptr_param< AbstractMultiVector > result) const
 Writes a complex copy of this vector into result. More...
 
std::unique_ptr< AbstractMultiVector > get_real () const
 Creates a new real vector with the real parts of this vector. More...
 
void get_real (ptr_param< AbstractMultiVector > result) const
 Writes the real parts of this vector into result. More...
 
std::unique_ptr< AbstractMultiVector > get_imag () const
 Creates a new real vector with the imaginary parts of this vector. More...
 
void get_imag (ptr_param< AbstractMultiVector > result) const
 Writes the imaginary parts of this vector into result. More...
 
void fill (any_scalar value)
 Fills this vector with a single value. More...
 
void scale (ptr_param< const AbstractMultiVector > alpha)
 Scales this multi-vector element-wise by alpha. More...
 
void inv_scale (ptr_param< const AbstractMultiVector > alpha)
 Divides this multi-vector element-wise by alpha. More...
 
void add_scaled (ptr_param< const AbstractMultiVector > alpha, ptr_param< const AbstractMultiVector > b)
 Adds b scaled by alpha to this (aka: BLAS axpy). More...
 
void sub_scaled (ptr_param< const AbstractMultiVector > alpha, ptr_param< const AbstractMultiVector > b)
 Subtracts b scaled by alpha from this (aka: BLAS axpy). More...
 
void compute_dot (ptr_param< const AbstractMultiVector > b, ptr_param< AbstractMultiVector > result) const
 Computes the column-wise dot product of this and b. More...
 
void compute_dot (ptr_param< const AbstractMultiVector > b, ptr_param< AbstractMultiVector > result, array< char > &tmp) const
 Computes the column-wise dot product of this and b. More...
 
void compute_conj_dot (ptr_param< const AbstractMultiVector > b, ptr_param< AbstractMultiVector > result) const
 Computes the column-wise dot product of conj(this) and b. More...
 
void compute_conj_dot (ptr_param< const AbstractMultiVector > b, ptr_param< AbstractMultiVector > result, array< char > &tmp) const
 Computes the column-wise dot product of conj(this) and b. More...
 
void compute_norm2 (ptr_param< AbstractMultiVector > result) const
 Computes the column-wise Euclidean (L^2) norm of this. More...
 
void compute_norm2 (ptr_param< AbstractMultiVector > result, array< char > &tmp) const
 Computes the column-wise Euclidean (L^2) norm of this. More...
 
void compute_squared_norm2 (ptr_param< AbstractMultiVector > result) const
 Computes the square of the column-wise Euclidean (L^2) norm of this. More...
 
void compute_squared_norm2 (ptr_param< AbstractMultiVector > result, array< char > &tmp) const
 Computes the square of the column-wise Euclidean (L^2) norm of this. More...
 
void compute_norm1 (ptr_param< AbstractMultiVector > result) const
 Computes the column-wise (L^1) norm of this. More...
 
void compute_norm1 (ptr_param< AbstractMultiVector > result, array< char > &tmp) const
 Computes the column-wise (L^1) norm of this. More...
 
std::unique_ptr< const AbstractMultiVector > create_real_view () const
 Create a real view of the (potentially) complex original multi-vector. More...
 
std::unique_ptr< AbstractMultiVector > create_real_view ()
 Create a real view of the (potentially) complex original multi-vector. More...
 
std::unique_ptr< AbstractMultiVector > create_subview (local_span rows, local_span columns)
 Creates a view containing the selected local rows and columns. More...
 
std::unique_ptr< const AbstractMultiVector > create_subview (local_span rows, local_span columns) const
 Creates a const view containing the selected local rows and columns. More...
 
std::unique_ptr< AbstractMultiVector > create_subview (local_span rows, local_span columns, dim< 2 > global_size)
 Creates a view with the selected rows, columns, and global size.
 
std::unique_ptr< const AbstractMultiVector > create_subview (local_span rows, local_span columns, dim< 2 > global_size) const
 Creates a const view with the selected rows, columns, and global size.
 
template<typename ValueType >
device_view< ValueType > get_local_device_view ()
 Gets a local device view of this vector for the specified value type. More...
 
template<typename ValueType >
device_view< const ValueType > get_const_local_device_view () const
 Gets a local device view of this vector for the specified value type. More...
 
temporary_conversion< AbstractMultiVector > as_precision (precision p)
 Creates a temporary conversion of this vector with another precision. More...
 
temporary_conversion< AbstractMultiVector > as_precision (ptr_param< const AbstractMultiVector > p)
 Creates a temporary conversion of this vector with another precision. More...
 
temporary_conversion< const AbstractMultiVector > as_precision (precision p) const
 Creates a temporary conversion of this vector with another precision. More...
 
temporary_conversion< const AbstractMultiVector > as_precision (ptr_param< const AbstractMultiVector > p) const
 Creates a temporary conversion of this vector with another precision. More...
 
precision get_precision () const noexcept
 Gets the precision of this vector. More...
 
dim< 2 > get_size () const noexcept
 Gets the size (number of rows and columns) of this vector. More...
 
dim< 2 > get_local_size () const noexcept
 Gets the size (number of rows and columns) locally owned by this vector. More...
 
 AbstractMultiVector (const AbstractMultiVector &other)
 
 AbstractMultiVector (AbstractMultiVector &&other) noexcept
 
AbstractMultiVector & operator= (const AbstractMultiVector &other)
 Copies the contents of another multi-vector. More...
 
AbstractMultiVector & operator= (AbstractMultiVector &&other) noexcept
 Moves the contents of another multi-vector. More...
 
- Public Member Functions inherited from gko::PolymorphicObject
virtual void validate_data () const
 Throws gko::InvalidData exception if we found the data inside the object does not fulfill certain property up to our knowledge.
 
PolymorphicObject & operator= (const PolymorphicObject &)
 
std::shared_ptr< const Executor > get_executor () const noexcept
 Returns the Executor of the object. More...
 
- Public Member Functions inherited from gko::log::EnableLogging< PolymorphicObject >
void add_logger (std::shared_ptr< const Logger > logger) override
 
void remove_logger (const Logger *logger) override
 
void remove_logger (ptr_param< const Logger > logger)
 
const std::vector< std::shared_ptr< const Logger > > & get_loggers () const override
 
void clear_loggers () override
 
- Public Member Functions inherited from gko::log::Loggable
void remove_logger (ptr_param< const Logger > logger)
 
- Public Member Functions inherited from gko::Cloneable
std::unique_ptr< Cloneable > clone (std::shared_ptr< const Executor > exec) const
 
std::unique_ptr< Cloneable > clone () const
 
Cloneable * copy_from (ptr_param< const Cloneable > other)
 
Cloneable * move_from (ptr_param< Cloneable > other)
 
std::unique_ptr< Cloneable > create_default (std::shared_ptr< const Executor > exec) const
 
std::unique_ptr< Cloneable > create_default () const
 
- Public Member Functions inherited from gko::ConvertibleTo< ConcreteType >
void convert_to (ptr_param< result_type > result) const
 
void move_to (ptr_param< result_type > result)
 

Static Public Member Functions

static std::unique_ptr< ConcreteType > create_with_config_of (ptr_param< const ConcreteType > other)
 
static std::unique_ptr< ConcreteType > create_with_type_of (ptr_param< const ConcreteType > other, std::shared_ptr< const Executor > exec)
 
static std::unique_ptr< ConcreteType > create_with_type_of (ptr_param< const ConcreteType > other, std::shared_ptr< const Executor > exec, const dim< 2 > &global_size, const dim< 2 > &local_size)
 
static std::unique_ptr< ConcreteType > create_with_type_of (ptr_param< const ConcreteType > other, std::shared_ptr< const Executor > exec, const dim< 2 > &global_size, const dim< 2 > &local_size, size_type stride)
 
- Static Public Member Functions inherited from gko::AbstractMultiVector
static std::unique_ptr< AbstractMultiVector > create_with_config_of (ptr_param< const AbstractMultiVector > other)
 Creates an empty multi-vector with the same type, executor, size, stride and precision as other. More...
 
static std::unique_ptr< AbstractMultiVector > create_with_type_of (ptr_param< const AbstractMultiVector > other, std::shared_ptr< const Executor > exec)
 Creates an empty multi-vector with the same type as other on exec. More...
 
static std::unique_ptr< AbstractMultiVector > create_with_type_of (ptr_param< const AbstractMultiVector > other, std::shared_ptr< const Executor > exec, const dim< 2 > &global_size, const dim< 2 > &local_size)
 Creates an empty multi-vector with the same type as other and the given size. More...
 
static std::unique_ptr< AbstractMultiVector > create_with_type_of (ptr_param< const AbstractMultiVector > other, std::shared_ptr< const Executor > exec, const dim< 2 > &global_size, const dim< 2 > &local_size, size_type stride)
 Creates an empty multi-vector with the same type as other and the given size and stride. More...
 

Detailed Description

template<typename ConcreteType>
class gko::EnableMultiVector< ConcreteType >

Mixin class to simplify the implementation of the AbstractMultiVector interface.

The mixin is used for the following reasons:

  1. hide functions that return AbstractMultiVector and instead return ConcreteType
  2. handle the precision dispatch such that implementors are only required to implement virtual functions with concrete types

For example the clone function returns now ConcreteType, instead of an AbstractMultiVector. This means that if the concrete type is available, it is carried through. Here is an example:

{c++}
auto vec = ConcreteType::create(...);
auto clone = vec->clone(); // clone has type ConcreteType

The mixin handles the dispatch from the abstract interface functions to the concrete overridden functions. Two dispatches happen:

  1. To the same precision as this,
  2. To the same derived type as this.

Classes using this mixin need to only implement functions with concretized arguments. Especially any precision conversion is guaranteed to be unnecessary.

For example, the interface defines abstract virtual functions, such as AbstractMultiVector::add_scaled_impl(const AbstractMultiVector* alpha, const AbstractMultiVector* b). This function is overridden (with final) here. Classes using this mixin, instead override functions with concretized arguments, such as add_scaled_impl(scaling_param<value_type> alpha, const ConcreteType* b).

If a requested combination of precisions is not supported, for example scaling a real vector by a complex factor, then the dispatch throws NotImplemented instead of forwarding to the concretized function.

Besides the concretized virtual functions, ConcreteType has to provide:

Template Parameters
ConcreteTypeMulti vector type to enable the mixin for.

Member Function Documentation

◆ clone() [1/2]

template<typename ConcreteType >
std::unique_ptr< ConcreteType > gko::EnableMultiVector< ConcreteType >::clone ( ) const

Creates a copy of this vector on the given executor.

Parameters
execThe executor of the new vector
Returns
A copy of this vector, stored on exec
Note
Returns an object with ConcreteType

◆ clone() [2/2]

template<typename ConcreteType >
std::unique_ptr< ConcreteType > gko::EnableMultiVector< ConcreteType >::clone ( std::shared_ptr< const Executor >  exec) const

Note
Returns an object with ConcreteType

◆ compute_absolute() [1/2]

template<typename ConcreteType >
std::unique_ptr< typename EnableMultiVector< ConcreteType >::absolute_type > gko::EnableMultiVector< ConcreteType >::compute_absolute ( ) const

Creates a new vector with the element-wise absolute values of this vector.

The result has the real precision matching this vector's precision, e.g. a complex_fp32 vector results in a fp32 vector.

Returns
A real vector with the absolute values of this vector
Note
Returns an object with absolute_type

◆ compute_absolute() [2/2]

template<typename ConcreteType >
void gko::EnableMultiVector< ConcreteType >::compute_absolute ( ptr_param< absolute_type >  output) const

AbstractMultiVector::compute_absolute(ptr_param<AbstractMultiVector>)

Note
Takes an object with absolute_type as output, so the precision is checked at compile time

◆ convert_to()

template<typename ConcreteType >
void gko::EnableMultiVector< ConcreteType >::convert_to ( result_type *  result) const
overridevirtual

Note
This uses the copy assignment of ConcreteType.

Implements gko::ConvertibleTo< ConcreteType >.

◆ copy_from()

template<typename ConcreteType>
ConcreteType * gko::EnableMultiVector< ConcreteType >::copy_from ( ptr_param< const ConcreteType >  other)

Note
Takes an object with ConcreteType as input

◆ create_default() [1/2]

template<typename ConcreteType >
std::unique_ptr< ConcreteType > gko::EnableMultiVector< ConcreteType >::create_default ( ) const

Creates an empty vector with the same type as this vector on the given executor.

Parameters
execThe executor of the new vector
Returns
An empty vector with the type of this vector
Note
Returns an object with ConcreteType

◆ create_default() [2/2]

template<typename ConcreteType >
std::unique_ptr< ConcreteType > gko::EnableMultiVector< ConcreteType >::create_default ( std::shared_ptr< const Executor >  exec) const

Note
Returns an object with ConcreteType

◆ create_real_view() [1/2]

template<typename ConcreteType >
std::unique_ptr< typename EnableMultiVector< ConcreteType >::real_type > gko::EnableMultiVector< ConcreteType >::create_real_view ( )

Create a real view of the (potentially) complex original multi-vector.

If the original multi-vector is real, nothing changes. If the original multi-vector is complex, the result is created by viewing the complex multi-vector with as real with a reinterpret_cast with twice the number of columns and double the stride.

Note
Returns an object with real_type
Returns an object with real_type

◆ create_real_view() [2/2]

template<typename ConcreteType >
std::unique_ptr< const typename EnableMultiVector< ConcreteType >::real_type > gko::EnableMultiVector< ConcreteType >::create_real_view ( ) const

Create a real view of the (potentially) complex original multi-vector.

If the original multi-vector is real, nothing changes. If the original multi-vector is complex, the result is created by viewing the complex multi-vector with as real with a reinterpret_cast with twice the number of columns and double the stride.

Note
Returns an object with real_type

◆ create_subview() [1/4]

template<typename ConcreteType >
std::unique_ptr< ConcreteType > gko::EnableMultiVector< ConcreteType >::create_subview ( local_span  rows,
local_span  columns 
)

Creates a view containing the selected local rows and columns.

Note
May incur a communication overhead. Use the overload create_subview(local_span, local_span, dim<2>) to prevent this
Returns an object with ConcreteType

◆ create_subview() [2/4]

template<typename ConcreteType >
std::unique_ptr< const ConcreteType > gko::EnableMultiVector< ConcreteType >::create_subview ( local_span  rows,
local_span  columns 
) const

Creates a view containing the selected local rows and columns.

Note
May incur a communication overhead. Use the overload create_subview(local_span, local_span, dim<2>) to prevent this
Returns an object with ConcreteType

◆ create_subview() [3/4]

template<typename ConcreteType >
std::unique_ptr< ConcreteType > gko::EnableMultiVector< ConcreteType >::create_subview ( local_span  rows,
local_span  columns,
dim< 2 >  global_size 
)

Creates a view containing the selected local rows and columns.

Note
Returns an object with ConcreteType

◆ create_subview() [4/4]

template<typename ConcreteType >
std::unique_ptr< const ConcreteType > gko::EnableMultiVector< ConcreteType >::create_subview ( local_span  rows,
local_span  columns,
dim< 2 >  global_size 
) const

Creates a view containing the selected local rows and columns.

Note
Returns an object with ConcreteType

◆ create_with_config_of()

template<typename ConcreteType>
std::unique_ptr< ConcreteType > gko::EnableMultiVector< ConcreteType >::create_with_config_of ( ptr_param< const ConcreteType >  other)
static

Parameters
otherThe vector whose configuration is used
Returns
An uninitialized vector with the configuration of other
Note
Returns an object with ConcreteType

◆ create_with_type_of() [1/3]

template<typename ConcreteType>
std::unique_ptr< ConcreteType > gko::EnableMultiVector< ConcreteType >::create_with_type_of ( ptr_param< const ConcreteType >  other,
std::shared_ptr< const Executor >  exec 
)
static

Only the type and precision of other are used, the size and stride of the new vector are both zero.

Parameters
otherThe multi-vector whose type is used.
execThe executor of the new multi-vector.
Returns
An empty vector with the type of other
Note
Returns an object with ConcreteType

◆ create_with_type_of() [2/3]

template<typename ConcreteType>
std::unique_ptr< ConcreteType > gko::EnableMultiVector< ConcreteType >::create_with_type_of ( ptr_param< const ConcreteType >  other,
std::shared_ptr< const Executor >  exec,
const dim< 2 > &  global_size,
const dim< 2 > &  local_size 
)
static

The stride of the new vector is set to the number of global columns. For non-distributed types, global_size and local_size have to be equal.

Parameters
otherThe multi-vector whose type is used.
execThe executor of the new multi-vector.
global_sizeThe global size of the new multi-vector.
local_sizeThe local size of the new multi-vector.
Exceptions
DimensionMismatchif global_size and local_size don't have the same number of columns
Returns
An empty vector with the type of other
Note
Returns an object with ConcreteType

◆ create_with_type_of() [3/3]

template<typename ConcreteType>
std::unique_ptr< ConcreteType > gko::EnableMultiVector< ConcreteType >::create_with_type_of ( ptr_param< const ConcreteType >  other,
std::shared_ptr< const Executor >  exec,
const dim< 2 > &  global_size,
const dim< 2 > &  local_size,
size_type  stride 
)
static

See also
create_with_type_of(ptr_param<const AbstractMultiVector>, std::shared_ptr<const Executor>, const dim<2>&, const dim<2>&)
Parameters
otherThe multi-vector whose type is used.
execThe executor of the new multi-vector.
global_sizeThe global size of the new multi-vector.
local_sizeThe local size of the new multi-vector.
strideThe stride of the new multi-vector.
Returns
An empty vector with the type of other
Note
Returns an object with ConcreteType

◆ get_const_local_device_view() [1/2]

template<typename ConcreteType>
template<typename ValueType >
device_view<const ValueType> gko::AbstractMultiVector::get_const_local_device_view ( typename ValueType  )

Gets a local device view of this vector.

Note
In contrast to AbstractMultiVector::get_local_device_view, the value type is already known, so it does not have to be specified and no runtime check on the precision is necessary.
Returns
A device view of the local data of this vector

◆ get_const_local_device_view() [2/2]

template<typename ConcreteType >
EnableMultiVector< ConcreteType >::const_device_view gko::EnableMultiVector< ConcreteType >::get_const_local_device_view ( ) const

Gets a local device view of this vector.

Note
In contrast to AbstractMultiVector::get_local_device_view, the value type is already known, so it does not have to be specified and no runtime check on the precision is necessary.
Returns
A device view of the local data of this vector

◆ get_imag() [1/2]

template<typename ConcreteType >
std::unique_ptr< typename EnableMultiVector< ConcreteType >::real_type > gko::EnableMultiVector< ConcreteType >::get_imag ( ) const

Creates a new real vector with the imaginary parts of this vector.

If this vector is real, the result is zero.

Returns
A real vector with the imaginary parts of this vector
Note
Returns an object with real_type

◆ get_imag() [2/2]

template<typename ConcreteType >
void gko::EnableMultiVector< ConcreteType >::get_imag ( ptr_param< real_type >  output) const

Note
Takes an object with real_type as output, so the precision is checked at compile time

◆ get_local_device_view() [1/2]

template<typename ConcreteType>
template<typename ValueType >
device_view<ValueType> gko::AbstractMultiVector::get_local_device_view ( typename ValueType  )

Gets a local device view of this vector for the specified value type.

The size of the view is equal to the local size of the vector.

Exceptions
InvalidStateErrorif the vector isn't stored in the requested value type
Template Parameters
ValueTypeThe value type of the view
Returns
A device view of the vector

◆ get_local_device_view() [2/2]

template<typename ConcreteType >
EnableMultiVector< ConcreteType >::device_view gko::EnableMultiVector< ConcreteType >::get_local_device_view ( )

Gets a local device view of this vector.

Note
In contrast to AbstractMultiVector::get_local_device_view, the value type is already known, so it does not have to be specified and no runtime check on the precision is necessary.
Returns
A device view of the local data of this vector

◆ get_real() [1/2]

template<typename ConcreteType >
std::unique_ptr< typename EnableMultiVector< ConcreteType >::real_type > gko::EnableMultiVector< ConcreteType >::get_real ( ) const

Creates a new real vector with the real parts of this vector.

Returns
A real vector with the real parts of this vector
Note
Returns an object with real_type

◆ get_real() [2/2]

template<typename ConcreteType >
void gko::EnableMultiVector< ConcreteType >::get_real ( ptr_param< real_type >  output) const

Note
Takes an object with real_type as output, so the precision is checked at compile time

◆ make_complex() [1/2]

template<typename ConcreteType >
std::unique_ptr< typename EnableMultiVector< ConcreteType >::complex_type > gko::EnableMultiVector< ConcreteType >::make_complex ( ) const

Creates a complex copy of this vector.

If this vector is real, the imaginary part of the result is zero.

Returns
A complex copy of this vector
Note
Returns an object with complex_type

◆ make_complex() [2/2]

template<typename ConcreteType >
void gko::EnableMultiVector< ConcreteType >::make_complex ( ptr_param< complex_type >  output) const

AbstractMultiVector::make_complex(ptr_param<AbstractMultiVector>)

Note
Takes an object with complex_type as output, so the precision is checked at compile time

◆ move_from()

template<typename ConcreteType>
ConcreteType * gko::EnableMultiVector< ConcreteType >::move_from ( ptr_param< ConcreteType >  other)

Moves the data of other into this vector.

The executor and the precision of this vector are preserved, i.e. the data of other is copied and converted if the precisions or executors don't match. other is left in an unspecified, but valid, state.

Parameters
otherThe vector to move from
Returns
This vector
Note
Takes an object with ConcreteType as input

◆ move_to()

template<typename ConcreteType >
void gko::EnableMultiVector< ConcreteType >::move_to ( result_type *  result)
overridevirtual

Converts the implementer to an object of type result_type by moving data from this object.

This method is used when the implementer is a temporary object, and move semantics can be used.

Parameters
resultthe object used to emplace the result of the conversion
Note
ConvertibleTo::move_to can be implemented by simply calling ConvertibleTo::convert_to. However, this operation can often be optimized by exploiting the fact that implementer's data can be moved to the result.
This uses the move assignment of ConcreteType.

Implements gko::ConvertibleTo< ConcreteType >.


The documentation for this class was generated from the following file:
gko::EnableMultiVector::clone
std::unique_ptr< ConcreteType > clone() const
Creates a copy of this vector on the given executor.
Definition: multivector_mixin.hpp:723