gem5  v20.1.0.0
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
HSAQueueEntry Class Reference

#include <hsa_queue_entry.hh>

Public Member Functions

 HSAQueueEntry (std::string kernel_name, uint32_t queue_id, int dispatch_id, void *disp_pkt, AMDKernelCode *akc, Addr host_pkt_addr, Addr code_addr)
 
const std::string & kernelName () const
 
int wgSize (int dim) const
 
int gridSize (int dim) const
 
int numVectorRegs () const
 
int numScalarRegs () const
 
uint32_t queueId () const
 
int dispatchId () const
 
void * dispPktPtr ()
 
Addr hostDispPktAddr () const
 
Addr completionSignal () const
 
Addr codeAddr () const
 
Addr kernargAddr () const
 
int ldsSize () const
 
int privMemPerItem () const
 
int contextId () const
 
bool dispComplete () const
 
int wgId (int dim) const
 
void wgId (int dim, int val)
 
int globalWgId () const
 
void globalWgId (int val)
 
int numWg (int dim) const
 
void notifyWgCompleted ()
 
int numWgCompleted () const
 
int numWgTotal () const
 
void markWgDispatch ()
 
int numWgAtBarrier () const
 
bool vgprBitEnabled (int bit) const
 
bool sgprBitEnabled (int bit) const
 
int outstandingInvs ()
 
bool isInvStarted ()
 Whether invalidate has started or finished -1 is the initial value indicating inv has not started for the kernel. More...
 
void updateOutstandingInvs (int val)
 update the number of pending invalidate requests More...
 
void markInvDone ()
 Forcefully change the state to be inv done. More...
 
bool isInvDone () const
 Is invalidate done? More...
 
int outstandingWbs () const
 
void updateOutstandingWbs (int val)
 Update the number of pending writeback requests. More...
 

Public Attributes

Addr hostAMDQueueAddr
 Host-side addr of the amd_queue_t on which this task was queued. More...
 
_amd_queue_t amdQueue
 Keep a copy of the AMD HSA queue because we need info from some of its fields to initialize register state. More...
 

Static Public Attributes

const static int MAX_DIM = 3
 

Private Member Functions

void parseKernelCode (AMDKernelCode *akc)
 

Private Attributes

std::string kernName
 
std::array< int, MAX_DIM_wgSize
 
std::array< int, MAX_DIM_gridSize
 
int numVgprs
 
int numSgprs
 
uint32_t _queueId
 
int _dispatchId
 
void * dispPkt
 
Addr _hostDispPktAddr
 
Addr _completionSignal
 
Addr codeAddress
 
Addr kernargAddress
 
int _outstandingInvs
 Number of outstanding invs for the kernel. More...
 
int _outstandingWbs
 Number of outstanding wbs for the kernel values: 0: 1)initial value, flush has not started for the kernel 2)+1->0: all wb requests are finished, i.e., flush done ?: positive value, indicating the number of pending wb requests. More...
 
int _ldsSize
 
int _privMemPerItem
 
int _contextId
 
std::array< int, MAX_DIM_wgId
 
std::array< int, MAX_DIM_numWg
 
int _numWgTotal
 
int numWgArrivedAtBarrier
 
int _numWgCompleted
 
int _globalWgId
 
bool dispatchComplete
 
std::bitset< NumVectorInitFieldsinitialVgprState
 
std::bitset< NumScalarInitFieldsinitialSgprState
 

Detailed Description

Definition at line 60 of file hsa_queue_entry.hh.

Constructor & Destructor Documentation

◆ HSAQueueEntry()

HSAQueueEntry::HSAQueueEntry ( std::string  kernel_name,
uint32_t  queue_id,
int  dispatch_id,
void *  disp_pkt,
AMDKernelCode akc,
Addr  host_pkt_addr,
Addr  code_addr 
)
inline

Definition at line 63 of file hsa_queue_entry.hh.

Member Function Documentation

◆ codeAddr()

Addr HSAQueueEntry::codeAddr ( ) const
inline

◆ completionSignal()

Addr HSAQueueEntry::completionSignal ( ) const
inline

Definition at line 172 of file hsa_queue_entry.hh.

References _completionSignal.

◆ contextId()

int HSAQueueEntry::contextId ( ) const
inline

Definition at line 198 of file hsa_queue_entry.hh.

References _contextId.

