Template Numerical Library version\ main:df396df
Loading...
Searching...
No Matches
TNL::Containers::GinkgoVector< Value, Device > Class Template Reference

Wrapper for representing vectors using Ginkgo data structure. More...

#include <TNL/Containers/GinkgoVector.h>

Inheritance diagram for TNL::Containers::GinkgoVector< Value, Device >:
Collaboration diagram for TNL::Containers::GinkgoVector< Value, Device >:

Public Types

using AllocatorType = typename Allocators::Default< Device >::template Allocator< ValueType >
 
using ConstViewType = typename ViewType::ConstViewType
 
using DeviceType = Device
 
using IndexType = gko::size_type
 
using RealType = Value
 
using ValueType = Value
 
using ViewType = Containers::VectorView< RealType, DeviceType, IndexType >
 

Public Member Functions

template<typename Vector >
 GinkgoVector (std::shared_ptr< const gko::Executor > exec, Vector &&vector, bool ownership=false)
 Bind or copy data into a new GinkgoVector object.
 
std::unique_ptr< gko::matrix::Dense< ValueType > > create_submatrix_impl (const gko::span &rows, const gko::span &columns, const gko::size_type stride) override
 Override base Dense class implementation for creating new sub-vectors from a larger vector.
 
std::unique_ptr< gko::matrix::Dense< ValueType > > create_with_same_config () const override
 Override base Dense class implementation for creating new vectors with same executor and size as self.
 
std::unique_ptr< gko::matrix::Dense< ValueType > > create_with_type_of_impl (std::shared_ptr< const gko::Executor > exec, const gko::dim< 2 > &size, gko::size_type stride) const override
 Override base Dense class implementation for creating new vectors with same executor and type as self, but with a different size.
 
ConstViewType getConstView () const
 
ViewType getView ()
 

Static Public Member Functions

template<typename Vector >
static std::unique_ptr< GinkgoVectorcreate (std::shared_ptr< const gko::Executor > exec, Vector &&vector, bool ownership=false)
 

Detailed Description

template<typename Value, typename Device = Devices::Host>
class TNL::Containers::GinkgoVector< Value, Device >

Wrapper for representing vectors using Ginkgo data structure.

Constructor & Destructor Documentation

◆ GinkgoVector()

template<typename Value , typename Device = Devices::Host>
template<typename Vector >
TNL::Containers::GinkgoVector< Value, Device >::GinkgoVector ( std::shared_ptr< const gko::Executor > exec,
Vector && vector,
bool ownership = false )
inline

Bind or copy data into a new GinkgoVector object.

Parameters
execGinkgo executor to associate with this vector.
vectorInput vector or vector view. See TNL::Containers::Vector and TNL::Containers::VectorView.
ownershipcontrols whether or not we want Ginkgo to own the data. Normally, when we are wrapping a TNL Vector(View) created outside Ginkgo, we do not want ownership to be true. However, Ginkgo creates its own temporary vectors as part of its solvers, and these will be owned (and deleted) by Ginkgo.

Member Function Documentation

◆ create_with_type_of_impl()

template<typename Value , typename Device = Devices::Host>
std::unique_ptr< gko::matrix::Dense< ValueType > > TNL::Containers::GinkgoVector< Value, Device >::create_with_type_of_impl ( std::shared_ptr< const gko::Executor > exec,
const gko::dim< 2 > & size,
gko::size_type stride ) const
inlinenodiscardoverride

Override base Dense class implementation for creating new vectors with same executor and type as self, but with a different size.

This function will create "one large VectorWrapper" of size size[0] * size[1], since MFEM Vectors only have one dimension.


The documentation for this class was generated from the following file: