mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 17:00:59 +08:00
Rename levelNotReady to notReady
Change-Id: Id482c6edd36d1bdd63558aa35f13dbb57e0efbad Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
5293b26dc6
commit
7ef2e4304c
@@ -143,7 +143,7 @@ volatile uint32_t *CommandQueue::getHwTagAddress() const {
|
||||
|
||||
bool CommandQueue::isCompleted(uint32_t taskCount) const {
|
||||
uint32_t tag = getHwTag();
|
||||
DEBUG_BREAK_IF(tag == CompletionStamp::levelNotReady);
|
||||
DEBUG_BREAK_IF(tag == CompletionStamp::notReady);
|
||||
return tag >= taskCount;
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ cl_int CommandQueue::enqueueReleaseSharedObjects(cl_uint numObjects, const cl_me
|
||||
void CommandQueue::updateFromCompletionStamp(const CompletionStamp &completionStamp) {
|
||||
DEBUG_BREAK_IF(this->taskLevel > completionStamp.taskLevel);
|
||||
DEBUG_BREAK_IF(this->taskCount > completionStamp.taskCount);
|
||||
if (completionStamp.taskCount != CompletionStamp::levelNotReady) {
|
||||
if (completionStamp.taskCount != CompletionStamp::notReady) {
|
||||
taskCount = completionStamp.taskCount;
|
||||
}
|
||||
flushStamp->setStamp(completionStamp.flushStamp);
|
||||
|
||||
@@ -45,7 +45,7 @@ void *CommandQueue::cpuDataTransferHandler(TransferProperties &transferPropertie
|
||||
}
|
||||
|
||||
if (eventsRequest.outEvent) {
|
||||
eventBuilder.create<Event>(this, transferProperties.cmdType, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
eventBuilder.create<Event>(this, transferProperties.cmdType, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
outEventObj = eventBuilder.getEvent();
|
||||
outEventObj->setQueueTimeStamp();
|
||||
outEventObj->setCPUProfilingPath(true);
|
||||
|
||||
@@ -159,7 +159,7 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
|
||||
}
|
||||
EventBuilder eventBuilder;
|
||||
if (event) {
|
||||
eventBuilder.create<Event>(this, commandType, CompletionStamp::levelNotReady, 0);
|
||||
eventBuilder.create<Event>(this, commandType, CompletionStamp::notReady, 0);
|
||||
*event = eventBuilder.getEvent();
|
||||
if (eventBuilder.getEvent()->isProfilingEnabled()) {
|
||||
eventBuilder.getEvent()->setQueueTimeStamp(&queueTimeStamp);
|
||||
@@ -271,7 +271,7 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
|
||||
}
|
||||
}
|
||||
|
||||
CompletionStamp completionStamp = {CompletionStamp::levelNotReady, taskLevel, 0};
|
||||
CompletionStamp completionStamp = {CompletionStamp::notReady, taskLevel, 0};
|
||||
|
||||
const EnqueueProperties enqueueProperties(blitEnqueue, !multiDispatchInfo.empty(), isCacheFlushCommand(commandType),
|
||||
flushDependenciesForNonKernelCommand, &blitPropertiesContainer);
|
||||
@@ -617,7 +617,7 @@ template <typename GfxFamily>
|
||||
void CommandQueueHw<GfxFamily>::obtainTaskLevelAndBlockedStatus(unsigned int &taskLevel, cl_uint &numEventsInWaitList, const cl_event *&eventWaitList, bool &blockQueueStatus, unsigned int commandType) {
|
||||
auto isQueueBlockedStatus = isQueueBlocked();
|
||||
taskLevel = getTaskLevelFromWaitList(this->taskLevel, numEventsInWaitList, eventWaitList);
|
||||
blockQueueStatus = (taskLevel == CompletionStamp::levelNotReady) || isQueueBlockedStatus;
|
||||
blockQueueStatus = (taskLevel == CompletionStamp::notReady) || isQueueBlockedStatus;
|
||||
|
||||
auto taskLevelUpdateRequired = isTaskLevelUpdateRequired(taskLevel, eventWaitList, numEventsInWaitList, commandType);
|
||||
if (taskLevelUpdateRequired) {
|
||||
@@ -630,7 +630,7 @@ template <typename GfxFamily>
|
||||
bool CommandQueueHw<GfxFamily>::isTaskLevelUpdateRequired(const uint32_t &taskLevel, const cl_event *eventWaitList, const cl_uint &numEventsInWaitList, unsigned int commandType) {
|
||||
bool updateTaskLevel = true;
|
||||
//if we are blocked by user event then no update
|
||||
if (taskLevel == CompletionStamp::levelNotReady) {
|
||||
if (taskLevel == CompletionStamp::notReady) {
|
||||
updateTaskLevel = false;
|
||||
}
|
||||
//if we are executing command without kernel then it will inherit state from
|
||||
@@ -796,7 +796,7 @@ CompletionStamp CommandQueueHw<GfxFamily>::enqueueNonBlocked(
|
||||
dispatchFlags.csrDependencies.makeResident(getGpgpuCommandStreamReceiver());
|
||||
}
|
||||
|
||||
DEBUG_BREAK_IF(taskLevel >= CompletionStamp::levelNotReady);
|
||||
DEBUG_BREAK_IF(taskLevel >= CompletionStamp::notReady);
|
||||
|
||||
if (anyUncacheableArgs) {
|
||||
dispatchFlags.l3CacheSettings = L3CachingSettings::l3CacheOff;
|
||||
|
||||
@@ -37,7 +37,7 @@ void AsyncEventsHandler::registerEvent(Event *event) {
|
||||
}
|
||||
|
||||
Event *AsyncEventsHandler::processList() {
|
||||
uint32_t lowestTaskCount = CompletionStamp::levelNotReady;
|
||||
uint32_t lowestTaskCount = CompletionStamp::notReady;
|
||||
Event *sleepCandidate = nullptr;
|
||||
pendingList.clear();
|
||||
|
||||
|
||||
@@ -360,7 +360,7 @@ void Event::calculateProfilingDataInternal(uint64_t contextStartTS, uint64_t con
|
||||
}
|
||||
|
||||
inline bool Event::wait(bool blocking, bool useQuickKmdSleep) {
|
||||
while (this->taskCount == CompletionStamp::levelNotReady) {
|
||||
while (this->taskCount == CompletionStamp::notReady) {
|
||||
if (blocking == false) {
|
||||
return false;
|
||||
}
|
||||
@@ -369,7 +369,7 @@ inline bool Event::wait(bool blocking, bool useQuickKmdSleep) {
|
||||
cmdQueue->waitUntilComplete(taskCount.load(), flushStamp->peekStamp(), useQuickKmdSleep);
|
||||
updateExecutionStatus();
|
||||
|
||||
DEBUG_BREAK_IF(this->taskLevel == CompletionStamp::levelNotReady && this->executionStatus >= 0);
|
||||
DEBUG_BREAK_IF(this->taskLevel == CompletionStamp::notReady && this->executionStatus >= 0);
|
||||
|
||||
auto *allocationStorage = cmdQueue->getGpgpuCommandStreamReceiver().getInternalAllocationStorage();
|
||||
allocationStorage->cleanAllocationList(this->taskCount, TEMPORARY_ALLOCATION);
|
||||
@@ -378,7 +378,7 @@ inline bool Event::wait(bool blocking, bool useQuickKmdSleep) {
|
||||
}
|
||||
|
||||
void Event::updateExecutionStatus() {
|
||||
if (taskLevel == CompletionStamp::levelNotReady) {
|
||||
if (taskLevel == CompletionStamp::notReady) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -434,11 +434,11 @@ void Event::unblockEventsBlockedByThis(int32_t transitionStatus) {
|
||||
(void)status;
|
||||
DEBUG_BREAK_IF(!(isStatusCompleted(status) || (peekIsSubmitted(status))));
|
||||
|
||||
uint32_t taskLevelToPropagate = CompletionStamp::levelNotReady;
|
||||
uint32_t taskLevelToPropagate = CompletionStamp::notReady;
|
||||
|
||||
if (isStatusCompletedByTermination(transitionStatus) == false) {
|
||||
//if we are event on top of the tree , obtain taskLevel from CSR
|
||||
if (taskLevel == CompletionStamp::levelNotReady) {
|
||||
if (taskLevel == CompletionStamp::notReady) {
|
||||
this->taskLevel = getTaskLevel(); // NOLINT(clang-analyzer-optin.cplusplus.VirtualCall)
|
||||
taskLevelToPropagate = this->taskLevel;
|
||||
} else {
|
||||
@@ -535,7 +535,7 @@ void Event::submitCommand(bool abortTasks) {
|
||||
} else if (profilingCpuPath && endTimeStamp == 0) {
|
||||
setEndTimeStamp();
|
||||
}
|
||||
if (this->taskCount == CompletionStamp::levelNotReady) {
|
||||
if (this->taskCount == CompletionStamp::notReady) {
|
||||
if (!this->isUserEvent() && this->eventWithoutCommand) {
|
||||
if (this->cmdQueue) {
|
||||
auto lockCSR = this->getCommandQueue()->getGpgpuCommandStreamReceiver().obtainUniqueOwnership();
|
||||
@@ -559,7 +559,7 @@ cl_int Event::waitForEvents(cl_uint numEvents,
|
||||
for (const cl_event *it = eventList, *end = eventList + numEvents; it != end; ++it) {
|
||||
Event *event = castToObjectOrAbort<Event>(*it);
|
||||
if (event->cmdQueue) {
|
||||
if (event->taskLevel != CompletionStamp::levelNotReady) {
|
||||
if (event->taskLevel != CompletionStamp::notReady) {
|
||||
event->cmdQueue->flush();
|
||||
}
|
||||
}
|
||||
@@ -609,7 +609,7 @@ inline void Event::unblockEventBy(Event &event, uint32_t taskLevel, int32_t tran
|
||||
}
|
||||
DBG_LOG(EventsDebugEnable, "Event", this, "is unblocked by", &event);
|
||||
|
||||
if (this->taskLevel == CompletionStamp::levelNotReady) {
|
||||
if (this->taskLevel == CompletionStamp::notReady) {
|
||||
this->taskLevel = std::max(cmdQueue->getGpgpuCommandStreamReceiver().peekTaskLevel(), taskLevel);
|
||||
} else {
|
||||
this->taskLevel = std::max(this->taskLevel.load(), taskLevel);
|
||||
@@ -631,7 +631,7 @@ bool Event::updateStatusAndCheckCompletion() {
|
||||
}
|
||||
|
||||
bool Event::isReadyForSubmission() {
|
||||
return taskLevel != CompletionStamp::levelNotReady ? true : false;
|
||||
return taskLevel != CompletionStamp::notReady ? true : false;
|
||||
}
|
||||
|
||||
void Event::addCallback(Callback::ClbFuncT fn, cl_int type, void *data) {
|
||||
@@ -700,7 +700,7 @@ void Event::tryFlushEvent() {
|
||||
//only if event is not completed, completed event has already been flushed
|
||||
if (cmdQueue && updateStatusAndCheckCompletion() == false) {
|
||||
//flush the command queue only if it is not blocked event
|
||||
if (taskLevel != CompletionStamp::levelNotReady) {
|
||||
if (taskLevel != CompletionStamp::notReady) {
|
||||
cmdQueue->getGpgpuCommandStreamReceiver().flushBatchedSubmissions();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,13 +244,13 @@ class Event : public BaseObject<_cl_event>, public IDNode<Event> {
|
||||
virtual void unblockEventBy(Event &event, uint32_t taskLevel, int32_t transitionStatus);
|
||||
|
||||
void updateTaskCount(uint32_t taskCount) {
|
||||
if (taskCount == CompletionStamp::levelNotReady) {
|
||||
if (taskCount == CompletionStamp::notReady) {
|
||||
DEBUG_BREAK_IF(true);
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t prevTaskCount = this->taskCount.exchange(taskCount);
|
||||
if ((prevTaskCount != CompletionStamp::levelNotReady) && (prevTaskCount > taskCount)) {
|
||||
if ((prevTaskCount != CompletionStamp::notReady) && (prevTaskCount > taskCount)) {
|
||||
this->taskCount = prevTaskCount;
|
||||
DEBUG_BREAK_IF(true);
|
||||
}
|
||||
@@ -322,7 +322,7 @@ class Event : public BaseObject<_cl_event>, public IDNode<Event> {
|
||||
bool calcProfilingData();
|
||||
MOCKABLE_VIRTUAL void calculateProfilingDataInternal(uint64_t contextStartTS, uint64_t contextEndTS, uint64_t *contextCompleteTS, uint64_t globalStartTS);
|
||||
MOCKABLE_VIRTUAL void synchronizeTaskCount() {
|
||||
while (this->taskCount == CompletionStamp::levelNotReady)
|
||||
while (this->taskCount == CompletionStamp::notReady)
|
||||
;
|
||||
};
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ void EventBuilder::finalize() {
|
||||
|
||||
//do not add as child if:
|
||||
//parent has no parents and is not blocked
|
||||
if (!(parent->peekIsBlocked() == false && parent->taskLevel != CompletionStamp::levelNotReady) ||
|
||||
if (!(parent->peekIsBlocked() == false && parent->taskLevel != CompletionStamp::notReady) ||
|
||||
(!parent->isEventWithoutCommand() && !parent->peekIsCmdSubmitted())) {
|
||||
parent->addChild(*this->event);
|
||||
}
|
||||
|
||||
@@ -46,14 +46,14 @@ void EventsTracker::dumpQueue(CommandQueue *cmdQ, std::ostream &out, CmdqSet &du
|
||||
out << label(cmdQ) << "[label=\"{------CmdQueue, ptr=" << cmdQ << "------|task count=";
|
||||
auto taskCount = cmdQ->taskCount;
|
||||
auto taskLevel = cmdQ->taskLevel;
|
||||
if (taskCount == CompletionStamp::levelNotReady) {
|
||||
if (taskCount == CompletionStamp::notReady) {
|
||||
out << "NOT_READY";
|
||||
} else {
|
||||
out << taskCount;
|
||||
}
|
||||
|
||||
out << ", level=";
|
||||
if (taskLevel == CompletionStamp::levelNotReady) {
|
||||
if (taskLevel == CompletionStamp::notReady) {
|
||||
out << "NOT_READY";
|
||||
} else {
|
||||
out << taskLevel;
|
||||
@@ -96,14 +96,14 @@ void EventsTracker::dumpNode(Event *node, std::ostream &out, const EventIdMap &e
|
||||
"|"
|
||||
<< commandType << "|" << status[statusId] << "|"
|
||||
"task count=";
|
||||
if (taskCount == CompletionStamp::levelNotReady) {
|
||||
if (taskCount == CompletionStamp::notReady) {
|
||||
out << "NOT_READY";
|
||||
} else {
|
||||
out << taskCount;
|
||||
}
|
||||
|
||||
out << ", level=";
|
||||
if (taskLevel == CompletionStamp::levelNotReady) {
|
||||
if (taskLevel == CompletionStamp::notReady) {
|
||||
out << "NOT_READY";
|
||||
} else {
|
||||
out << taskLevel;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
namespace NEO {
|
||||
|
||||
UserEvent::UserEvent(Context *ctx)
|
||||
: Event(ctx, nullptr, CL_COMMAND_USER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady) {
|
||||
: Event(ctx, nullptr, CL_COMMAND_USER, CompletionStamp::notReady, CompletionStamp::notReady) {
|
||||
transitionExecutionStatus(CL_QUEUED);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ uint32_t UserEvent::getTaskLevel() {
|
||||
if (peekExecutionStatus() == CL_COMPLETE) {
|
||||
return 0;
|
||||
}
|
||||
return CompletionStamp::levelNotReady;
|
||||
return CompletionStamp::notReady;
|
||||
}
|
||||
|
||||
bool UserEvent::isInitialEventStatus() const {
|
||||
@@ -45,7 +45,7 @@ bool UserEvent::isInitialEventStatus() const {
|
||||
}
|
||||
|
||||
VirtualEvent::VirtualEvent(CommandQueue *cmdQ, Context *ctx)
|
||||
: Event(ctx, cmdQ, -1, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady) {
|
||||
: Event(ctx, cmdQ, -1, CompletionStamp::notReady, CompletionStamp::notReady) {
|
||||
transitionExecutionStatus(CL_QUEUED);
|
||||
|
||||
// internal object - no need for API refcount
|
||||
|
||||
@@ -74,7 +74,7 @@ CompletionStamp &CommandMapUnmap::submit(uint32_t taskLevel, bool terminated) {
|
||||
false //usePerDssBackedBuffer
|
||||
);
|
||||
|
||||
DEBUG_BREAK_IF(taskLevel >= CompletionStamp::levelNotReady);
|
||||
DEBUG_BREAK_IF(taskLevel >= CompletionStamp::notReady);
|
||||
|
||||
gtpinNotifyPreFlushTask(&commandQueue);
|
||||
|
||||
@@ -248,7 +248,7 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate
|
||||
dispatchFlags.epilogueRequired = true;
|
||||
}
|
||||
|
||||
DEBUG_BREAK_IF(taskLevel >= CompletionStamp::levelNotReady);
|
||||
DEBUG_BREAK_IF(taskLevel >= CompletionStamp::notReady);
|
||||
|
||||
gtpinNotifyPreFlushTask(&commandQueue);
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ void serverWaitForArbSyncObject(OSInterface &osInterface, CL_GL_SYNC_INFO &glSyn
|
||||
}
|
||||
|
||||
GlArbSyncEvent::GlArbSyncEvent(Context &context)
|
||||
: Event(&context, nullptr, CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady),
|
||||
: Event(&context, nullptr, CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR, CompletionStamp::notReady, CompletionStamp::notReady),
|
||||
glSyncInfo(std::make_unique<CL_GL_SYNC_INFO>()) {
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
namespace NEO {
|
||||
GlSyncEvent::GlSyncEvent(Context &context, const GL_CL_SYNC_INFO &sync)
|
||||
: Event(&context, nullptr, CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady),
|
||||
: Event(&context, nullptr, CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR, CompletionStamp::notReady, CompletionStamp::notReady),
|
||||
glSync(std::make_unique<GL_CL_SYNC_INFO>(sync)) {
|
||||
transitionExecutionStatus(CL_SUBMITTED);
|
||||
}
|
||||
@@ -58,6 +58,6 @@ uint32_t GlSyncEvent::getTaskLevel() {
|
||||
if (peekExecutionStatus() == CL_COMPLETE) {
|
||||
return 0;
|
||||
}
|
||||
return CompletionStamp::levelNotReady;
|
||||
return CompletionStamp::notReady;
|
||||
}
|
||||
} // namespace NEO
|
||||
|
||||
@@ -688,12 +688,12 @@ HWTEST_F(CommandQueueHwTest, GivenEventThatIsNotCompletedWhenFinishIsCalledAndIt
|
||||
};
|
||||
auto Value = 0u;
|
||||
|
||||
auto ev = new Event(this->pCmdQ, CL_COMMAND_COPY_BUFFER, 3, CompletionStamp::levelNotReady + 1);
|
||||
auto ev = new Event(this->pCmdQ, CL_COMMAND_COPY_BUFFER, 3, CompletionStamp::notReady + 1);
|
||||
clSetEventCallback(ev, CL_COMPLETE, ClbFuncTempStruct::ClbFuncT, &Value);
|
||||
|
||||
auto &csr = this->pCmdQ->getGpgpuCommandStreamReceiver();
|
||||
EXPECT_GT(3u, csr.peekTaskCount());
|
||||
*csr.getTagAddress() = CompletionStamp::levelNotReady + 1;
|
||||
*csr.getTagAddress() = CompletionStamp::notReady + 1;
|
||||
ret = clFinish(this->pCmdQ);
|
||||
ASSERT_EQ(CL_SUCCESS, ret);
|
||||
|
||||
@@ -923,14 +923,14 @@ HWTEST_F(CommandQueueHwTest, givenCommandQueueThatIsBlockedAndUsesCpuCopyWhenEve
|
||||
MockBuffer buffer;
|
||||
cl_event returnEvent = nullptr;
|
||||
auto retVal = CL_SUCCESS;
|
||||
cmdQHw->taskLevel = CompletionStamp::levelNotReady;
|
||||
cmdQHw->taskLevel = CompletionStamp::notReady;
|
||||
size_t offset = 0;
|
||||
size_t size = 4096u;
|
||||
TransferProperties transferProperties(&buffer, CL_COMMAND_READ_BUFFER, 0, false, &offset, &size, nullptr, false, pDevice->getRootDeviceIndex());
|
||||
EventsRequest eventsRequest(0, nullptr, &returnEvent);
|
||||
cmdQHw->cpuDataTransferHandler(transferProperties, eventsRequest, retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, castToObject<Event>(returnEvent)->peekTaskCount());
|
||||
EXPECT_EQ(CompletionStamp::notReady, castToObject<Event>(returnEvent)->peekTaskCount());
|
||||
clReleaseEvent(returnEvent);
|
||||
}
|
||||
|
||||
@@ -949,12 +949,12 @@ HWTEST_F(CommandQueueHwTest, givenEventWithRecordedCommandWhenSubmitCommandIsCal
|
||||
std::atomic_bool *atomicFence = nullptr;
|
||||
};
|
||||
|
||||
mockEvent neoEvent(this->pCmdQ, CL_COMMAND_MAP_BUFFER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
mockEvent neoEvent(this->pCmdQ, CL_COMMAND_MAP_BUFFER, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
neoEvent.atomicFence = &go;
|
||||
EXPECT_TRUE(neoEvent.eventWithoutCommand);
|
||||
neoEvent.eventWithoutCommand = false;
|
||||
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, neoEvent.peekTaskCount());
|
||||
EXPECT_EQ(CompletionStamp::notReady, neoEvent.peekTaskCount());
|
||||
|
||||
std::thread t([&]() {
|
||||
while (!go)
|
||||
@@ -1119,7 +1119,7 @@ HWTEST_F(CommandQueueHwTest, givenBlockedOutOfOrderQueueWhenUserEventIsSubmitted
|
||||
neoEvent->updateExecutionStatus();
|
||||
|
||||
EXPECT_EQ(neoEvent->peekExecutionStatus(), CL_QUEUED);
|
||||
EXPECT_EQ(neoEvent->peekTaskCount(), CompletionStamp::levelNotReady);
|
||||
EXPECT_EQ(neoEvent->peekTaskCount(), CompletionStamp::notReady);
|
||||
|
||||
clSetUserEventStatus(userEvent, 0u);
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ TEST(CommandQueue, givenTimeStampWithTaskCountNotReadyStatusWhenupdateFromComple
|
||||
cmdQ.taskCount = 1u;
|
||||
|
||||
CompletionStamp cs = {
|
||||
CompletionStamp::levelNotReady,
|
||||
CompletionStamp::notReady,
|
||||
0,
|
||||
0};
|
||||
cmdQ.updateFromCompletionStamp(cs);
|
||||
|
||||
@@ -241,7 +241,7 @@ HWTEST_F(BarrierTest, givenBlockedCommandQueueAndEnqueueBarrierWithWaitlistRetur
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
auto pEvent = (Event *)event;
|
||||
EXPECT_EQ(pEvent->peekTaskCount(), CompletionStamp::levelNotReady);
|
||||
EXPECT_EQ(pEvent->peekTaskCount(), CompletionStamp::notReady);
|
||||
event2.setStatus(CL_COMPLETE);
|
||||
clReleaseEvent(event);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ HWTEST_F(EnqueueHandlerTimestampEnabledTest, givenProflingAndTimeStampPacketsEna
|
||||
std::unique_ptr<GeneralSurface> surface(new GeneralSurface(allocation.get()));
|
||||
EventsRequest eventsRequest(0, nullptr, nullptr);
|
||||
EventBuilder eventBuilder;
|
||||
eventBuilder.create<MockEvent<Event>>(mockCmdQ.get(), CL_COMMAND_USER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
eventBuilder.create<MockEvent<Event>>(mockCmdQ.get(), CL_COMMAND_USER, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
auto ev = static_cast<MockEvent<UserEvent> *>(eventBuilder.getEvent());
|
||||
Surface *surfaces[] = {surface.get()};
|
||||
auto blocking = true;
|
||||
@@ -109,7 +109,7 @@ HWTEST_F(EnqueueHandlerTimestampDisabledTest, givenProflingEnabledTimeStampPacke
|
||||
std::unique_ptr<GeneralSurface> surface(new GeneralSurface(allocation.get()));
|
||||
EventsRequest eventsRequest(0, nullptr, nullptr);
|
||||
EventBuilder eventBuilder;
|
||||
eventBuilder.create<MockEvent<Event>>(mockCmdQ.get(), CL_COMMAND_USER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
eventBuilder.create<MockEvent<Event>>(mockCmdQ.get(), CL_COMMAND_USER, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
auto ev = static_cast<MockEvent<UserEvent> *>(eventBuilder.getEvent());
|
||||
Surface *surfaces[] = {surface.get()};
|
||||
auto blocking = true;
|
||||
|
||||
@@ -280,14 +280,14 @@ HWTEST_F(EnqueueHandlerTest, WhenEnqueuingHandlerForMarkerOnBlockedQueueThenTask
|
||||
auto mockCmdQ = std::unique_ptr<MockCommandQueueHw<FamilyType>>(new MockCommandQueueHw<FamilyType>(context, pClDevice, 0));
|
||||
|
||||
// put queue into initial blocked state
|
||||
mockCmdQ->taskLevel = CompletionStamp::levelNotReady;
|
||||
mockCmdQ->taskLevel = CompletionStamp::notReady;
|
||||
|
||||
mockCmdQ->enqueueMarkerWithWaitList(
|
||||
0,
|
||||
nullptr,
|
||||
nullptr);
|
||||
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, mockCmdQ->taskLevel);
|
||||
EXPECT_EQ(CompletionStamp::notReady, mockCmdQ->taskLevel);
|
||||
}
|
||||
|
||||
HWTEST_F(EnqueueHandlerTest, WhenEnqueuingBlockedWithoutReturnEventThenVirtualEventIsCreatedAndCommandQueueInternalRefCountIsIncremeted) {
|
||||
@@ -301,7 +301,7 @@ HWTEST_F(EnqueueHandlerTest, WhenEnqueuingBlockedWithoutReturnEventThenVirtualEv
|
||||
auto mockCmdQ = new MockCommandQueueHw<FamilyType>(context, pClDevice, 0);
|
||||
|
||||
// put queue into initial blocked state
|
||||
mockCmdQ->taskLevel = CompletionStamp::levelNotReady;
|
||||
mockCmdQ->taskLevel = CompletionStamp::notReady;
|
||||
|
||||
auto initialRefCountInternal = mockCmdQ->getRefInternalCount();
|
||||
|
||||
@@ -335,7 +335,7 @@ HWTEST_F(EnqueueHandlerTest, WhenEnqueuingBlockedThenVirtualEventIsSetAsCurrentC
|
||||
auto mockCmdQ = new MockCommandQueueHw<FamilyType>(context, pClDevice, 0);
|
||||
|
||||
// put queue into initial blocked state
|
||||
mockCmdQ->taskLevel = CompletionStamp::levelNotReady;
|
||||
mockCmdQ->taskLevel = CompletionStamp::notReady;
|
||||
|
||||
bool blocking = false;
|
||||
mockCmdQ->template enqueueHandler<CL_COMMAND_NDRANGE_KERNEL>(nullptr,
|
||||
|
||||
@@ -224,7 +224,7 @@ TEST_F(EnqueueReadBuffer, givenInOrderQueueAndForcedCpuCopyOnReadBufferAndEventN
|
||||
uint32_t taskLevelCmdQ = 17;
|
||||
pCmdQ->taskLevel = taskLevelCmdQ;
|
||||
|
||||
Event event1(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, 4);
|
||||
Event event1(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::notReady, 4);
|
||||
|
||||
cl_bool blockingRead = CL_FALSE;
|
||||
size_t size = sizeof(cl_float);
|
||||
@@ -248,8 +248,8 @@ TEST_F(EnqueueReadBuffer, givenInOrderQueueAndForcedCpuCopyOnReadBufferAndEventN
|
||||
ASSERT_NE(nullptr, event);
|
||||
|
||||
auto pEvent = (Event *)event;
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, pEvent->taskLevel);
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, pCmdQ->taskLevel);
|
||||
EXPECT_EQ(CompletionStamp::notReady, pEvent->taskLevel);
|
||||
EXPECT_EQ(CompletionStamp::notReady, pCmdQ->taskLevel);
|
||||
event1.taskLevel = 20;
|
||||
event1.setStatus(CL_COMPLETE);
|
||||
pEvent->updateExecutionStatus();
|
||||
|
||||
@@ -149,7 +149,7 @@ TEST_F(EnqueueWriteBufferTypeTest, givenInOrderQueueAndForcedCpuCopyOnWriteBuffe
|
||||
uint32_t taskLevelCmdQ = 17;
|
||||
pCmdQ->taskLevel = taskLevelCmdQ;
|
||||
|
||||
Event event1(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, 4);
|
||||
Event event1(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::notReady, 4);
|
||||
|
||||
cl_bool blockingWrite = CL_FALSE;
|
||||
size_t size = sizeof(cl_float);
|
||||
@@ -173,8 +173,8 @@ TEST_F(EnqueueWriteBufferTypeTest, givenInOrderQueueAndForcedCpuCopyOnWriteBuffe
|
||||
ASSERT_NE(nullptr, event);
|
||||
|
||||
auto pEvent = (Event *)event;
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, pEvent->taskLevel);
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, pCmdQ->taskLevel);
|
||||
EXPECT_EQ(CompletionStamp::notReady, pEvent->taskLevel);
|
||||
EXPECT_EQ(CompletionStamp::notReady, pCmdQ->taskLevel);
|
||||
event1.taskLevel = 20;
|
||||
event1.setStatus(CL_COMPLETE);
|
||||
pEvent->updateExecutionStatus();
|
||||
|
||||
@@ -48,9 +48,9 @@ class AsyncEventsHandlerTests : public ::testing::Test {
|
||||
handler.reset(new MockHandler());
|
||||
context = new NiceMock<MockContext>();
|
||||
|
||||
event1 = new NiceMock<MyEvent>(context, nullptr, CL_COMMAND_BARRIER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
event2 = new NiceMock<MyEvent>(context, nullptr, CL_COMMAND_BARRIER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
event3 = new NiceMock<MyEvent>(context, nullptr, CL_COMMAND_BARRIER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
event1 = new NiceMock<MyEvent>(context, nullptr, CL_COMMAND_BARRIER, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
event2 = new NiceMock<MyEvent>(context, nullptr, CL_COMMAND_BARRIER, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
event3 = new NiceMock<MyEvent>(context, nullptr, CL_COMMAND_BARRIER, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
@@ -89,7 +89,7 @@ TEST_F(AsyncEventsHandlerTests, givenEventsWhenListIsProcessedThenUpdateExecutio
|
||||
}
|
||||
|
||||
TEST_F(AsyncEventsHandlerTests, WhenProcessIsCompletedThenRefInternalCountIsDecremented) {
|
||||
event1->setTaskStamp(CompletionStamp::levelNotReady, 0);
|
||||
event1->setTaskStamp(CompletionStamp::notReady, 0);
|
||||
|
||||
handler->registerEvent(event1);
|
||||
EXPECT_EQ(2, event1->getRefInternalCount());
|
||||
@@ -100,7 +100,7 @@ TEST_F(AsyncEventsHandlerTests, WhenProcessIsCompletedThenRefInternalCountIsDecr
|
||||
|
||||
TEST_F(AsyncEventsHandlerTests, givenNotCalledCallbacksWhenListIsProcessedThenDontUnregister) {
|
||||
int submittedCounter(0), completeCounter(0);
|
||||
event1->setTaskStamp(CompletionStamp::levelNotReady, 0);
|
||||
event1->setTaskStamp(CompletionStamp::notReady, 0);
|
||||
event1->addCallback(&this->callbackFcn, CL_SUBMITTED, &submittedCounter);
|
||||
event1->addCallback(&this->callbackFcn, CL_COMPLETE, &completeCounter);
|
||||
handler->registerEvent(event1);
|
||||
@@ -160,7 +160,7 @@ TEST_F(AsyncEventsHandlerTests, givenExternallSynchronizedEventWhenListIsProcess
|
||||
}
|
||||
|
||||
TEST_F(AsyncEventsHandlerTests, givenDoubleRegisteredEventWhenListIsProcessedAndNoCallbacksToProcessThenUnregister) {
|
||||
event1->setTaskStamp(CompletionStamp::levelNotReady - 1, 0);
|
||||
event1->setTaskStamp(CompletionStamp::notReady - 1, 0);
|
||||
event1->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter);
|
||||
handler->registerEvent(event1);
|
||||
handler->registerEvent(event1);
|
||||
@@ -173,8 +173,8 @@ TEST_F(AsyncEventsHandlerTests, givenDoubleRegisteredEventWhenListIsProcessedAnd
|
||||
|
||||
TEST_F(AsyncEventsHandlerTests, givenEventsNotHandledByHandlderWhenDestructingThenUnreferenceAll) {
|
||||
auto myHandler = new MockHandler();
|
||||
event1->setTaskStamp(CompletionStamp::levelNotReady, 0);
|
||||
event2->setTaskStamp(CompletionStamp::levelNotReady, 0);
|
||||
event1->setTaskStamp(CompletionStamp::notReady, 0);
|
||||
event2->setTaskStamp(CompletionStamp::notReady, 0);
|
||||
event1->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter);
|
||||
event2->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter);
|
||||
|
||||
@@ -197,8 +197,8 @@ TEST_F(AsyncEventsHandlerTests, givenEventsNotHandledByHandlderWhenDestructingTh
|
||||
}
|
||||
|
||||
TEST_F(AsyncEventsHandlerTests, givenEventsNotHandledByHandlderWhenAsyncExecutionInterruptedThenUnreferenceAll) {
|
||||
event1->setTaskStamp(CompletionStamp::levelNotReady, 0);
|
||||
event2->setTaskStamp(CompletionStamp::levelNotReady, 0);
|
||||
event1->setTaskStamp(CompletionStamp::notReady, 0);
|
||||
event2->setTaskStamp(CompletionStamp::notReady, 0);
|
||||
event1->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter);
|
||||
event2->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter);
|
||||
|
||||
@@ -228,7 +228,7 @@ TEST_F(AsyncEventsHandlerTests, WhenHandlerIsCreatedThenThreadIsNotCreatedByDefa
|
||||
}
|
||||
|
||||
TEST_F(AsyncEventsHandlerTests, WhenHandlerIsRegisteredThenThreadIsCreated) {
|
||||
event1->setTaskStamp(CompletionStamp::levelNotReady, 0);
|
||||
event1->setTaskStamp(CompletionStamp::notReady, 0);
|
||||
|
||||
EXPECT_FALSE(handler->openThreadCalled);
|
||||
handler->registerEvent(event1);
|
||||
@@ -238,8 +238,8 @@ TEST_F(AsyncEventsHandlerTests, WhenHandlerIsRegisteredThenThreadIsCreated) {
|
||||
TEST_F(AsyncEventsHandlerTests, WhenProcessingAsynchronouslyThenBothThreadsCompelete) {
|
||||
DebugManager.flags.EnableAsyncEventsHandler.set(true);
|
||||
|
||||
event1->setTaskStamp(CompletionStamp::levelNotReady, 0);
|
||||
event2->setTaskStamp(CompletionStamp::levelNotReady, 0);
|
||||
event1->setTaskStamp(CompletionStamp::notReady, 0);
|
||||
event2->setTaskStamp(CompletionStamp::notReady, 0);
|
||||
|
||||
event1->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter);
|
||||
event2->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter);
|
||||
|
||||
@@ -52,7 +52,7 @@ TEST(Event, WhenPeekIsCalledThenExecutionIsNotUpdated) {
|
||||
auto mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||
MockContext ctx;
|
||||
MockCommandQueue cmdQ(&ctx, mockDevice.get(), 0);
|
||||
Event event(&cmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, 0);
|
||||
Event event(&cmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::notReady, 0);
|
||||
|
||||
EXPECT_FALSE(event.peekIsBlocked());
|
||||
EXPECT_EQ(CL_QUEUED, event.peekExecutionStatus());
|
||||
@@ -73,7 +73,7 @@ TEST(Event, givenEventThatStatusChangeWhenPeekIsCalledThenEventIsNotUpdated) {
|
||||
uint32_t callCount = 0u;
|
||||
};
|
||||
|
||||
mockEvent event(&cmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, 0);
|
||||
mockEvent event(&cmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::notReady, 0);
|
||||
EXPECT_EQ(0u, event.callCount);
|
||||
event.peekExecutionStatus();
|
||||
EXPECT_EQ(0u, event.callCount);
|
||||
@@ -212,7 +212,7 @@ TEST(Event, GivenNotReadyEventWhenWaitingForEventsThenQueueIsNotFlushed) {
|
||||
MockContext context;
|
||||
|
||||
std::unique_ptr<MockCommandQueueWithFlushCheck> cmdQ1(new MockCommandQueueWithFlushCheck(context, device.get()));
|
||||
std::unique_ptr<Event> event1(new Event(cmdQ1.get(), CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, 0));
|
||||
std::unique_ptr<Event> event1(new Event(cmdQ1.get(), CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::notReady, 0));
|
||||
cl_event eventWaitlist[] = {event1.get()};
|
||||
|
||||
Event::waitForEvents(1, eventWaitlist);
|
||||
@@ -221,7 +221,7 @@ TEST(Event, GivenNotReadyEventWhenWaitingForEventsThenQueueIsNotFlushed) {
|
||||
}
|
||||
|
||||
TEST(Event, givenNotReadyEventOnWaitlistWhenCheckingUserEventDependeciesThenTrueIsReturned) {
|
||||
auto event1 = std::make_unique<Event>(nullptr, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, 0);
|
||||
auto event1 = std::make_unique<Event>(nullptr, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::notReady, 0);
|
||||
cl_event eventWaitlist[] = {event1.get()};
|
||||
|
||||
bool userEventDependencies = Event::checkUserEventDependencies(1, eventWaitlist);
|
||||
@@ -294,7 +294,7 @@ TEST_F(EventTest, GivenTagCsGreaterThanTaskCountWhenGettingClEventCommandExecuti
|
||||
}
|
||||
|
||||
TEST_F(EventTest, WhenGettingClEventCommandExecutionStatusThenEventStatusIsReturned) {
|
||||
Event event(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
Event event(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
cl_int eventStatus = -1;
|
||||
|
||||
event.setStatus(-1);
|
||||
@@ -387,7 +387,7 @@ TEST_F(EventTest, GivenInvalidEventWhenGettingEventInfoThenInvalidValueErrorIsRe
|
||||
}
|
||||
|
||||
TEST_F(EventTest, GivenNonBlockingEventWhenWaitingThenFalseIsReturned) {
|
||||
Event event(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, 3, CompletionStamp::levelNotReady);
|
||||
Event event(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, 3, CompletionStamp::notReady);
|
||||
auto result = event.wait(false, false);
|
||||
EXPECT_FALSE(result);
|
||||
}
|
||||
@@ -931,7 +931,7 @@ HWTEST_F(EventTest, givenVirtualEventWhenCommandSubmittedThenLockCsrOccurs) {
|
||||
|
||||
std::unique_ptr<MockCommandComputeKernel> command = std::make_unique<MockCommandComputeKernel>(*pCmdQ, kernelOperation, surfaces, kernel);
|
||||
|
||||
auto virtualEvent = make_releaseable<MockEvent>(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
auto virtualEvent = make_releaseable<MockEvent>(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
|
||||
virtualEvent->setCommand(std::move(command));
|
||||
|
||||
@@ -949,7 +949,7 @@ HWTEST_F(EventTest, givenVirtualEventWhenSubmitCommandEventNotReadyAndEventWitho
|
||||
taskLevel, taskCount) {}
|
||||
};
|
||||
|
||||
auto virtualEvent = make_releaseable<MockEvent>(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
auto virtualEvent = make_releaseable<MockEvent>(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
|
||||
virtualEvent->submitCommand(false);
|
||||
|
||||
@@ -1206,23 +1206,23 @@ TEST_F(EventTest, GivenCompletedEventWhenQueryingExecutionStatusAfterFlushThenCs
|
||||
}
|
||||
|
||||
HWTEST_F(EventTest, GivenEventCreatedOnMapBufferWithoutCommandWhenSubmittingCommandThenTaskCountIsNotUpdated) {
|
||||
MockEvent<Event> ev(this->pCmdQ, CL_COMMAND_MAP_BUFFER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
MockEvent<Event> ev(this->pCmdQ, CL_COMMAND_MAP_BUFFER, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, ev.peekTaskCount());
|
||||
EXPECT_EQ(CompletionStamp::notReady, ev.peekTaskCount());
|
||||
ev.submitCommand(false);
|
||||
EXPECT_EQ(0u, ev.peekTaskCount());
|
||||
}
|
||||
|
||||
HWTEST_F(EventTest, GivenEventCreatedOnMapImageWithoutCommandWhenSubmittingCommandThenTaskCountIsNotUpdated) {
|
||||
MockEvent<Event> ev(this->pCmdQ, CL_COMMAND_MAP_IMAGE, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
MockEvent<Event> ev(this->pCmdQ, CL_COMMAND_MAP_IMAGE, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, ev.peekTaskCount());
|
||||
EXPECT_EQ(CompletionStamp::notReady, ev.peekTaskCount());
|
||||
ev.submitCommand(false);
|
||||
EXPECT_EQ(0u, ev.peekTaskCount());
|
||||
}
|
||||
|
||||
TEST_F(EventTest, givenCmdQueueWithoutProfilingWhenIsCpuProfilingIsCalledThenFalseIsReturned) {
|
||||
MockEvent<Event> ev(this->pCmdQ, CL_COMMAND_MAP_IMAGE, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
MockEvent<Event> ev(this->pCmdQ, CL_COMMAND_MAP_IMAGE, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
bool cpuProfiling = ev.isCPUProfilingPath() != 0;
|
||||
EXPECT_FALSE(cpuProfiling);
|
||||
}
|
||||
@@ -1251,7 +1251,7 @@ TEST_F(EventTest, givenCmdQueueWithProfilingWhenIsCpuProfilingIsCalledThenTrueIs
|
||||
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0};
|
||||
std::unique_ptr<MockCommandQueue> pCmdQ(new MockCommandQueue(&mockContext, pClDevice, props));
|
||||
|
||||
MockEvent<Event> ev(pCmdQ.get(), CL_COMMAND_MAP_IMAGE, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
MockEvent<Event> ev(pCmdQ.get(), CL_COMMAND_MAP_IMAGE, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
bool cpuProfiling = ev.isCPUProfilingPath() != 0;
|
||||
EXPECT_TRUE(cpuProfiling);
|
||||
}
|
||||
@@ -1355,8 +1355,8 @@ HWTEST_F(EventTest, givenEventWithNotReadyTaskLevelWhenUnblockedThenGetTaskLevel
|
||||
Event parentEventWithGreaterTaskLevel(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, initialTaskLevel + 5, 0);
|
||||
Event parentEventWithLowerTaskLevel(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, initialTaskLevel - 5, 0);
|
||||
|
||||
Event childEvent0(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
Event childEvent1(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
Event childEvent0(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
Event childEvent1(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
|
||||
auto &csr = reinterpret_cast<UltCommandStreamReceiver<FamilyType> &>(pCmdQ->getGpgpuCommandStreamReceiver());
|
||||
csr.taskLevel = initialTaskLevel;
|
||||
|
||||
@@ -111,8 +111,8 @@ TEST(EventsTracker, givenAlreadyDumpedCmdqThenNotDumping) {
|
||||
|
||||
TEST(EventsTracker, givenCmqdWithTaskCountAndLevelNotReadyThenDumpingCmdqWithNotReadyLabels) {
|
||||
MockCommandQueue cmdq;
|
||||
cmdq.taskCount = CompletionStamp::levelNotReady;
|
||||
cmdq.taskLevel = CompletionStamp::levelNotReady;
|
||||
cmdq.taskCount = CompletionStamp::notReady;
|
||||
cmdq.taskLevel = CompletionStamp::notReady;
|
||||
|
||||
std::stringstream stream;
|
||||
std::set<CommandQueue *> dumped;
|
||||
@@ -157,8 +157,8 @@ TEST(EventsTracker, whenCallDumpEdgeThenGetStringWithProperLabelOfDumpedEdge) {
|
||||
|
||||
TEST(EventsTracker, givenEventWithTaskLevelAndCountNotReadyThenDumpingNodeWithNotReadyLabels) {
|
||||
UserEvent uEvent;
|
||||
uEvent.taskLevel = CompletionStamp::levelNotReady;
|
||||
uEvent.updateTaskCount(CompletionStamp::levelNotReady);
|
||||
uEvent.taskLevel = CompletionStamp::notReady;
|
||||
uEvent.updateTaskCount(CompletionStamp::notReady);
|
||||
|
||||
std::stringstream stream;
|
||||
std::unordered_map<Event *, int64_t> map;
|
||||
@@ -203,7 +203,7 @@ TEST(EventsTracker, givenNullptrEventThenNotDumpingNode) {
|
||||
|
||||
TEST(EventsTracker, givenEventAndUserEventThenDumpingNodeWithProperLabels) {
|
||||
UserEvent uEvent;
|
||||
Event event(nullptr, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
Event event(nullptr, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
|
||||
std::stringstream stream;
|
||||
std::unordered_map<Event *, int64_t> map;
|
||||
@@ -266,7 +266,7 @@ TEST(EventsTracker, givenEventWithCallbackThenDumpingWithProperLabel) {
|
||||
}
|
||||
|
||||
TEST(EventsTracker, givenSubmittedEventThenDumpingWithProperLabel) {
|
||||
Event event(nullptr, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
Event event(nullptr, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
|
||||
std::stringstream stream;
|
||||
std::unordered_map<Event *, int64_t> map;
|
||||
@@ -484,7 +484,7 @@ TEST(EventsTracker, givenTwoEventsWithSamePtrWhenFirstOneIsDeletedThenDumpingFir
|
||||
}
|
||||
|
||||
TEST(EventsTracker, whenNotifyCreationOfEventThenEventIsDumped) {
|
||||
Event event(nullptr, CL_COMMAND_USER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
Event event(nullptr, CL_COMMAND_USER, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
EventsTrackerMock evTrackerMock;
|
||||
|
||||
std::stringstream expected;
|
||||
@@ -626,7 +626,7 @@ TEST(EventsTracker, whenEventsDebugEnableFlagIsTrueAndCreateOrChangeStatusOrDest
|
||||
EventsTrackerMock evTrackerMock;
|
||||
evTrackerMock.overrideGlobal();
|
||||
|
||||
Event *ev = new Event(nullptr, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
Event *ev = new Event(nullptr, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
|
||||
std::stringstream expected;
|
||||
expected << "digraph events_registry_" << &EventsTracker::getEventsTracker() << " {\nnode [shape=record]\n//pragma: somePragmaData\n\n}\n";
|
||||
|
||||
@@ -143,13 +143,13 @@ TEST(UserEvent, givenUserEventWhenStatusIsCompletedThenReturnZeroTaskLevel) {
|
||||
UserEvent uEvent;
|
||||
|
||||
uEvent.setStatus(CL_QUEUED);
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, uEvent.getTaskLevel());
|
||||
EXPECT_EQ(CompletionStamp::notReady, uEvent.getTaskLevel());
|
||||
|
||||
uEvent.setStatus(CL_SUBMITTED);
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, uEvent.getTaskLevel());
|
||||
EXPECT_EQ(CompletionStamp::notReady, uEvent.getTaskLevel());
|
||||
|
||||
uEvent.setStatus(CL_RUNNING);
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, uEvent.getTaskLevel());
|
||||
EXPECT_EQ(CompletionStamp::notReady, uEvent.getTaskLevel());
|
||||
|
||||
uEvent.setStatus(CL_COMPLETE);
|
||||
EXPECT_EQ(0u, uEvent.getTaskLevel());
|
||||
@@ -172,10 +172,10 @@ TEST_F(MockEventTests, GivenBlockedUserEventWhenEnqueueingNdRangeWithoutReturnEv
|
||||
auto taskCountAfter = csr.peekTaskCount();
|
||||
|
||||
//queue should be in blocked state at this moment, task level should be inherited from user event
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, pCmdQ->taskLevel);
|
||||
EXPECT_EQ(CompletionStamp::notReady, pCmdQ->taskLevel);
|
||||
|
||||
//queue should be in blocked state at this moment, task count should be inherited from user event
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, pCmdQ->taskCount);
|
||||
EXPECT_EQ(CompletionStamp::notReady, pCmdQ->taskCount);
|
||||
|
||||
//queue should be in blocked state
|
||||
EXPECT_EQ(pCmdQ->isQueueBlocked(), true);
|
||||
@@ -205,10 +205,10 @@ TEST_F(MockEventTests, GivenBlockedUserEventWhenEnqueueingNdRangeWithReturnEvent
|
||||
auto taskCountAfter = csr.peekTaskCount();
|
||||
|
||||
//queue should be in blocked state at this moment, task level should be inherited from user event
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, pCmdQ->taskLevel);
|
||||
EXPECT_EQ(CompletionStamp::notReady, pCmdQ->taskLevel);
|
||||
|
||||
//queue should be in blocked state at this moment, task count should be inherited from user event
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, pCmdQ->taskCount);
|
||||
EXPECT_EQ(CompletionStamp::notReady, pCmdQ->taskCount);
|
||||
|
||||
//queue should be in blocked state
|
||||
EXPECT_EQ(pCmdQ->isQueueBlocked(), true);
|
||||
@@ -224,7 +224,7 @@ TEST_F(MockEventTests, GivenBlockedUserEventWhenEnqueueingNdRangeWithReturnEvent
|
||||
|
||||
//and if normal event inherited status from user event
|
||||
Event *returnEvent = castToObject<Event>(retEvent);
|
||||
EXPECT_EQ(returnEvent->taskLevel, CompletionStamp::levelNotReady);
|
||||
EXPECT_EQ(returnEvent->taskLevel, CompletionStamp::notReady);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
@@ -376,7 +376,7 @@ TEST_F(EventTests, givenQueueThatIsBlockedByUserEventWhenIsQueueBlockedIsCalledT
|
||||
}
|
||||
bool updateExecutionStatusCalled = false;
|
||||
};
|
||||
mockEvent mockedVirtualEvent(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, 0);
|
||||
mockEvent mockedVirtualEvent(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::notReady, 0);
|
||||
pCmdQ->virtualEvent = &mockedVirtualEvent;
|
||||
|
||||
EXPECT_TRUE(pCmdQ->isQueueBlocked());
|
||||
@@ -454,8 +454,8 @@ TEST_F(MockEventTests, GivenUserEventWhenSettingStatusCompleteThenTaskLevelIsUpd
|
||||
|
||||
//check if dependency count is increased
|
||||
Event *returnEvent = castToObject<Event>(retEvent);
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, returnEvent->taskLevel);
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, returnEvent->peekTaskCount());
|
||||
EXPECT_EQ(CompletionStamp::notReady, returnEvent->taskLevel);
|
||||
EXPECT_EQ(CompletionStamp::notReady, returnEvent->peekTaskCount());
|
||||
|
||||
//now set user event for complete status, this triggers update of childs.
|
||||
uEvent->setStatus(CL_COMPLETE);
|
||||
@@ -481,7 +481,7 @@ TEST_F(MockEventTests, GivenCompleteParentWhenWaitingForEventsThenChildrenAreCom
|
||||
|
||||
//check if dependency count is increased
|
||||
Event *returnEvent = castToObject<Event>(retEvent);
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, returnEvent->taskLevel);
|
||||
EXPECT_EQ(CompletionStamp::notReady, returnEvent->taskLevel);
|
||||
|
||||
//now set user event for complete status, this triggers update of childs.
|
||||
uEvent->setStatus(CL_COMPLETE);
|
||||
@@ -527,7 +527,7 @@ TEST_F(MockEventTests, GivenAbortedUserEventWhenEnqueingNdrThenDoNotFlushToCsr)
|
||||
EXPECT_EQ(taskCount, taskCountAfter);
|
||||
|
||||
Event *pChildEvent = (Event *)retEvent;
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, pChildEvent->getTaskLevel());
|
||||
EXPECT_EQ(CompletionStamp::notReady, pChildEvent->getTaskLevel());
|
||||
|
||||
cl_int eventStatus = 0;
|
||||
retVal = clGetEventInfo(retEvent, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(cl_int), &eventStatus, NULL);
|
||||
@@ -564,7 +564,7 @@ TEST_F(MockEventTests, GivenAbortedParentWhenDestroyingChildEventThenDoNotProces
|
||||
EXPECT_EQ(taskCount, taskCountAfter);
|
||||
|
||||
Event *pChildEvent = (Event *)retEvent;
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, pChildEvent->taskLevel);
|
||||
EXPECT_EQ(CompletionStamp::notReady, pChildEvent->taskLevel);
|
||||
|
||||
cl_int eventStatus = 0;
|
||||
retVal = clGetEventInfo(retEvent, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(cl_int), &eventStatus, NULL);
|
||||
|
||||
@@ -101,7 +101,7 @@ TEST_F(InternalAllocationStorageTest, whenAllocationIsStoredAsTemporaryAndIsStil
|
||||
memoryManager->freeGraphicsMemory(newAllocation.release());
|
||||
}
|
||||
|
||||
TEST_F(InternalAllocationStorageTest, givenTemporaryAllocationWhenAllocationIsObtainedThenItsTaskCountIsSetToLevelNotReady) {
|
||||
TEST_F(InternalAllocationStorageTest, givenTemporaryAllocationWhenAllocationIsObtainedThenItsTaskCountIsSetToNotReady) {
|
||||
const uint32_t initialTaskCount = 37u;
|
||||
const uint32_t contextId = csr->getOsContext().getContextId();
|
||||
|
||||
@@ -111,7 +111,7 @@ TEST_F(InternalAllocationStorageTest, givenTemporaryAllocationWhenAllocationIsOb
|
||||
|
||||
auto newAllocation = storage->obtainTemporaryAllocationWithPtr(1, allocation->getUnderlyingBuffer(), GraphicsAllocation::AllocationType::BUFFER);
|
||||
EXPECT_EQ(allocation, newAllocation.get());
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, allocation->getTaskCount(contextId));
|
||||
EXPECT_EQ(CompletionStamp::notReady, allocation->getTaskCount(contextId));
|
||||
memoryManager->freeGraphicsMemory(newAllocation.release());
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ TEST_F(EventTests, givenUserEventBlockingEnqueueWithBlockingFlagWhenUserEventIsC
|
||||
while (true) {
|
||||
pCmdQ->takeOwnership();
|
||||
|
||||
if (pCmdQ->taskLevel == CompletionStamp::levelNotReady) {
|
||||
if (pCmdQ->taskLevel == CompletionStamp::notReady) {
|
||||
pCmdQ->releaseOwnership();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -956,7 +956,7 @@ struct ProfilingTimestampPacketsTest : public ::testing::Test {
|
||||
MockContext context;
|
||||
cl_command_queue_properties props[5] = {0, 0, 0, 0, 0};
|
||||
ReleaseableObjectPtr<MockCommandQueue> cmdQ = clUniquePtr(new MockCommandQueue(&context, context.getDevice(0), props));
|
||||
ReleaseableObjectPtr<MockEvent<MyEvent>> ev = clUniquePtr(new MockEvent<MyEvent>(cmdQ.get(), CL_COMMAND_USER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady));
|
||||
ReleaseableObjectPtr<MockEvent<MyEvent>> ev = clUniquePtr(new MockEvent<MyEvent>(cmdQ.get(), CL_COMMAND_USER, CompletionStamp::notReady, CompletionStamp::notReady));
|
||||
};
|
||||
|
||||
TEST_F(ProfilingTimestampPacketsTest, givenTimestampsPacketContainerWithOneElementAndTimestampNodeWhenCalculatingProfilingThenTimesAreTakenFromPacket) {
|
||||
|
||||
@@ -38,14 +38,14 @@ HWTEST_F(BarrierScenarioTest, givenBlockedEnqueueBarrierOnOOQWhenUserEventIsUnbl
|
||||
retVal = clEnqueueBarrierWithWaitList(clCommandQ, 1, &eventBlocking, nullptr);
|
||||
EXPECT_EQ(success, retVal);
|
||||
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, mockCmdQ->taskLevel);
|
||||
EXPECT_EQ(CompletionStamp::notReady, mockCmdQ->taskLevel);
|
||||
EXPECT_NE(nullptr, mockCmdQ->virtualEvent);
|
||||
|
||||
clSetUserEventStatus(eventBlocking, CL_COMPLETE);
|
||||
userEvent->release();
|
||||
|
||||
mockCmdQ->isQueueBlocked();
|
||||
EXPECT_NE(CompletionStamp::levelNotReady, mockCmdQ->taskLevel);
|
||||
EXPECT_NE(CompletionStamp::notReady, mockCmdQ->taskLevel);
|
||||
EXPECT_EQ(nullptr, mockCmdQ->virtualEvent);
|
||||
|
||||
retVal = clEnqueueNDRangeKernel(clCommandQ, clKernel, 1, offset, gws, nullptr, 0, nullptr, nullptr);
|
||||
|
||||
@@ -107,7 +107,7 @@ struct GlArbSyncEventTest : public ::testing::Test {
|
||||
MockBaseEvent *getBaseEvent() {
|
||||
if (baseEvent == nullptr) {
|
||||
triggerEvent = new UserEvent(ctx.get());
|
||||
baseEvent = new MockBaseEvent(cmdQ.get(), CL_COMMAND_RELEASE_GL_OBJECTS, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
baseEvent = new MockBaseEvent(cmdQ.get(), CL_COMMAND_RELEASE_GL_OBJECTS, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
triggerEvent->addChild(*baseEvent);
|
||||
}
|
||||
return baseEvent;
|
||||
@@ -231,7 +231,7 @@ TEST_F(GlArbSyncEventTest, whenGlArbSyncEventGetsUnblockedBySubmittedOrCompleted
|
||||
}
|
||||
|
||||
TEST_F(GlArbSyncEventTest, whenGlArbSyncEventIsCreatedFromBaseEventWithoutValidContextThenCreationFails) {
|
||||
Event *baseEvent = new Event(nullptr, CL_COMMAND_RELEASE_GL_OBJECTS, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady);
|
||||
Event *baseEvent = new Event(nullptr, CL_COMMAND_RELEASE_GL_OBJECTS, CompletionStamp::notReady, CompletionStamp::notReady);
|
||||
auto *arbEvent = GlArbSyncEvent::create(*baseEvent);
|
||||
EXPECT_EQ(nullptr, arbEvent);
|
||||
baseEvent->release();
|
||||
|
||||
@@ -1102,8 +1102,8 @@ HWTEST_F(glSharingTests, givenSyncObjectWhenCreateEventIsCalledThenCreateGLSyncO
|
||||
auto eventObj = castToObject<Event>(event);
|
||||
EXPECT_TRUE(eventObj->getCommandType() == CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR);
|
||||
EXPECT_TRUE(eventObj->peekExecutionStatus() == CL_SUBMITTED);
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, eventObj->taskLevel);
|
||||
EXPECT_EQ(CompletionStamp::levelNotReady, eventObj->getTaskLevel());
|
||||
EXPECT_EQ(CompletionStamp::notReady, eventObj->taskLevel);
|
||||
EXPECT_EQ(CompletionStamp::notReady, eventObj->getTaskLevel());
|
||||
EXPECT_EQ(1, mockGlSharing->dllParam->getParam("GLRetainSyncCalled"));
|
||||
|
||||
eventObj->setStatus(CL_COMPLETE);
|
||||
|
||||
@@ -490,7 +490,7 @@ bool CommandStreamReceiver::createAllocationForHostSurface(HostPtrSurface &surfa
|
||||
if (allocation == nullptr) {
|
||||
return false;
|
||||
}
|
||||
allocation->updateTaskCount(CompletionStamp::levelNotReady, osContext->getContextId());
|
||||
allocation->updateTaskCount(CompletionStamp::notReady, osContext->getContextId());
|
||||
surface.setAllocation(allocation.get());
|
||||
internalAllocationStorage->storeAllocation(std::move(allocation), TEMPORARY_ALLOCATION);
|
||||
return true;
|
||||
|
||||
@@ -169,7 +169,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
|
||||
|
||||
DEBUG_BREAK_IF(&commandStreamTask == &commandStream);
|
||||
DEBUG_BREAK_IF(!(dispatchFlags.preemptionMode == PreemptionMode::Disabled ? device.getPreemptionMode() == PreemptionMode::Disabled : true));
|
||||
DEBUG_BREAK_IF(taskLevel >= CompletionStamp::levelNotReady);
|
||||
DEBUG_BREAK_IF(taskLevel >= CompletionStamp::notReady);
|
||||
|
||||
DBG_LOG(LogTaskCounts, __FUNCTION__, "Line: ", __LINE__, "taskLevel", taskLevel);
|
||||
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
const uint32_t CompletionStamp::levelNotReady = 0xFFFFFFF0;
|
||||
const uint32_t CompletionStamp::notReady = 0xFFFFFFF0;
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -16,7 +16,7 @@ struct CompletionStamp {
|
||||
uint32_t taskLevel;
|
||||
FlushStamp flushStamp;
|
||||
|
||||
static const uint32_t levelNotReady;
|
||||
static const uint32_t notReady;
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -32,6 +32,6 @@ enum CommandStreamReceiverType {
|
||||
extern const char *folderAUB;
|
||||
|
||||
// Initial value for HW tag
|
||||
// Set to 0 if using HW or simulator, otherwise 0xFFFFFF00, needs to be lower then CompletionStamp::levelNotReady.
|
||||
// Set to 0 if using HW or simulator, otherwise 0xFFFFFF00, needs to be lower then CompletionStamp::notReady.
|
||||
extern uint32_t initialHardwareTag;
|
||||
} // namespace NEO
|
||||
|
||||
@@ -107,8 +107,8 @@ GraphicsAllocation *AllocationsList::detachAllocationImpl(GraphicsAllocation *,
|
||||
(this->allocationUsage == TEMPORARY_ALLOCATION || *req->csrTagAddress >= curr->getTaskCount(req->contextId)) &&
|
||||
(req->requiredPtr == nullptr || req->requiredPtr == curr->getUnderlyingBuffer())) {
|
||||
if (this->allocationUsage == TEMPORARY_ALLOCATION) {
|
||||
// We may not have proper task count yet, so set levelNotReady to avoid releasing in a different thread
|
||||
curr->updateTaskCount(CompletionStamp::levelNotReady, req->contextId);
|
||||
// We may not have proper task count yet, so set notReady to avoid releasing in a different thread
|
||||
curr->updateTaskCount(CompletionStamp::notReady, req->contextId);
|
||||
}
|
||||
return removeOneImpl(curr, nullptr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user