Ginkgo Generated from branch based on main. Ginkgo version 1.10.0
A numerical linear algebra library targeting many-core architectures
Loading...
Searching...
No Matches
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.
 load_balance (std::shared_ptr< const CudaExecutor > exec)
 Creates a load_balance strategy with CUDA executor.
 load_balance (std::shared_ptr< const HipExecutor > exec)
 Creates a load_balance strategy with HIP executor.
 load_balance (std::shared_ptr< const DpcppExecutor > exec)
 Creates a load_balance strategy with DPCPP executor.
 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.
void process (const array< index_type > &mtx_row_ptrs, array< index_type > *mtx_srow) override
 Computes srow according to row pointers.
int64_t clac_size (const int64_t nnz) override
 Computes the srow size according to the number of nonzeros.
std::shared_ptr< strategy_typecopy () override
 Copy a strategy.
Public Member Functions inherited from gko::matrix::Csr< ValueType, IndexType >::strategy_type
 strategy_type (std::string name)
 Creates a strategy_type.
std::string get_name ()
 Returns the name of strategy.

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.

References gko::matrix::Csr< ValueType, IndexType >::create(), and load_balance().

Referenced by load_balance(), load_balance(), load_balance(), and load_balance().

◆ 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

References load_balance().

◆ 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

References load_balance().

◆ 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

References load_balance().

◆ 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.

References gko::matrix::Csr< ValueType, IndexType >::strategy_type::strategy_type().

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: