Ginkgo  Generated from pipelines/1363093349 branch based on develop. Ginkgo version 1.9.0
A numerical linear algebra library targeting many-core architectures
Public Member Functions | List of all members
gko::batch::BatchLinOpFactory Class Reference

A BatchLinOpFactory represents a higher order mapping which transforms one batch linear operator into another. More...

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

Inheritance diagram for gko::batch::BatchLinOpFactory:
[legend]
Collaboration diagram for gko::batch::BatchLinOpFactory:
[legend]

Public Member Functions

std::unique_ptr< BatchLinOpgenerate (std::shared_ptr< const BatchLinOp > input) const
 
- Public Member Functions inherited from gko::PolymorphicObject
PolymorphicObjectoperator= (const PolymorphicObject &)
 
std::unique_ptr< PolymorphicObjectcreate_default (std::shared_ptr< const Executor > exec) const
 Creates a new "default" object of the same dynamic type as this object. More...
 
std::unique_ptr< PolymorphicObjectcreate_default () const
 Creates a new "default" object of the same dynamic type as this object. More...
 
std::unique_ptr< PolymorphicObjectclone (std::shared_ptr< const Executor > exec) const
 Creates a clone of the object. More...
 
std::unique_ptr< PolymorphicObjectclone () const
 Creates a clone of the object. More...
 
PolymorphicObjectcopy_from (const PolymorphicObject *other)
 Copies another object into this object. More...
 
template<typename Derived , typename Deleter >
std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, PolymorphicObject > * copy_from (std::unique_ptr< Derived, Deleter > &&other)
 Moves another object into this object. More...
 
template<typename Derived , typename Deleter >
std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, PolymorphicObject > * copy_from (const std::unique_ptr< Derived, Deleter > &other)
 Copies another object into this object. More...
 
PolymorphicObjectcopy_from (const std::shared_ptr< const PolymorphicObject > &other)
 Copies another object into this object. More...
 
PolymorphicObjectmove_from (ptr_param< PolymorphicObject > other)
 Moves another object into this object. More...
 
PolymorphicObjectclear ()
 Transforms the object into its default state. More...
 
std::shared_ptr< const Executorget_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)
 

Detailed Description

A BatchLinOpFactory represents a higher order mapping which transforms one batch linear operator into another.

In a similar fashion to LinOps, BatchLinOps are also "generated" from the BatchLinOpFactory. A function of this class is to provide a generate method, which internally cals the generate_impl(), which the concrete BatchLinOps have to implement.

Example: using BatchCG in Ginkgo

{c++}
// Suppose A is a batch matrix, batch_b, a batch rhs vector, and batch_x, an
// initial guess
// Create a BatchCG which runs for at most 1000 iterations, and stops after
// reducing the residual norm by 6 orders of magnitude
auto batch_cg_factory = solver::BatchCg<>::build()
.with_max_iters(1000)
.with_rel_residual_goal(1e-6)
.on(cuda);
// create a batch linear operator which represents the solver
auto batch_cg = batch_cg_factory->generate(A);
// solve the system
batch_cg->apply(batch_b, batch_x);

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