Simplify peekIsSubmitted.

Change-Id: I7947afc01ee9cb3a35e35530bd7d8c6b13f4d277
Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:
Mrozek, Michal
2019-07-09 14:26:03 +02:00
committed by sys_ocldev
parent 8fca10095e
commit d68f4e2591
3 changed files with 5 additions and 15 deletions

View File

@ -395,7 +395,7 @@ void Event::unblockEventsBlockedByThis(int32_t transitionStatus) {
int32_t status = transitionStatus;
(void)status;
DEBUG_BREAK_IF(!(isStatusCompleted(&status) || (peekIsSubmitted(&status))));
DEBUG_BREAK_IF(!(isStatusCompleted(&status) || (peekIsSubmitted(status))));
uint32_t taskLevelToPropagate = Event::eventNotReady;
@ -565,7 +565,7 @@ inline void Event::unblockEventBy(Event &event, uint32_t taskLevel, int32_t tran
DEBUG_BREAK_IF(numEventsBlockingThis < 0);
int32_t blockerStatus = transitionStatus;
DEBUG_BREAK_IF(!(isStatusCompleted(&blockerStatus) || peekIsSubmitted(&blockerStatus)));
DEBUG_BREAK_IF(!(isStatusCompleted(&blockerStatus) || peekIsSubmitted(blockerStatus)));
if ((numEventsBlockingThis > 0) && (isStatusCompletedByTermination(blockerStatus) == false)) {
return;

View File

@ -188,12 +188,8 @@ class Event : public BaseObject<_cl_event>, public IDNode<Event> {
return executionStatusSnapshot < 0;
}
bool peekIsSubmitted(const int32_t *executionStatusSnapshot = nullptr) const {
if (executionStatusSnapshot == nullptr) {
return (peekExecutionStatus() == CL_SUBMITTED);
} else {
return (*executionStatusSnapshot == CL_SUBMITTED);
}
bool peekIsSubmitted(const int32_t executionStatusSnapshot) const {
return executionStatusSnapshot == CL_SUBMITTED;
}
bool peekIsCmdSubmitted() {

View File

@ -1195,16 +1195,10 @@ TEST_F(InternalsEventWithPerfCountersTest, SetPerfCounter_AvailFalse) {
delete pCmdQ;
}
TEST_F(EventTest, GivenNullptrWhenpeekIsSubmittedThenFalse) {
Event ev(this->pCmdQ, CL_COMMAND_COPY_BUFFER, 3, 0);
bool executionStatus = ev.peekIsSubmitted(nullptr);
EXPECT_NE(true, executionStatus);
}
TEST_F(EventTest, GivenCL_SUBMITTEDWhenpeekIsSubmittedThenTrue) {
Event ev(this->pCmdQ, CL_COMMAND_COPY_BUFFER, 3, 0);
int32_t executionStatusSnapshot = CL_SUBMITTED;
bool executionStatus = ev.peekIsSubmitted(&executionStatusSnapshot);
bool executionStatus = ev.peekIsSubmitted(executionStatusSnapshot);
EXPECT_EQ(true, executionStatus);
}