◆ dispatchId()

int HSAQueueEntry::dispatchId ( ) const
inline

◆ dispComplete()

bool HSAQueueEntry::dispComplete ( ) const
inline

Definition at line 204 of file hsa_queue_entry.hh.

References dispatchComplete.

Referenced by Shader::dispatchWorkgroups().

◆ dispPktPtr()

void* HSAQueueEntry::dispPktPtr ( )
inline

Definition at line 160 of file hsa_queue_entry.hh.

References dispPkt.

◆ globalWgId() [1/2]

int HSAQueueEntry::globalWgId ( ) const
inline

◆ globalWgId() [2/2]

void HSAQueueEntry::globalWgId ( int  val)
inline

Definition at line 230 of file hsa_queue_entry.hh.

References _globalWgId, and X86ISA::val.

◆ gridSize()

int HSAQueueEntry::gridSize ( int  dim) const
inline

◆ hostDispPktAddr()

Addr HSAQueueEntry::hostDispPktAddr ( ) const
inline

Definition at line 166 of file hsa_queue_entry.hh.

References _hostDispPktAddr.

Referenced by Wavefront::initRegState().

◆ isInvDone()

bool HSAQueueEntry::isInvDone ( ) const
inline

Is invalidate done?

Definition at line 355 of file hsa_queue_entry.hh.

References _outstandingInvs.

Referenced by ComputeUnit::dispWorkgroup().

◆ isInvStarted()

bool HSAQueueEntry::isInvStarted ( )
inline

Whether invalidate has started or finished -1 is the initial value indicating inv has not started for the kernel.

Definition at line 325 of file hsa_queue_entry.hh.

References _outstandingInvs.

Referenced by Shader::prepareInvalidate().

◆ kernargAddr()

Addr HSAQueueEntry::kernargAddr ( ) const
inline

Definition at line 184 of file hsa_queue_entry.hh.

References kernargAddress.

Referenced by Wavefront::initRegState().

◆ kernelName()

const std::string& HSAQueueEntry::kernelName ( ) const
inline

Definition at line 116 of file hsa_queue_entry.hh.

References kernName.

Referenced by GPUDispatcher::dispatch().

◆ ldsSize()

int HSAQueueEntry::ldsSize ( ) const
inline

Definition at line 190 of file hsa_queue_entry.hh.

References _ldsSize.

Referenced by ComputeUnit::dispWorkgroup(), and ComputeUnit::hasDispResources().

◆ markInvDone()

void HSAQueueEntry::markInvDone ( )
inline

Forcefully change the state to be inv done.

Definition at line 346 of file hsa_queue_entry.hh.

References _outstandingInvs.

◆ markWgDispatch()

void HSAQueueEntry::markWgDispatch ( )
inline

Definition at line 261 of file hsa_queue_entry.hh.

References _globalWgId, _wgId, dispatchComplete, gridSize(), wgId(), and wgSize().

Referenced by Shader::dispatchWorkgroups().

◆ notifyWgCompleted()

void HSAQueueEntry::notifyWgCompleted ( )
inline

Definition at line 243 of file hsa_queue_entry.hh.

References _numWgCompleted.

◆ numScalarRegs()

int HSAQueueEntry::numScalarRegs ( ) const
inline

◆ numVectorRegs()

int HSAQueueEntry::numVectorRegs ( ) const
inline

◆ numWg()

int HSAQueueEntry::numWg ( int  dim) const
inline

Definition at line 236 of file hsa_queue_entry.hh.

References _numWg, and MAX_DIM.

Referenced by ComputeUnit::startWavefront().

◆ numWgAtBarrier()

int HSAQueueEntry::numWgAtBarrier ( ) const
inline

Definition at line 282 of file hsa_queue_entry.hh.

References numWgArrivedAtBarrier.

◆ numWgCompleted()

int HSAQueueEntry::numWgCompleted ( ) const
inline

Definition at line 249 of file hsa_queue_entry.hh.

References _numWgCompleted.

◆ numWgTotal()

int HSAQueueEntry::numWgTotal ( ) const
inline

Definition at line 255 of file hsa_queue_entry.hh.

References _numWgTotal.

◆ outstandingInvs()

int HSAQueueEntry::outstandingInvs ( )
inline

Definition at line 315 of file hsa_queue_entry.hh.

References _outstandingInvs.

