Grok 12.0.1
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
hwy::PoolWorker Class Reference

#include <thread_pool.h>

Public Member Functions

 PoolWorker (size_t thread, size_t num_workers)
 
 ~PoolWorker ()=default
 
void SetWaitMode (PoolWaitMode wait_mode)
 
PoolWaitMode WorkerGetWaitMode () const
 
hwy::Span< const uint32_t > Victims () const
 
HWY_POOL_SETRANGE_INLINE void SetRange (uint64_t begin, uint64_t end)
 
uint64_t WorkerGetEnd () const
 
uint64_t WorkerReserveTask ()
 

Private Attributes

std::atomic< uint64_t > begin_
 
std::atomic< uint64_t > end_
 
std::atomic< PoolWaitModewait_mode_
 
uint32_t num_victims_
 
std::array< uint32_t, kMaxVictimsvictims_
 
uint8_t padding_ [HWY_ALIGNMENT - 16 - 8 - sizeof(victims_)]
 

Static Private Attributes

static constexpr size_t kMaxVictims = 4
 

Constructor & Destructor Documentation

◆ PoolWorker()

hwy::PoolWorker::PoolWorker ( size_t thread,
size_t num_workers )
inline

◆ ~PoolWorker()

hwy::PoolWorker::~PoolWorker ( )
default

Member Function Documentation

◆ SetRange()

HWY_POOL_SETRANGE_INLINE void hwy::PoolWorker::SetRange ( uint64_t begin,
uint64_t end )
inline

References begin_, and end_.

Referenced by hwy::ParallelFor::Plan().

◆ SetWaitMode()

void hwy::PoolWorker::SetWaitMode ( PoolWaitMode wait_mode)
inline

References wait_mode_.

Referenced by hwy::ThreadPool::SetWaitMode().

◆ Victims()

hwy::Span< const uint32_t > hwy::PoolWorker::Victims ( ) const
inline

References num_victims_, and victims_.

Referenced by hwy::ParallelFor::WorkerRun().

◆ WorkerGetEnd()

uint64_t hwy::PoolWorker::WorkerGetEnd ( ) const
inline

References end_.

Referenced by hwy::ParallelFor::WorkerRun().

◆ WorkerGetWaitMode()

PoolWaitMode hwy::PoolWorker::WorkerGetWaitMode ( ) const
inline

References wait_mode_.

Referenced by hwy::ThreadPool::ThreadFunc().

◆ WorkerReserveTask()

uint64_t hwy::PoolWorker::WorkerReserveTask ( )
inline

References begin_.

Referenced by hwy::ParallelFor::WorkerRun().

Member Data Documentation

◆ begin_

std::atomic<uint64_t> hwy::PoolWorker::begin_
private

Referenced by SetRange(), and WorkerReserveTask().

◆ end_

std::atomic<uint64_t> hwy::PoolWorker::end_
private

Referenced by SetRange(), and WorkerGetEnd().

◆ kMaxVictims

constexpr size_t hwy::PoolWorker::kMaxVictims = 4
staticconstexprprivate

Referenced by PoolWorker().

◆ num_victims_

uint32_t hwy::PoolWorker::num_victims_
private

Referenced by PoolWorker(), and Victims().

◆ padding_

uint8_t hwy::PoolWorker::padding_[HWY_ALIGNMENT - 16 - 8 - sizeof(victims_)]
private

Referenced by PoolWorker().

◆ victims_

std::array<uint32_t, kMaxVictims> hwy::PoolWorker::victims_
private

Referenced by PoolWorker(), and Victims().

◆ wait_mode_

std::atomic<PoolWaitMode> hwy::PoolWorker::wait_mode_
private

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