Ginkgo  Generated from pipelines/1589998975 branch based on develop. Ginkgo version 1.10.0
A numerical linear algebra library targeting many-core architectures
Public Member Functions | List of all members
gko::matrix::Csr< ValueType, IndexType >::load_balance Class Reference

load_balance is a strategy_type which uses the load balance algorithm. More...

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

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

Public Member Functions

 load_balance ()
 Creates a load_balance strategy. More...
 
 load_balance (std::shared_ptr< const CudaExecutor > exec)
 Creates a load_balance strategy with CUDA executor. More...
 
 load_balance (std::shared_ptr< const HipExecutor > exec)
 Creates a load_balance strategy with HIP executor. More...
 
 load_balance (std::shared_ptr< const DpcppExecutor > exec)
 Creates a load_balance strategy with DPCPP executor. More...
 
 load_balance (int64_t nwarps, int warp_size=32, bool cuda_strategy=true, std::string strategy_name="none")
 Creates a load_balance strategy with specified parameters. More...
 
void process (const array< index_type > &mtx_row_ptrs, array< index_type > *mtx_srow) override
 Computes srow according to row pointers. More...
 
int64_t clac_size (const int64_t nnz) override
 Computes the srow size according to the number of nonzeros. More...
 
std::shared_ptr< strategy_typecopy () override
 Copy a strategy. More...
 
- Public Member Functions inherited from gko::matrix::Csr< ValueType, IndexType >::strategy_type
 strategy_type (std::string name)
 Creates a strategy_type. More...
 
std::string get_name ()
 Returns the name of strategy. More...
 

Detailed Description

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

load_balance is a strategy_type which uses the load balance algorithm.

Constructor & Destructor Documentation

◆ load_balance() [1/5]

template<typename ValueType = default_precision, typename IndexType = int32>
gko::matrix::Csr< ValueType, IndexType >::load_balance::load_balance ( )
inline

Creates a load_balance strategy.

Warning
this is deprecated! Please rely on the new automatic strategy instantiation or use one of the other constructors.

◆ load_balance() [2/5]

template<typename ValueType = default_precision, typename IndexType = int32>
gko::matrix::Csr< ValueType, IndexType >::load_balance::load_balance ( std::shared_ptr< const CudaExecutor exec)
inline

Creates a load_balance strategy with CUDA executor.

Parameters
execthe CUDA executor

◆ load_balance() [3/5]

template<typename ValueType = default_precision, typename IndexType = int32>
gko::matrix::Csr< ValueType, IndexType >::load_balance::load_balance ( std::shared_ptr< const HipExecutor exec)
inline

Creates a load_balance strategy with HIP executor.

Parameters
execthe HIP executor

◆ load_balance() [4/5]

template<typename ValueType = default_precision, typename IndexType = int32>
gko::matrix::Csr< ValueType, IndexType >::load_balance::load_balance ( std::shared_ptr< const DpcppExecutor exec)
inline

Creates a load_balance strategy with DPCPP executor.

Parameters
execthe DPCPP executor
Note
TODO: porting - we hardcode the subgroup size is 32

◆ load_balance() [5/5]

template<typename ValueType = default_precision, typename IndexType = int32>
gko::matrix::Csr< ValueType, IndexType >::load_balance::load_balance ( int64_t  nwarps,
int  warp_size = 32,
bool  cuda_strategy = true,
std::string  strategy_name = "none" 
)
inline

Creates a load_balance strategy with specified parameters.

Parameters
nwarpsthe number of warps in the executor
warp_sizethe warp size of the executor
cuda_strategywhether the cuda_strategy needs to be used.
Note
The warp_size must be the size of full warp. When using this constructor, set_strategy needs to be called with correct parameters which is replaced during the conversion.

Member Function Documentation

◆ clac_size()

template<typename ValueType = default_precision, typename IndexType = int32>
int64_t gko::matrix::Csr< ValueType, IndexType >::load_balance::clac_size ( const int64_t  nnz)
inlineoverridevirtual

Computes the srow size according to the number of nonzeros.

Parameters
nnzthe number of nonzeros
Returns
the size of srow

Implements gko::matrix::Csr< ValueType, IndexType >::strategy_type.

References gko::ceildiv(), and gko::min().

◆ copy()

template<typename ValueType = default_precision, typename IndexType = int32>
std::shared_ptr<strategy_type> gko::matrix::Csr< ValueType, IndexType >::load_balance::copy ( )
inlineoverridevirtual

Copy a strategy.

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

Implements gko::matrix::Csr< ValueType, IndexType >::strategy_type.

◆ process()

template<typename ValueType = default_precision, typename IndexType = int32>
void gko::matrix::Csr< ValueType, IndexType >::load_balance::process ( const array< index_type > &  mtx_row_ptrs,
array< index_type > *  mtx_srow 
)
inlineoverridevirtual

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