Loading...
Searching...
No Matches
gpr::linalg::ThreadBudget Struct Reference

#include <gpr/linalg/BackendInterface.h>

Public Member Functions

constexpr int total () const noexcept
constexpr bool fits (int cpu_share) const noexcept

Public Attributes

int workers = 1
int nested_blas = 1

Detailed Description

CPU threads a provider may use on one rank. workers run independent tasks (tiles, kernel blocks); each may open a nested BLAS team of nested_blas threads. The provider spends workers * nested_blas threads at most; callers hand over a budget within the rank's CPU share.

Definition at line 139 of file BackendInterface.h.

Member Function Documentation

◆ fits()

bool gpr::linalg::ThreadBudget::fits ( int cpu_share) const
inlinenodiscardconstexprnoexcept

Definition at line 147 of file BackendInterface.h.

148 {
149 return workers >= 1 && nested_blas >= 1 && total() <= cpu_share;
150 }
constexpr int total() const noexcept

◆ total()

int gpr::linalg::ThreadBudget::total ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 143 of file BackendInterface.h.

144 {
145 return workers * nested_blas;
146 }

Member Data Documentation

◆ nested_blas

int gpr::linalg::ThreadBudget::nested_blas = 1

Definition at line 141 of file BackendInterface.h.

◆ workers

int gpr::linalg::ThreadBudget::workers = 1

Definition at line 140 of file BackendInterface.h.


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