Template Numerical Library version\ main:bb09b17
|
Wrapper for representing vectors using Ginkgo data structure. More...
#include <TNL/Containers/GinkgoVector.h>
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< GinkgoVector > | create (std::shared_ptr< const gko::Executor > exec, Vector &&vector, bool ownership=false) |
Wrapper for representing vectors using Ginkgo data structure.
|
inline |
Bind or copy data into a new GinkgoVector object.
exec | Ginkgo executor to associate with this vector. |
vector | Input vector or vector view. See TNL::Containers::Vector and TNL::Containers::VectorView. |
ownership | controls 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. |
|
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.