Referenced by Shader::prepareInvalidate().

◆ outstandingWbs()

int HSAQueueEntry::outstandingWbs ( ) const
inline

Definition at line 362 of file hsa_queue_entry.hh.

References _outstandingWbs.

◆ parseKernelCode()

void HSAQueueEntry::parseKernelCode ( AMDKernelCode akc)
inlineprivate

◆ privMemPerItem()

int HSAQueueEntry::privMemPerItem ( ) const
inline

Definition at line 195 of file hsa_queue_entry.hh.

References _privMemPerItem.

◆ queueId()

uint32_t HSAQueueEntry::queueId ( ) const
inline

◆ sgprBitEnabled()

bool HSAQueueEntry::sgprBitEnabled ( int  bit) const
inline

Definition at line 292 of file hsa_queue_entry.hh.

References initialSgprState.

Referenced by Wavefront::initRegState().

◆ updateOutstandingInvs()

void HSAQueueEntry::updateOutstandingInvs ( int  val)
inline

update the number of pending invalidate requests

val: negative to decrement, positive to increment

Definition at line 336 of file hsa_queue_entry.hh.

References _outstandingInvs, and X86ISA::val.

◆ updateOutstandingWbs()

void HSAQueueEntry::updateOutstandingWbs ( int  val)
inline

Update the number of pending writeback requests.

val: negative to decrement, positive to increment

Definition at line 373 of file hsa_queue_entry.hh.

References _outstandingWbs, and X86ISA::val.

◆ vgprBitEnabled()

bool HSAQueueEntry::vgprBitEnabled ( int  bit) const
inline

Definition at line 287 of file hsa_queue_entry.hh.

References initialVgprState.

Referenced by Wavefront::initRegState().

◆ wgId() [1/2]

int HSAQueueEntry::wgId ( int  dim) const
inline

Definition at line 210 of file hsa_queue_entry.hh.

References _wgId, and MAX_DIM.

Referenced by Wavefront::computeActualWgSz(), ComputeUnit::hasDispResources(), and markWgDispatch().

◆ wgId() [2/2]

void HSAQueueEntry::wgId ( int  dim,
int  val 
)
inline

Definition at line 217 of file hsa_queue_entry.hh.

References _wgId, MAX_DIM, and X86ISA::val.

◆ wgSize()

int HSAQueueEntry::wgSize ( int  dim) const
inline

Member Data Documentation

◆ _completionSignal

Addr HSAQueueEntry::_completionSignal
private

Definition at line 442 of file hsa_queue_entry.hh.

Referenced by completionSignal().

◆ _contextId

int HSAQueueEntry::_contextId
private

Definition at line 466 of file hsa_queue_entry.hh.

Referenced by contextId().

◆ _dispatchId

int HSAQueueEntry::_dispatchId
private

Definition at line 436 of file hsa_queue_entry.hh.

Referenced by dispatchId().

◆ _globalWgId

int HSAQueueEntry::_globalWgId
private

Definition at line 473 of file hsa_queue_entry.hh.

Referenced by globalWgId(), and markWgDispatch().

◆ _gridSize

std::array<int, MAX_DIM> HSAQueueEntry::_gridSize
private

Definition at line 429 of file hsa_queue_entry.hh.

Referenced by gridSize().

◆ _hostDispPktAddr

Addr HSAQueueEntry::_hostDispPktAddr
private

Definition at line 440 of file hsa_queue_entry.hh.

Referenced by hostDispPktAddr().

◆ _ldsSize

int HSAQueueEntry::_ldsSize
private

Definition at line 464 of file hsa_queue_entry.hh.

Referenced by ldsSize().

◆ _numWg

std::array<int, MAX_DIM> HSAQueueEntry::_numWg
private

Definition at line 468 of file hsa_queue_entry.hh.

Referenced by numWg().

◆ _numWgCompleted

int HSAQueueEntry::_numWgCompleted
private

Definition at line 472 of file hsa_queue_entry.hh.

Referenced by notifyWgCompleted(), and numWgCompleted().

◆ _numWgTotal

int HSAQueueEntry::_numWgTotal
private

Definition at line 469 of file hsa_queue_entry.hh.

Referenced by numWgTotal().

◆ _outstandingInvs

int HSAQueueEntry::_outstandingInvs
private

Number of outstanding invs for the kernel.

