Signal Fix: Added signal limit to allocSignal
1. Did not change the logic in allocSignal
2. Added guard to wait on signal limit
Change-Id: I78f29097e6a584b3c3d78319dac19869067bd1fe
[ROCm/hip commit: 1859c6e515]
This commit is contained in:
@@ -293,6 +293,8 @@ ihipDevice_t * ihipStream_t::getDevice() const
|
||||
return ::getDevice(_device_index);
|
||||
};
|
||||
|
||||
#define HIP_NUM_SIGNALS_PER_STREAM 32
|
||||
|
||||
|
||||
//---
|
||||
// Allocate a new signal from the signal pool.
|
||||
@@ -301,8 +303,16 @@ ihipDevice_t * ihipStream_t::getDevice() const
|
||||
ihipSignal_t *ihipStream_t::allocSignal(LockedAccessor_StreamCrit_t &crit)
|
||||
{
|
||||
int numToScan = crit->_signalPool.size();
|
||||
|
||||
crit->_signalCnt++;
|
||||
if(crit->_signalCnt == HIP_NUM_SIGNALS_PER_STREAM){
|
||||
crit->_signalCnt = 0;
|
||||
this->wait(crit);
|
||||
}
|
||||
|
||||
do {
|
||||
auto thisCursor = crit->_signalCursor;
|
||||
|
||||
if (++crit->_signalCursor == crit->_signalPool.size()) {
|
||||
crit->_signalCursor = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user