gem5  v22.1.0.0
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
gem5::WFBarrier Class Reference

WF barrier slots. More...

#include <compute_unit.hh>

Public Member Functions

 WFBarrier ()
 
int numAtBarrier () const
 
int numYetToReachBarrier () const
 Number of WFs that have not yet reached the barrier. More...
 
int maxBarrierCnt () const
 
void setMaxBarrierCnt (int max_barrier_cnt)
 Set the maximum barrier count (i.e., the number of WFs that are participating in the barrier). More...
 
void incNumAtBarrier ()
 Mark that a WF has reached the barrier. More...
 
bool allAtBarrier () const
 Have all WFs participating in this barrier reached the barrier? If so, then the barrier is satisfied and WFs may proceed past the barrier. More...
 
void decMaxBarrierCnt ()
 Decrement the number of WFs that are participating in this barrier. More...
 
void release ()
 Release this barrier resource so it can be used by other WGs. More...
 
void reset ()
 Reset the barrier. More...
 

Static Public Attributes

static const int InvalidID = -1
 

Private Attributes

int _numAtBarrier
 The number of WFs in the WG that have reached the barrier. More...
 
int _maxBarrierCnt
 The maximum number of WFs that can reach this barrier. More...
 

Detailed Description

WF barrier slots.

This represents the barrier resource for WF-level barriers (i.e., barriers to sync WFs within a WG).

Definition at line 90 of file compute_unit.hh.

Constructor & Destructor Documentation

◆ WFBarrier()

gem5::WFBarrier::WFBarrier ( )
inline

Definition at line 93 of file compute_unit.hh.

Member Function Documentation

◆ allAtBarrier()

bool gem5::WFBarrier::allAtBarrier ( ) const
inline

Have all WFs participating in this barrier reached the barrier? If so, then the barrier is satisfied and WFs may proceed past the barrier.

Definition at line 146 of file compute_unit.hh.

References _maxBarrierCnt, and _numAtBarrier.

◆ decMaxBarrierCnt()

void gem5::WFBarrier::decMaxBarrierCnt ( )
inline

Decrement the number of WFs that are participating in this barrier.

This should be called when a WF exits.

Definition at line 156 of file compute_unit.hh.

References _maxBarrierCnt.

◆ incNumAtBarrier()

void gem5::WFBarrier::incNumAtBarrier ( )
inline

Mark that a WF has reached the barrier.

Definition at line 134 of file compute_unit.hh.

References _maxBarrierCnt, and _numAtBarrier.

◆ maxBarrierCnt()

int gem5::WFBarrier::maxBarrierCnt ( ) const
inline

Definition at line 115 of file compute_unit.hh.

References _maxBarrierCnt.

◆ numAtBarrier()

int gem5::WFBarrier::numAtBarrier ( ) const
inline

Definition at line 100 of file compute_unit.hh.

References _numAtBarrier.

◆ numYetToReachBarrier()

int gem5::WFBarrier::numYetToReachBarrier ( ) const
inline

Number of WFs that have not yet reached the barrier.

Definition at line 109 of file compute_unit.hh.

References _maxBarrierCnt, and _numAtBarrier.

◆ release()

void gem5::WFBarrier::release ( )
inline

Release this barrier resource so it can be used by other WGs.

This is generally called when a WG has finished.

Definition at line 167 of file compute_unit.hh.

References _maxBarrierCnt, and _numAtBarrier.

◆ reset()

void gem5::WFBarrier::reset ( )
inline

Reset the barrier.

This is used to reset the barrier, usually when a dynamic instance of a barrier has been satisfied.

Definition at line 178 of file compute_unit.hh.

References _numAtBarrier.

◆ setMaxBarrierCnt()

void gem5::WFBarrier::setMaxBarrierCnt ( int  max_barrier_cnt)
inline

Set the maximum barrier count (i.e., the number of WFs that are participating in the barrier).

Definition at line 125 of file compute_unit.hh.

References _maxBarrierCnt.

Member Data Documentation

◆ _maxBarrierCnt

int gem5::WFBarrier::_maxBarrierCnt
private

The maximum number of WFs that can reach this barrier.

This is essentially the number of WFs in the WG, and a barrier is satisfied when the number of WFs that reach the barrier equal this value. If a WF exits early it must decrement this value so that it is no longer considered for this barrier.

Definition at line 198 of file compute_unit.hh.

Referenced by allAtBarrier(), decMaxBarrierCnt(), incNumAtBarrier(), maxBarrierCnt(), numYetToReachBarrier(), release(), and setMaxBarrierCnt().

◆ _numAtBarrier

int gem5::WFBarrier::_numAtBarrier
private

The number of WFs in the WG that have reached the barrier.

Once the number of WFs that reach a barrier matches the number of WFs in the WG, the barrier is satisfied.

Definition at line 189 of file compute_unit.hh.

Referenced by allAtBarrier(), incNumAtBarrier(), numAtBarrier(), numYetToReachBarrier(), release(), and reset().

◆ InvalidID

const int gem5::WFBarrier::InvalidID = -1
static

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

Generated on Wed Dec 21 2022 10:23:22 for gem5 by doxygen 1.9.1