values: -1: initial value, invalidate has not started for the kernel 0: 1)-1->0, about to start (a transient state, added in the same cycle) 2)+1->0, all inv requests are finished, i.e., invalidate done ?: positive value, indicating the number of pending inv requests

Definition at line 455 of file hsa_queue_entry.hh.

Referenced by isInvDone(), isInvStarted(), markInvDone(), outstandingInvs(), and updateOutstandingInvs().

◆ _outstandingWbs

int HSAQueueEntry::_outstandingWbs
private

Number of outstanding wbs for the kernel values: 0: 1)initial value, flush has not started for the kernel 2)+1->0: all wb requests are finished, i.e., flush done ?: positive value, indicating the number of pending wb requests.

Definition at line 463 of file hsa_queue_entry.hh.

Referenced by outstandingWbs(), and updateOutstandingWbs().

◆ _privMemPerItem

int HSAQueueEntry::_privMemPerItem
private

Definition at line 465 of file hsa_queue_entry.hh.

Referenced by privMemPerItem().

◆ _queueId

uint32_t HSAQueueEntry::_queueId
private

Definition at line 435 of file hsa_queue_entry.hh.

Referenced by queueId().

◆ _wgId

std::array<int, MAX_DIM> HSAQueueEntry::_wgId
private

Definition at line 467 of file hsa_queue_entry.hh.

Referenced by markWgDispatch(), and wgId().

◆ _wgSize

std::array<int, MAX_DIM> HSAQueueEntry::_wgSize
private

Definition at line 427 of file hsa_queue_entry.hh.

Referenced by wgSize().

◆ amdQueue

_amd_queue_t HSAQueueEntry::amdQueue

Keep a copy of the AMD HSA queue because we need info from some of its fields to initialize register state.

Definition at line 308 of file hsa_queue_entry.hh.

Referenced by Wavefront::initRegState(), and GPUCommandProcessor::ReadDispIdOffsetDmaEvent::process().

◆ codeAddress

Addr HSAQueueEntry::codeAddress
private

Definition at line 444 of file hsa_queue_entry.hh.

Referenced by codeAddr().

◆ dispatchComplete

bool HSAQueueEntry::dispatchComplete
private

Definition at line 474 of file hsa_queue_entry.hh.

Referenced by dispComplete(), and markWgDispatch().

◆ dispPkt

void* HSAQueueEntry::dispPkt
private

Definition at line 438 of file hsa_queue_entry.hh.

Referenced by dispPktPtr().

◆ hostAMDQueueAddr

Addr HSAQueueEntry::hostAMDQueueAddr

Host-side addr of the amd_queue_t on which this task was queued.

Definition at line 301 of file hsa_queue_entry.hh.

Referenced by Wavefront::initRegState(), and GPUCommandProcessor::ReadDispIdOffsetDmaEvent::process().

◆ initialSgprState

std::bitset<NumScalarInitFields> HSAQueueEntry::initialSgprState
private

Definition at line 477 of file hsa_queue_entry.hh.

Referenced by parseKernelCode(), and sgprBitEnabled().

◆ initialVgprState

std::bitset<NumVectorInitFields> HSAQueueEntry::initialVgprState
private

Definition at line 476 of file hsa_queue_entry.hh.

Referenced by parseKernelCode(), and vgprBitEnabled().

◆ kernargAddress

Addr HSAQueueEntry::kernargAddress
private

Definition at line 446 of file hsa_queue_entry.hh.

Referenced by kernargAddr().

◆ kernName

std::string HSAQueueEntry::kernName
private

Definition at line 425 of file hsa_queue_entry.hh.

Referenced by kernelName().

◆ MAX_DIM

const static int HSAQueueEntry::MAX_DIM = 3
static

◆ numSgprs

int HSAQueueEntry::numSgprs
private

Definition at line 433 of file hsa_queue_entry.hh.

Referenced by numScalarRegs().

◆ numVgprs

int HSAQueueEntry::numVgprs
private

Definition at line 431 of file hsa_queue_entry.hh.

Referenced by numVectorRegs().

◆ numWgArrivedAtBarrier

int HSAQueueEntry::numWgArrivedAtBarrier
private

Definition at line 470 of file hsa_queue_entry.hh.

Referenced by numWgAtBarrier().


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

Generated on Wed Sep 30 2020 14:02:26 for gem5 by doxygen 1.8.17