Loading...
Searching...
No Matches
gpr::linalg::ScopedTileKernelThreads Class Reference

#include <gpr/linalg/DistributedState.h>

Public Member Functions

 ScopedTileKernelThreads (const DistributedState &st)
 ~ScopedTileKernelThreads ()
 ScopedTileKernelThreads (const ScopedTileKernelThreads &)=delete
ScopedTileKernelThreads & operator= (const ScopedTileKernelThreads &)=delete

Detailed Description

Thread split for a library-mode call that DistributedState::tile_kernels sends to the tile kernels. The library selection runs tiles on the calling thread and threads inside BLAS; for the duration of the scope the configured threads go to independent tiles and each product runs on one thread, the split of the reproducible selection. The tile pool count is the inline copy of the translation unit that runs the kernels, so the scope lives in a header. No effect under the reproducible selection.

Definition at line 1530 of file DistributedState.h.

Constructor & Destructor Documentation

◆ ScopedTileKernelThreads() [1/2]

gpr::linalg::ScopedTileKernelThreads::ScopedTileKernelThreads ( const DistributedState & st)
inlineexplicit

Definition at line 1532 of file DistributedState.h.

1533 : active_(!st.reproducible() && configuredLinalgThreads() > 1),
1534 previous_(tileThreadCount().load())
1535 {
1536 if (!active_) return;
1539 }
void setTileThreads(int threads) noexcept
Sets the tile thread count (at least one).
void configureProductThreads(int threads)
int configuredLinalgThreads() noexcept
Requested dense numerical budget, independent of nested BLAS controls.
std::atomic< int > & tileThreadCount() noexcept
Number of threads one rank devotes to independent tile products.

◆ ~ScopedTileKernelThreads()

gpr::linalg::ScopedTileKernelThreads::~ScopedTileKernelThreads ( )
inline

Definition at line 1540 of file DistributedState.h.

1541 {
1542 if (!active_) return;
1543 setTileThreads(previous_);
1545 }

◆ ScopedTileKernelThreads() [2/2]

gpr::linalg::ScopedTileKernelThreads::ScopedTileKernelThreads ( const ScopedTileKernelThreads & )
delete

Member Function Documentation

◆ operator=()

ScopedTileKernelThreads & gpr::linalg::ScopedTileKernelThreads::operator= ( const ScopedTileKernelThreads & )
delete

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