Ginkgo: gko::matrix::Csr< ValueType, IndexType >::strategy_type Class Reference

| Ginkgo Generated from branch based on main. Ginkgo version 1.11.0 A numerical linear algebra library targeting many-core architectures

Loading...
Searching...
No Matches
gko::matrix::Csr< ValueType, IndexType >::strategy_type Class Referenceabstract

strategy_type is to decide how to set the csr algorithm. More...

`#include <ginkgo/core/matrix/csr.hpp>`

Inheritance diagram for gko::matrix::Csr< ValueType, IndexType >::strategy_type:
[legend]

## Public Member Functions
| strategy_type (std::string name)
| Creates a strategy_type.
std::string | get_name ()
| Returns the name of strategy.
virtual void | process (const array< index_type > &mtx_row_ptrs, array< index_type > *mtx_srow)=0
| Computes srow according to row pointers.
virtual int64_t | clac_size (const int64_t nnz)=0
| Computes the srow size according to the number of nonzeros.
virtual std::shared_ptr< strategy_type > | copy ()=0
| Copy a strategy.

## Friends
class | automatical

## Detailed Description

template<typename ValueType = default_precision, typename IndexType = int32>
class gko::matrix::Csr< ValueType, IndexType >::strategy_type

strategy_type is to decide how to set the csr algorithm.

The practical strategy method should inherit strategy_type and implement its process, clac_size function and the corresponding device kernel.

## Constructor & Destructor Documentation

## ◆ strategy_type()

template<typename ValueType = default_precision, typename IndexType = int32>

gko::matrix::Csr< ValueType, IndexType >::strategy_type::strategy_type | ( | std::string | name | ) |
| inline

Creates a strategy_type.

Parameters

  name | the name of strategy

Referenced by gko::matrix::Csr< ValueType, IndexType >::automatical::automatical(), gko::matrix::Csr< ValueType, IndexType >::classical::classical(), gko::matrix::Csr< ValueType, IndexType >::cusparse::cusparse(), gko::matrix::Csr< ValueType, IndexType >::load_balance::load_balance(), gko::matrix::Csr< ValueType, IndexType >::merge_path::merge_path(), and gko::matrix::Csr< ValueType, IndexType >::sparselib::sparselib().

## Member Function Documentation

## ◆ clac_size()

template<typename ValueType = default_precision, typename IndexType = int32>

virtual int64_t gko::matrix::Csr< ValueType, IndexType >::strategy_type::clac_size | ( | const int64_t | nnz | ) |
| pure virtual

Computes the srow size according to the number of nonzeros.

Parameters

  nnz | the number of nonzeros

Returns
  the size of srow

Implemented in gko::matrix::Csr< ValueType, IndexType >::automatical, gko::matrix::Csr< ValueType, IndexType >::classical, gko::matrix::Csr< ValueType, IndexType >::cusparse, gko::matrix::Csr< ValueType, IndexType >::load_balance, gko::matrix::Csr< ValueType, IndexType >::merge_path, and gko::matrix::Csr< ValueType, IndexType >::sparselib.

## ◆ copy()

template<typename ValueType = default_precision, typename IndexType = int32>

virtual std::shared_ptr< strategy_type > gko::matrix::Csr< ValueType, IndexType >::strategy_type::copy | ( |  | ) |
| pure virtual

Copy a strategy.

This is a workaround until strategies are revamped, since strategies like automatical do not work when actually shared.

Implemented in gko::matrix::Csr< ValueType, IndexType >::automatical, gko::matrix::Csr< ValueType, IndexType >::classical, gko::matrix::Csr< ValueType, IndexType >::cusparse, gko::matrix::Csr< ValueType, IndexType >::load_balance, gko::matrix::Csr< ValueType, IndexType >::merge_path, and gko::matrix::Csr< ValueType, IndexType >::sparselib.

## ◆ get_name()

template<typename ValueType = default_precision, typename IndexType = int32>

std::string gko::matrix::Csr< ValueType, IndexType >::strategy_type::get_name | ( |  | ) |
| inline

Returns the name of strategy.

Returns
  the name of strategy

Referenced by gko::matrix::Csr< ValueType, IndexType >::automatical::process().

## ◆ process()

template<typename ValueType = default_precision, typename IndexType = int32>

virtual void gko::matrix::Csr< ValueType, IndexType >::strategy_type::process | ( | const array< index_type > & | mtx_row_ptrs,
|  | array< index_type > * | mtx_srow )
| pure virtual

Computes srow according to row pointers.

Parameters

  mtx_row_ptrs | the row pointers of the matrix
  mtx_srow | the srow of the matrix

Implemented in gko::matrix::Csr< ValueType, IndexType >::automatical, gko::matrix::Csr< ValueType, IndexType >::classical, gko::matrix::Csr< ValueType, IndexType >::cusparse, gko::matrix::Csr< ValueType, IndexType >::load_balance, gko::matrix::Csr< ValueType, IndexType >::merge_path, and gko::matrix::Csr< ValueType, IndexType >::sparselib.

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

- ginkgo/core/matrix/csr.hpp