mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Simplify peekIsSubmitted.
Change-Id: I7947afc01ee9cb3a35e35530bd7d8c6b13f4d277 Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
8fca10095e
commit
d68f4e2591
@ -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;
|
||||
|
@ -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() {
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user