Rename levelNotReady to notReady

Change-Id: Id482c6edd36d1bdd63558aa35f13dbb57e0efbad
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
Maciej Dziuban
2020-06-16 11:19:11 +00:00
committed by sys_ocldev
parent 5293b26dc6
commit 7ef2e4304c
35 changed files with 124 additions and 124 deletions

View File

@@ -143,7 +143,7 @@ volatile uint32_t *CommandQueue::getHwTagAddress() const {
bool CommandQueue::isCompleted(uint32_t taskCount) const { bool CommandQueue::isCompleted(uint32_t taskCount) const {
uint32_t tag = getHwTag(); uint32_t tag = getHwTag();
DEBUG_BREAK_IF(tag == CompletionStamp::levelNotReady); DEBUG_BREAK_IF(tag == CompletionStamp::notReady);
return tag >= taskCount; return tag >= taskCount;
} }
@@ -297,7 +297,7 @@ cl_int CommandQueue::enqueueReleaseSharedObjects(cl_uint numObjects, const cl_me
void CommandQueue::updateFromCompletionStamp(const CompletionStamp &completionStamp) { void CommandQueue::updateFromCompletionStamp(const CompletionStamp &completionStamp) {
DEBUG_BREAK_IF(this->taskLevel > completionStamp.taskLevel); DEBUG_BREAK_IF(this->taskLevel > completionStamp.taskLevel);
DEBUG_BREAK_IF(this->taskCount > completionStamp.taskCount); DEBUG_BREAK_IF(this->taskCount > completionStamp.taskCount);
if (completionStamp.taskCount != CompletionStamp::levelNotReady) { if (completionStamp.taskCount != CompletionStamp::notReady) {
taskCount = completionStamp.taskCount; taskCount = completionStamp.taskCount;
} }
flushStamp->setStamp(completionStamp.flushStamp); flushStamp->setStamp(completionStamp.flushStamp);

View File

@@ -45,7 +45,7 @@ void *CommandQueue::cpuDataTransferHandler(TransferProperties &transferPropertie
} }
if (eventsRequest.outEvent) { 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 = eventBuilder.getEvent();
outEventObj->setQueueTimeStamp(); outEventObj->setQueueTimeStamp();
outEventObj->setCPUProfilingPath(true); outEventObj->setCPUProfilingPath(true);

View File

@@ -159,7 +159,7 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
} }
EventBuilder eventBuilder; EventBuilder eventBuilder;
if (event) { if (event) {
eventBuilder.create<Event>(this, commandType, CompletionStamp::levelNotReady, 0); eventBuilder.create<Event>(this, commandType, CompletionStamp::notReady, 0);
*event = eventBuilder.getEvent(); *event = eventBuilder.getEvent();
if (eventBuilder.getEvent()->isProfilingEnabled()) { if (eventBuilder.getEvent()->isProfilingEnabled()) {
eventBuilder.getEvent()->setQueueTimeStamp(&queueTimeStamp); 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), const EnqueueProperties enqueueProperties(blitEnqueue, !multiDispatchInfo.empty(), isCacheFlushCommand(commandType),
flushDependenciesForNonKernelCommand, &blitPropertiesContainer); 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) { void CommandQueueHw<GfxFamily>::obtainTaskLevelAndBlockedStatus(unsigned int &taskLevel, cl_uint &numEventsInWaitList, const cl_event *&eventWaitList, bool &blockQueueStatus, unsigned int commandType) {
auto isQueueBlockedStatus = isQueueBlocked(); auto isQueueBlockedStatus = isQueueBlocked();
taskLevel = getTaskLevelFromWaitList(this->taskLevel, numEventsInWaitList, eventWaitList); taskLevel = getTaskLevelFromWaitList(this->taskLevel, numEventsInWaitList, eventWaitList);
blockQueueStatus = (taskLevel == CompletionStamp::levelNotReady) || isQueueBlockedStatus; blockQueueStatus = (taskLevel == CompletionStamp::notReady) || isQueueBlockedStatus;
auto taskLevelUpdateRequired = isTaskLevelUpdateRequired(taskLevel, eventWaitList, numEventsInWaitList, commandType); auto taskLevelUpdateRequired = isTaskLevelUpdateRequired(taskLevel, eventWaitList, numEventsInWaitList, commandType);
if (taskLevelUpdateRequired) { 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 CommandQueueHw<GfxFamily>::isTaskLevelUpdateRequired(const uint32_t &taskLevel, const cl_event *eventWaitList, const cl_uint &numEventsInWaitList, unsigned int commandType) {
bool updateTaskLevel = true; bool updateTaskLevel = true;
//if we are blocked by user event then no update //if we are blocked by user event then no update
if (taskLevel == CompletionStamp::levelNotReady) { if (taskLevel == CompletionStamp::notReady) {
updateTaskLevel = false; updateTaskLevel = false;
} }
//if we are executing command without kernel then it will inherit state from //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()); dispatchFlags.csrDependencies.makeResident(getGpgpuCommandStreamReceiver());
} }
DEBUG_BREAK_IF(taskLevel >= CompletionStamp::levelNotReady); DEBUG_BREAK_IF(taskLevel >= CompletionStamp::notReady);
if (anyUncacheableArgs) { if (anyUncacheableArgs) {
dispatchFlags.l3CacheSettings = L3CachingSettings::l3CacheOff; dispatchFlags.l3CacheSettings = L3CachingSettings::l3CacheOff;

View File

@@ -37,7 +37,7 @@ void AsyncEventsHandler::registerEvent(Event *event) {
} }
Event *AsyncEventsHandler::processList() { Event *AsyncEventsHandler::processList() {
uint32_t lowestTaskCount = CompletionStamp::levelNotReady; uint32_t lowestTaskCount = CompletionStamp::notReady;
Event *sleepCandidate = nullptr; Event *sleepCandidate = nullptr;
pendingList.clear(); pendingList.clear();

View File

@@ -360,7 +360,7 @@ void Event::calculateProfilingDataInternal(uint64_t contextStartTS, uint64_t con
} }
inline bool Event::wait(bool blocking, bool useQuickKmdSleep) { inline bool Event::wait(bool blocking, bool useQuickKmdSleep) {
while (this->taskCount == CompletionStamp::levelNotReady) { while (this->taskCount == CompletionStamp::notReady) {
if (blocking == false) { if (blocking == false) {
return false; return false;
} }
@@ -369,7 +369,7 @@ inline bool Event::wait(bool blocking, bool useQuickKmdSleep) {
cmdQueue->waitUntilComplete(taskCount.load(), flushStamp->peekStamp(), useQuickKmdSleep); cmdQueue->waitUntilComplete(taskCount.load(), flushStamp->peekStamp(), useQuickKmdSleep);
updateExecutionStatus(); 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(); auto *allocationStorage = cmdQueue->getGpgpuCommandStreamReceiver().getInternalAllocationStorage();
allocationStorage->cleanAllocationList(this->taskCount, TEMPORARY_ALLOCATION); allocationStorage->cleanAllocationList(this->taskCount, TEMPORARY_ALLOCATION);
@@ -378,7 +378,7 @@ inline bool Event::wait(bool blocking, bool useQuickKmdSleep) {
} }
void Event::updateExecutionStatus() { void Event::updateExecutionStatus() {
if (taskLevel == CompletionStamp::levelNotReady) { if (taskLevel == CompletionStamp::notReady) {
return; return;
} }
@@ -434,11 +434,11 @@ void Event::unblockEventsBlockedByThis(int32_t transitionStatus) {
(void)status; (void)status;
DEBUG_BREAK_IF(!(isStatusCompleted(status) || (peekIsSubmitted(status)))); DEBUG_BREAK_IF(!(isStatusCompleted(status) || (peekIsSubmitted(status))));
uint32_t taskLevelToPropagate = CompletionStamp::levelNotReady; uint32_t taskLevelToPropagate = CompletionStamp::notReady;
if (isStatusCompletedByTermination(transitionStatus) == false) { if (isStatusCompletedByTermination(transitionStatus) == false) {
//if we are event on top of the tree , obtain taskLevel from CSR //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) this->taskLevel = getTaskLevel(); // NOLINT(clang-analyzer-optin.cplusplus.VirtualCall)
taskLevelToPropagate = this->taskLevel; taskLevelToPropagate = this->taskLevel;
} else { } else {
@@ -535,7 +535,7 @@ void Event::submitCommand(bool abortTasks) {
} else if (profilingCpuPath && endTimeStamp == 0) { } else if (profilingCpuPath && endTimeStamp == 0) {
setEndTimeStamp(); setEndTimeStamp();
} }
if (this->taskCount == CompletionStamp::levelNotReady) { if (this->taskCount == CompletionStamp::notReady) {
if (!this->isUserEvent() && this->eventWithoutCommand) { if (!this->isUserEvent() && this->eventWithoutCommand) {
if (this->cmdQueue) { if (this->cmdQueue) {
auto lockCSR = this->getCommandQueue()->getGpgpuCommandStreamReceiver().obtainUniqueOwnership(); 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) { for (const cl_event *it = eventList, *end = eventList + numEvents; it != end; ++it) {
Event *event = castToObjectOrAbort<Event>(*it); Event *event = castToObjectOrAbort<Event>(*it);
if (event->cmdQueue) { if (event->cmdQueue) {
if (event->taskLevel != CompletionStamp::levelNotReady) { if (event->taskLevel != CompletionStamp::notReady) {
event->cmdQueue->flush(); 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); 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); this->taskLevel = std::max(cmdQueue->getGpgpuCommandStreamReceiver().peekTaskLevel(), taskLevel);
} else { } else {
this->taskLevel = std::max(this->taskLevel.load(), taskLevel); this->taskLevel = std::max(this->taskLevel.load(), taskLevel);
@@ -631,7 +631,7 @@ bool Event::updateStatusAndCheckCompletion() {
} }
bool Event::isReadyForSubmission() { 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) { 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 //only if event is not completed, completed event has already been flushed
if (cmdQueue && updateStatusAndCheckCompletion() == false) { if (cmdQueue && updateStatusAndCheckCompletion() == false) {
//flush the command queue only if it is not blocked event //flush the command queue only if it is not blocked event
if (taskLevel != CompletionStamp::levelNotReady) { if (taskLevel != CompletionStamp::notReady) {
cmdQueue->getGpgpuCommandStreamReceiver().flushBatchedSubmissions(); cmdQueue->getGpgpuCommandStreamReceiver().flushBatchedSubmissions();
} }
} }

View File

@@ -244,13 +244,13 @@ class Event : public BaseObject<_cl_event>, public IDNode<Event> {
virtual void unblockEventBy(Event &event, uint32_t taskLevel, int32_t transitionStatus); virtual void unblockEventBy(Event &event, uint32_t taskLevel, int32_t transitionStatus);
void updateTaskCount(uint32_t taskCount) { void updateTaskCount(uint32_t taskCount) {
if (taskCount == CompletionStamp::levelNotReady) { if (taskCount == CompletionStamp::notReady) {
DEBUG_BREAK_IF(true); DEBUG_BREAK_IF(true);
return; return;
} }
uint32_t prevTaskCount = this->taskCount.exchange(taskCount); uint32_t prevTaskCount = this->taskCount.exchange(taskCount);
if ((prevTaskCount != CompletionStamp::levelNotReady) && (prevTaskCount > taskCount)) { if ((prevTaskCount != CompletionStamp::notReady) && (prevTaskCount > taskCount)) {
this->taskCount = prevTaskCount; this->taskCount = prevTaskCount;
DEBUG_BREAK_IF(true); DEBUG_BREAK_IF(true);
} }
@@ -322,7 +322,7 @@ class Event : public BaseObject<_cl_event>, public IDNode<Event> {
bool calcProfilingData(); bool calcProfilingData();
MOCKABLE_VIRTUAL void calculateProfilingDataInternal(uint64_t contextStartTS, uint64_t contextEndTS, uint64_t *contextCompleteTS, uint64_t globalStartTS); MOCKABLE_VIRTUAL void calculateProfilingDataInternal(uint64_t contextStartTS, uint64_t contextEndTS, uint64_t *contextCompleteTS, uint64_t globalStartTS);
MOCKABLE_VIRTUAL void synchronizeTaskCount() { MOCKABLE_VIRTUAL void synchronizeTaskCount() {
while (this->taskCount == CompletionStamp::levelNotReady) while (this->taskCount == CompletionStamp::notReady)
; ;
}; };

View File

@@ -55,7 +55,7 @@ void EventBuilder::finalize() {
//do not add as child if: //do not add as child if:
//parent has no parents and is not blocked //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->isEventWithoutCommand() && !parent->peekIsCmdSubmitted())) {
parent->addChild(*this->event); parent->addChild(*this->event);
} }

View File

@@ -46,14 +46,14 @@ void EventsTracker::dumpQueue(CommandQueue *cmdQ, std::ostream &out, CmdqSet &du
out << label(cmdQ) << "[label=\"{------CmdQueue, ptr=" << cmdQ << "------|task count="; out << label(cmdQ) << "[label=\"{------CmdQueue, ptr=" << cmdQ << "------|task count=";
auto taskCount = cmdQ->taskCount; auto taskCount = cmdQ->taskCount;
auto taskLevel = cmdQ->taskLevel; auto taskLevel = cmdQ->taskLevel;
if (taskCount == CompletionStamp::levelNotReady) { if (taskCount == CompletionStamp::notReady) {
out << "NOT_READY"; out << "NOT_READY";
} else { } else {
out << taskCount; out << taskCount;
} }
out << ", level="; out << ", level=";
if (taskLevel == CompletionStamp::levelNotReady) { if (taskLevel == CompletionStamp::notReady) {
out << "NOT_READY"; out << "NOT_READY";
} else { } else {
out << taskLevel; out << taskLevel;
@@ -96,14 +96,14 @@ void EventsTracker::dumpNode(Event *node, std::ostream &out, const EventIdMap &e
"|" "|"
<< commandType << "|" << status[statusId] << "|" << commandType << "|" << status[statusId] << "|"
"task count="; "task count=";
if (taskCount == CompletionStamp::levelNotReady) { if (taskCount == CompletionStamp::notReady) {
out << "NOT_READY"; out << "NOT_READY";
} else { } else {
out << taskCount; out << taskCount;
} }
out << ", level="; out << ", level=";
if (taskLevel == CompletionStamp::levelNotReady) { if (taskLevel == CompletionStamp::notReady) {
out << "NOT_READY"; out << "NOT_READY";
} else { } else {
out << taskLevel; out << taskLevel;

View File

@@ -16,7 +16,7 @@
namespace NEO { namespace NEO {
UserEvent::UserEvent(Context *ctx) 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); transitionExecutionStatus(CL_QUEUED);
} }
@@ -37,7 +37,7 @@ uint32_t UserEvent::getTaskLevel() {
if (peekExecutionStatus() == CL_COMPLETE) { if (peekExecutionStatus() == CL_COMPLETE) {
return 0; return 0;
} }
return CompletionStamp::levelNotReady; return CompletionStamp::notReady;
} }
bool UserEvent::isInitialEventStatus() const { bool UserEvent::isInitialEventStatus() const {
@@ -45,7 +45,7 @@ bool UserEvent::isInitialEventStatus() const {
} }
VirtualEvent::VirtualEvent(CommandQueue *cmdQ, Context *ctx) 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); transitionExecutionStatus(CL_QUEUED);
// internal object - no need for API refcount // internal object - no need for API refcount

View File

@@ -74,7 +74,7 @@ CompletionStamp &CommandMapUnmap::submit(uint32_t taskLevel, bool terminated) {
false //usePerDssBackedBuffer false //usePerDssBackedBuffer
); );
DEBUG_BREAK_IF(taskLevel >= CompletionStamp::levelNotReady); DEBUG_BREAK_IF(taskLevel >= CompletionStamp::notReady);
gtpinNotifyPreFlushTask(&commandQueue); gtpinNotifyPreFlushTask(&commandQueue);
@@ -248,7 +248,7 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate
dispatchFlags.epilogueRequired = true; dispatchFlags.epilogueRequired = true;
} }
DEBUG_BREAK_IF(taskLevel >= CompletionStamp::levelNotReady); DEBUG_BREAK_IF(taskLevel >= CompletionStamp::notReady);
gtpinNotifyPreFlushTask(&commandQueue); gtpinNotifyPreFlushTask(&commandQueue);

View File

@@ -156,7 +156,7 @@ void serverWaitForArbSyncObject(OSInterface &osInterface, CL_GL_SYNC_INFO &glSyn
} }
GlArbSyncEvent::GlArbSyncEvent(Context &context) 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>()) { glSyncInfo(std::make_unique<CL_GL_SYNC_INFO>()) {
} }

View File

@@ -21,7 +21,7 @@
namespace NEO { namespace NEO {
GlSyncEvent::GlSyncEvent(Context &context, const GL_CL_SYNC_INFO &sync) 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)) { glSync(std::make_unique<GL_CL_SYNC_INFO>(sync)) {
transitionExecutionStatus(CL_SUBMITTED); transitionExecutionStatus(CL_SUBMITTED);
} }
@@ -58,6 +58,6 @@ uint32_t GlSyncEvent::getTaskLevel() {
if (peekExecutionStatus() == CL_COMPLETE) { if (peekExecutionStatus() == CL_COMPLETE) {
return 0; return 0;
} }
return CompletionStamp::levelNotReady; return CompletionStamp::notReady;
} }
} // namespace NEO } // namespace NEO

View File

@@ -688,12 +688,12 @@ HWTEST_F(CommandQueueHwTest, GivenEventThatIsNotCompletedWhenFinishIsCalledAndIt
}; };
auto Value = 0u; 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); clSetEventCallback(ev, CL_COMPLETE, ClbFuncTempStruct::ClbFuncT, &Value);
auto &csr = this->pCmdQ->getGpgpuCommandStreamReceiver(); auto &csr = this->pCmdQ->getGpgpuCommandStreamReceiver();
EXPECT_GT(3u, csr.peekTaskCount()); EXPECT_GT(3u, csr.peekTaskCount());
*csr.getTagAddress() = CompletionStamp::levelNotReady + 1; *csr.getTagAddress() = CompletionStamp::notReady + 1;
ret = clFinish(this->pCmdQ); ret = clFinish(this->pCmdQ);
ASSERT_EQ(CL_SUCCESS, ret); ASSERT_EQ(CL_SUCCESS, ret);
@@ -923,14 +923,14 @@ HWTEST_F(CommandQueueHwTest, givenCommandQueueThatIsBlockedAndUsesCpuCopyWhenEve
MockBuffer buffer; MockBuffer buffer;
cl_event returnEvent = nullptr; cl_event returnEvent = nullptr;
auto retVal = CL_SUCCESS; auto retVal = CL_SUCCESS;
cmdQHw->taskLevel = CompletionStamp::levelNotReady; cmdQHw->taskLevel = CompletionStamp::notReady;
size_t offset = 0; size_t offset = 0;
size_t size = 4096u; size_t size = 4096u;
TransferProperties transferProperties(&buffer, CL_COMMAND_READ_BUFFER, 0, false, &offset, &size, nullptr, false, pDevice->getRootDeviceIndex()); TransferProperties transferProperties(&buffer, CL_COMMAND_READ_BUFFER, 0, false, &offset, &size, nullptr, false, pDevice->getRootDeviceIndex());
EventsRequest eventsRequest(0, nullptr, &returnEvent); EventsRequest eventsRequest(0, nullptr, &returnEvent);
cmdQHw->cpuDataTransferHandler(transferProperties, eventsRequest, retVal); cmdQHw->cpuDataTransferHandler(transferProperties, eventsRequest, retVal);
EXPECT_EQ(CL_SUCCESS, retVal); EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(CompletionStamp::levelNotReady, castToObject<Event>(returnEvent)->peekTaskCount()); EXPECT_EQ(CompletionStamp::notReady, castToObject<Event>(returnEvent)->peekTaskCount());
clReleaseEvent(returnEvent); clReleaseEvent(returnEvent);
} }
@@ -949,12 +949,12 @@ HWTEST_F(CommandQueueHwTest, givenEventWithRecordedCommandWhenSubmitCommandIsCal
std::atomic_bool *atomicFence = nullptr; 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; neoEvent.atomicFence = &go;
EXPECT_TRUE(neoEvent.eventWithoutCommand); EXPECT_TRUE(neoEvent.eventWithoutCommand);
neoEvent.eventWithoutCommand = false; neoEvent.eventWithoutCommand = false;
EXPECT_EQ(CompletionStamp::levelNotReady, neoEvent.peekTaskCount()); EXPECT_EQ(CompletionStamp::notReady, neoEvent.peekTaskCount());
std::thread t([&]() { std::thread t([&]() {
while (!go) while (!go)
@@ -1119,7 +1119,7 @@ HWTEST_F(CommandQueueHwTest, givenBlockedOutOfOrderQueueWhenUserEventIsSubmitted
neoEvent->updateExecutionStatus(); neoEvent->updateExecutionStatus();
EXPECT_EQ(neoEvent->peekExecutionStatus(), CL_QUEUED); EXPECT_EQ(neoEvent->peekExecutionStatus(), CL_QUEUED);
EXPECT_EQ(neoEvent->peekTaskCount(), CompletionStamp::levelNotReady); EXPECT_EQ(neoEvent->peekTaskCount(), CompletionStamp::notReady);
clSetUserEventStatus(userEvent, 0u); clSetUserEventStatus(userEvent, 0u);

View File

@@ -177,7 +177,7 @@ TEST(CommandQueue, givenTimeStampWithTaskCountNotReadyStatusWhenupdateFromComple
cmdQ.taskCount = 1u; cmdQ.taskCount = 1u;
CompletionStamp cs = { CompletionStamp cs = {
CompletionStamp::levelNotReady, CompletionStamp::notReady,
0, 0,
0}; 0};
cmdQ.updateFromCompletionStamp(cs); cmdQ.updateFromCompletionStamp(cs);

View File

@@ -241,7 +241,7 @@ HWTEST_F(BarrierTest, givenBlockedCommandQueueAndEnqueueBarrierWithWaitlistRetur
EXPECT_EQ(CL_SUCCESS, retVal); EXPECT_EQ(CL_SUCCESS, retVal);
auto pEvent = (Event *)event; auto pEvent = (Event *)event;
EXPECT_EQ(pEvent->peekTaskCount(), CompletionStamp::levelNotReady); EXPECT_EQ(pEvent->peekTaskCount(), CompletionStamp::notReady);
event2.setStatus(CL_COMPLETE); event2.setStatus(CL_COMPLETE);
clReleaseEvent(event); clReleaseEvent(event);
} }

View File

@@ -79,7 +79,7 @@ HWTEST_F(EnqueueHandlerTimestampEnabledTest, givenProflingAndTimeStampPacketsEna
std::unique_ptr<GeneralSurface> surface(new GeneralSurface(allocation.get())); std::unique_ptr<GeneralSurface> surface(new GeneralSurface(allocation.get()));
EventsRequest eventsRequest(0, nullptr, nullptr); EventsRequest eventsRequest(0, nullptr, nullptr);
EventBuilder eventBuilder; 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()); auto ev = static_cast<MockEvent<UserEvent> *>(eventBuilder.getEvent());
Surface *surfaces[] = {surface.get()}; Surface *surfaces[] = {surface.get()};
auto blocking = true; auto blocking = true;
@@ -109,7 +109,7 @@ HWTEST_F(EnqueueHandlerTimestampDisabledTest, givenProflingEnabledTimeStampPacke
std::unique_ptr<GeneralSurface> surface(new GeneralSurface(allocation.get())); std::unique_ptr<GeneralSurface> surface(new GeneralSurface(allocation.get()));
EventsRequest eventsRequest(0, nullptr, nullptr); EventsRequest eventsRequest(0, nullptr, nullptr);
EventBuilder eventBuilder; 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()); auto ev = static_cast<MockEvent<UserEvent> *>(eventBuilder.getEvent());
Surface *surfaces[] = {surface.get()}; Surface *surfaces[] = {surface.get()};
auto blocking = true; auto blocking = true;

View File

@@ -280,14 +280,14 @@ HWTEST_F(EnqueueHandlerTest, WhenEnqueuingHandlerForMarkerOnBlockedQueueThenTask
auto mockCmdQ = std::unique_ptr<MockCommandQueueHw<FamilyType>>(new MockCommandQueueHw<FamilyType>(context, pClDevice, 0)); auto mockCmdQ = std::unique_ptr<MockCommandQueueHw<FamilyType>>(new MockCommandQueueHw<FamilyType>(context, pClDevice, 0));
// put queue into initial blocked state // put queue into initial blocked state
mockCmdQ->taskLevel = CompletionStamp::levelNotReady; mockCmdQ->taskLevel = CompletionStamp::notReady;
mockCmdQ->enqueueMarkerWithWaitList( mockCmdQ->enqueueMarkerWithWaitList(
0, 0,
nullptr, nullptr,
nullptr); nullptr);
EXPECT_EQ(CompletionStamp::levelNotReady, mockCmdQ->taskLevel); EXPECT_EQ(CompletionStamp::notReady, mockCmdQ->taskLevel);
} }
HWTEST_F(EnqueueHandlerTest, WhenEnqueuingBlockedWithoutReturnEventThenVirtualEventIsCreatedAndCommandQueueInternalRefCountIsIncremeted) { HWTEST_F(EnqueueHandlerTest, WhenEnqueuingBlockedWithoutReturnEventThenVirtualEventIsCreatedAndCommandQueueInternalRefCountIsIncremeted) {
@@ -301,7 +301,7 @@ HWTEST_F(EnqueueHandlerTest, WhenEnqueuingBlockedWithoutReturnEventThenVirtualEv
auto mockCmdQ = new MockCommandQueueHw<FamilyType>(context, pClDevice, 0); auto mockCmdQ = new MockCommandQueueHw<FamilyType>(context, pClDevice, 0);
// put queue into initial blocked state // put queue into initial blocked state
mockCmdQ->taskLevel = CompletionStamp::levelNotReady; mockCmdQ->taskLevel = CompletionStamp::notReady;
auto initialRefCountInternal = mockCmdQ->getRefInternalCount(); auto initialRefCountInternal = mockCmdQ->getRefInternalCount();
@@ -335,7 +335,7 @@ HWTEST_F(EnqueueHandlerTest, WhenEnqueuingBlockedThenVirtualEventIsSetAsCurrentC
auto mockCmdQ = new MockCommandQueueHw<FamilyType>(context, pClDevice, 0); auto mockCmdQ = new MockCommandQueueHw<FamilyType>(context, pClDevice, 0);
// put queue into initial blocked state // put queue into initial blocked state
mockCmdQ->taskLevel = CompletionStamp::levelNotReady; mockCmdQ->taskLevel = CompletionStamp::notReady;
bool blocking = false; bool blocking = false;
mockCmdQ->template enqueueHandler<CL_COMMAND_NDRANGE_KERNEL>(nullptr, mockCmdQ->template enqueueHandler<CL_COMMAND_NDRANGE_KERNEL>(nullptr,

View File

@@ -224,7 +224,7 @@ TEST_F(EnqueueReadBuffer, givenInOrderQueueAndForcedCpuCopyOnReadBufferAndEventN
uint32_t taskLevelCmdQ = 17; uint32_t taskLevelCmdQ = 17;
pCmdQ->taskLevel = taskLevelCmdQ; 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; cl_bool blockingRead = CL_FALSE;
size_t size = sizeof(cl_float); size_t size = sizeof(cl_float);
@@ -248,8 +248,8 @@ TEST_F(EnqueueReadBuffer, givenInOrderQueueAndForcedCpuCopyOnReadBufferAndEventN
ASSERT_NE(nullptr, event); ASSERT_NE(nullptr, event);
auto pEvent = (Event *)event; auto pEvent = (Event *)event;
EXPECT_EQ(CompletionStamp::levelNotReady, pEvent->taskLevel); EXPECT_EQ(CompletionStamp::notReady, pEvent->taskLevel);
EXPECT_EQ(CompletionStamp::levelNotReady, pCmdQ->taskLevel); EXPECT_EQ(CompletionStamp::notReady, pCmdQ->taskLevel);
event1.taskLevel = 20; event1.taskLevel = 20;
event1.setStatus(CL_COMPLETE); event1.setStatus(CL_COMPLETE);
pEvent->updateExecutionStatus(); pEvent->updateExecutionStatus();

View File

@@ -149,7 +149,7 @@ TEST_F(EnqueueWriteBufferTypeTest, givenInOrderQueueAndForcedCpuCopyOnWriteBuffe
uint32_t taskLevelCmdQ = 17; uint32_t taskLevelCmdQ = 17;
pCmdQ->taskLevel = taskLevelCmdQ; 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; cl_bool blockingWrite = CL_FALSE;
size_t size = sizeof(cl_float); size_t size = sizeof(cl_float);
@@ -173,8 +173,8 @@ TEST_F(EnqueueWriteBufferTypeTest, givenInOrderQueueAndForcedCpuCopyOnWriteBuffe
ASSERT_NE(nullptr, event); ASSERT_NE(nullptr, event);
auto pEvent = (Event *)event; auto pEvent = (Event *)event;
EXPECT_EQ(CompletionStamp::levelNotReady, pEvent->taskLevel); EXPECT_EQ(CompletionStamp::notReady, pEvent->taskLevel);
EXPECT_EQ(CompletionStamp::levelNotReady, pCmdQ->taskLevel); EXPECT_EQ(CompletionStamp::notReady, pCmdQ->taskLevel);
event1.taskLevel = 20; event1.taskLevel = 20;
event1.setStatus(CL_COMPLETE); event1.setStatus(CL_COMPLETE);
pEvent->updateExecutionStatus(); pEvent->updateExecutionStatus();

View File

@@ -48,9 +48,9 @@ class AsyncEventsHandlerTests : public ::testing::Test {
handler.reset(new MockHandler()); handler.reset(new MockHandler());
context = new NiceMock<MockContext>(); context = new NiceMock<MockContext>();
event1 = 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::levelNotReady, CompletionStamp::levelNotReady); event2 = new NiceMock<MyEvent>(context, nullptr, CL_COMMAND_BARRIER, CompletionStamp::notReady, CompletionStamp::notReady);
event3 = new NiceMock<MyEvent>(context, nullptr, CL_COMMAND_BARRIER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); event3 = new NiceMock<MyEvent>(context, nullptr, CL_COMMAND_BARRIER, CompletionStamp::notReady, CompletionStamp::notReady);
} }
void TearDown() override { void TearDown() override {
@@ -89,7 +89,7 @@ TEST_F(AsyncEventsHandlerTests, givenEventsWhenListIsProcessedThenUpdateExecutio
} }
TEST_F(AsyncEventsHandlerTests, WhenProcessIsCompletedThenRefInternalCountIsDecremented) { TEST_F(AsyncEventsHandlerTests, WhenProcessIsCompletedThenRefInternalCountIsDecremented) {
event1->setTaskStamp(CompletionStamp::levelNotReady, 0); event1->setTaskStamp(CompletionStamp::notReady, 0);
handler->registerEvent(event1); handler->registerEvent(event1);
EXPECT_EQ(2, event1->getRefInternalCount()); EXPECT_EQ(2, event1->getRefInternalCount());
@@ -100,7 +100,7 @@ TEST_F(AsyncEventsHandlerTests, WhenProcessIsCompletedThenRefInternalCountIsDecr
TEST_F(AsyncEventsHandlerTests, givenNotCalledCallbacksWhenListIsProcessedThenDontUnregister) { TEST_F(AsyncEventsHandlerTests, givenNotCalledCallbacksWhenListIsProcessedThenDontUnregister) {
int submittedCounter(0), completeCounter(0); 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_SUBMITTED, &submittedCounter);
event1->addCallback(&this->callbackFcn, CL_COMPLETE, &completeCounter); event1->addCallback(&this->callbackFcn, CL_COMPLETE, &completeCounter);
handler->registerEvent(event1); handler->registerEvent(event1);
@@ -160,7 +160,7 @@ TEST_F(AsyncEventsHandlerTests, givenExternallSynchronizedEventWhenListIsProcess
} }
TEST_F(AsyncEventsHandlerTests, givenDoubleRegisteredEventWhenListIsProcessedAndNoCallbacksToProcessThenUnregister) { TEST_F(AsyncEventsHandlerTests, givenDoubleRegisteredEventWhenListIsProcessedAndNoCallbacksToProcessThenUnregister) {
event1->setTaskStamp(CompletionStamp::levelNotReady - 1, 0); event1->setTaskStamp(CompletionStamp::notReady - 1, 0);
event1->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter); event1->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter);
handler->registerEvent(event1); handler->registerEvent(event1);
handler->registerEvent(event1); handler->registerEvent(event1);
@@ -173,8 +173,8 @@ TEST_F(AsyncEventsHandlerTests, givenDoubleRegisteredEventWhenListIsProcessedAnd
TEST_F(AsyncEventsHandlerTests, givenEventsNotHandledByHandlderWhenDestructingThenUnreferenceAll) { TEST_F(AsyncEventsHandlerTests, givenEventsNotHandledByHandlderWhenDestructingThenUnreferenceAll) {
auto myHandler = new MockHandler(); auto myHandler = new MockHandler();
event1->setTaskStamp(CompletionStamp::levelNotReady, 0); event1->setTaskStamp(CompletionStamp::notReady, 0);
event2->setTaskStamp(CompletionStamp::levelNotReady, 0); event2->setTaskStamp(CompletionStamp::notReady, 0);
event1->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter); event1->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter);
event2->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) { TEST_F(AsyncEventsHandlerTests, givenEventsNotHandledByHandlderWhenAsyncExecutionInterruptedThenUnreferenceAll) {
event1->setTaskStamp(CompletionStamp::levelNotReady, 0); event1->setTaskStamp(CompletionStamp::notReady, 0);
event2->setTaskStamp(CompletionStamp::levelNotReady, 0); event2->setTaskStamp(CompletionStamp::notReady, 0);
event1->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter); event1->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter);
event2->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) { TEST_F(AsyncEventsHandlerTests, WhenHandlerIsRegisteredThenThreadIsCreated) {
event1->setTaskStamp(CompletionStamp::levelNotReady, 0); event1->setTaskStamp(CompletionStamp::notReady, 0);
EXPECT_FALSE(handler->openThreadCalled); EXPECT_FALSE(handler->openThreadCalled);
handler->registerEvent(event1); handler->registerEvent(event1);
@@ -238,8 +238,8 @@ TEST_F(AsyncEventsHandlerTests, WhenHandlerIsRegisteredThenThreadIsCreated) {
TEST_F(AsyncEventsHandlerTests, WhenProcessingAsynchronouslyThenBothThreadsCompelete) { TEST_F(AsyncEventsHandlerTests, WhenProcessingAsynchronouslyThenBothThreadsCompelete) {
DebugManager.flags.EnableAsyncEventsHandler.set(true); DebugManager.flags.EnableAsyncEventsHandler.set(true);
event1->setTaskStamp(CompletionStamp::levelNotReady, 0); event1->setTaskStamp(CompletionStamp::notReady, 0);
event2->setTaskStamp(CompletionStamp::levelNotReady, 0); event2->setTaskStamp(CompletionStamp::notReady, 0);
event1->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter); event1->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter);
event2->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter); event2->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter);

View File

@@ -52,7 +52,7 @@ TEST(Event, WhenPeekIsCalledThenExecutionIsNotUpdated) {
auto mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr)); auto mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
MockContext ctx; MockContext ctx;
MockCommandQueue cmdQ(&ctx, mockDevice.get(), 0); 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_FALSE(event.peekIsBlocked());
EXPECT_EQ(CL_QUEUED, event.peekExecutionStatus()); EXPECT_EQ(CL_QUEUED, event.peekExecutionStatus());
@@ -73,7 +73,7 @@ TEST(Event, givenEventThatStatusChangeWhenPeekIsCalledThenEventIsNotUpdated) {
uint32_t callCount = 0u; 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); EXPECT_EQ(0u, event.callCount);
event.peekExecutionStatus(); event.peekExecutionStatus();
EXPECT_EQ(0u, event.callCount); EXPECT_EQ(0u, event.callCount);
@@ -212,7 +212,7 @@ TEST(Event, GivenNotReadyEventWhenWaitingForEventsThenQueueIsNotFlushed) {
MockContext context; MockContext context;
std::unique_ptr<MockCommandQueueWithFlushCheck> cmdQ1(new MockCommandQueueWithFlushCheck(context, device.get())); 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()}; cl_event eventWaitlist[] = {event1.get()};
Event::waitForEvents(1, eventWaitlist); Event::waitForEvents(1, eventWaitlist);
@@ -221,7 +221,7 @@ TEST(Event, GivenNotReadyEventWhenWaitingForEventsThenQueueIsNotFlushed) {
} }
TEST(Event, givenNotReadyEventOnWaitlistWhenCheckingUserEventDependeciesThenTrueIsReturned) { 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()}; cl_event eventWaitlist[] = {event1.get()};
bool userEventDependencies = Event::checkUserEventDependencies(1, eventWaitlist); bool userEventDependencies = Event::checkUserEventDependencies(1, eventWaitlist);
@@ -294,7 +294,7 @@ TEST_F(EventTest, GivenTagCsGreaterThanTaskCountWhenGettingClEventCommandExecuti
} }
TEST_F(EventTest, WhenGettingClEventCommandExecutionStatusThenEventStatusIsReturned) { 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; cl_int eventStatus = -1;
event.setStatus(-1); event.setStatus(-1);
@@ -387,7 +387,7 @@ TEST_F(EventTest, GivenInvalidEventWhenGettingEventInfoThenInvalidValueErrorIsRe
} }
TEST_F(EventTest, GivenNonBlockingEventWhenWaitingThenFalseIsReturned) { 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); auto result = event.wait(false, false);
EXPECT_FALSE(result); EXPECT_FALSE(result);
} }
@@ -931,7 +931,7 @@ HWTEST_F(EventTest, givenVirtualEventWhenCommandSubmittedThenLockCsrOccurs) {
std::unique_ptr<MockCommandComputeKernel> command = std::make_unique<MockCommandComputeKernel>(*pCmdQ, kernelOperation, surfaces, kernel); 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)); virtualEvent->setCommand(std::move(command));
@@ -949,7 +949,7 @@ HWTEST_F(EventTest, givenVirtualEventWhenSubmitCommandEventNotReadyAndEventWitho
taskLevel, taskCount) {} 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); virtualEvent->submitCommand(false);
@@ -1206,23 +1206,23 @@ TEST_F(EventTest, GivenCompletedEventWhenQueryingExecutionStatusAfterFlushThenCs
} }
HWTEST_F(EventTest, GivenEventCreatedOnMapBufferWithoutCommandWhenSubmittingCommandThenTaskCountIsNotUpdated) { 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); ev.submitCommand(false);
EXPECT_EQ(0u, ev.peekTaskCount()); EXPECT_EQ(0u, ev.peekTaskCount());
} }
HWTEST_F(EventTest, GivenEventCreatedOnMapImageWithoutCommandWhenSubmittingCommandThenTaskCountIsNotUpdated) { 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); ev.submitCommand(false);
EXPECT_EQ(0u, ev.peekTaskCount()); EXPECT_EQ(0u, ev.peekTaskCount());
} }
TEST_F(EventTest, givenCmdQueueWithoutProfilingWhenIsCpuProfilingIsCalledThenFalseIsReturned) { 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; bool cpuProfiling = ev.isCPUProfilingPath() != 0;
EXPECT_FALSE(cpuProfiling); 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}; const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0};
std::unique_ptr<MockCommandQueue> pCmdQ(new MockCommandQueue(&mockContext, pClDevice, props)); 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; bool cpuProfiling = ev.isCPUProfilingPath() != 0;
EXPECT_TRUE(cpuProfiling); EXPECT_TRUE(cpuProfiling);
} }
@@ -1355,8 +1355,8 @@ HWTEST_F(EventTest, givenEventWithNotReadyTaskLevelWhenUnblockedThenGetTaskLevel
Event parentEventWithGreaterTaskLevel(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, initialTaskLevel + 5, 0); Event parentEventWithGreaterTaskLevel(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, initialTaskLevel + 5, 0);
Event parentEventWithLowerTaskLevel(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 childEvent0(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::notReady, CompletionStamp::notReady);
Event childEvent1(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); Event childEvent1(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::notReady, CompletionStamp::notReady);
auto &csr = reinterpret_cast<UltCommandStreamReceiver<FamilyType> &>(pCmdQ->getGpgpuCommandStreamReceiver()); auto &csr = reinterpret_cast<UltCommandStreamReceiver<FamilyType> &>(pCmdQ->getGpgpuCommandStreamReceiver());
csr.taskLevel = initialTaskLevel; csr.taskLevel = initialTaskLevel;

View File

@@ -111,8 +111,8 @@ TEST(EventsTracker, givenAlreadyDumpedCmdqThenNotDumping) {
TEST(EventsTracker, givenCmqdWithTaskCountAndLevelNotReadyThenDumpingCmdqWithNotReadyLabels) { TEST(EventsTracker, givenCmqdWithTaskCountAndLevelNotReadyThenDumpingCmdqWithNotReadyLabels) {
MockCommandQueue cmdq; MockCommandQueue cmdq;
cmdq.taskCount = CompletionStamp::levelNotReady; cmdq.taskCount = CompletionStamp::notReady;
cmdq.taskLevel = CompletionStamp::levelNotReady; cmdq.taskLevel = CompletionStamp::notReady;
std::stringstream stream; std::stringstream stream;
std::set<CommandQueue *> dumped; std::set<CommandQueue *> dumped;
@@ -157,8 +157,8 @@ TEST(EventsTracker, whenCallDumpEdgeThenGetStringWithProperLabelOfDumpedEdge) {
TEST(EventsTracker, givenEventWithTaskLevelAndCountNotReadyThenDumpingNodeWithNotReadyLabels) { TEST(EventsTracker, givenEventWithTaskLevelAndCountNotReadyThenDumpingNodeWithNotReadyLabels) {
UserEvent uEvent; UserEvent uEvent;
uEvent.taskLevel = CompletionStamp::levelNotReady; uEvent.taskLevel = CompletionStamp::notReady;
uEvent.updateTaskCount(CompletionStamp::levelNotReady); uEvent.updateTaskCount(CompletionStamp::notReady);
std::stringstream stream; std::stringstream stream;
std::unordered_map<Event *, int64_t> map; std::unordered_map<Event *, int64_t> map;
@@ -203,7 +203,7 @@ TEST(EventsTracker, givenNullptrEventThenNotDumpingNode) {
TEST(EventsTracker, givenEventAndUserEventThenDumpingNodeWithProperLabels) { TEST(EventsTracker, givenEventAndUserEventThenDumpingNodeWithProperLabels) {
UserEvent uEvent; 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::stringstream stream;
std::unordered_map<Event *, int64_t> map; std::unordered_map<Event *, int64_t> map;
@@ -266,7 +266,7 @@ TEST(EventsTracker, givenEventWithCallbackThenDumpingWithProperLabel) {
} }
TEST(EventsTracker, givenSubmittedEventThenDumpingWithProperLabel) { 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::stringstream stream;
std::unordered_map<Event *, int64_t> map; std::unordered_map<Event *, int64_t> map;
@@ -484,7 +484,7 @@ TEST(EventsTracker, givenTwoEventsWithSamePtrWhenFirstOneIsDeletedThenDumpingFir
} }
TEST(EventsTracker, whenNotifyCreationOfEventThenEventIsDumped) { 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; EventsTrackerMock evTrackerMock;
std::stringstream expected; std::stringstream expected;
@@ -626,7 +626,7 @@ TEST(EventsTracker, whenEventsDebugEnableFlagIsTrueAndCreateOrChangeStatusOrDest
EventsTrackerMock evTrackerMock; EventsTrackerMock evTrackerMock;
evTrackerMock.overrideGlobal(); 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; std::stringstream expected;
expected << "digraph events_registry_" << &EventsTracker::getEventsTracker() << " {\nnode [shape=record]\n//pragma: somePragmaData\n\n}\n"; expected << "digraph events_registry_" << &EventsTracker::getEventsTracker() << " {\nnode [shape=record]\n//pragma: somePragmaData\n\n}\n";

View File

@@ -143,13 +143,13 @@ TEST(UserEvent, givenUserEventWhenStatusIsCompletedThenReturnZeroTaskLevel) {
UserEvent uEvent; UserEvent uEvent;
uEvent.setStatus(CL_QUEUED); uEvent.setStatus(CL_QUEUED);
EXPECT_EQ(CompletionStamp::levelNotReady, uEvent.getTaskLevel()); EXPECT_EQ(CompletionStamp::notReady, uEvent.getTaskLevel());
uEvent.setStatus(CL_SUBMITTED); uEvent.setStatus(CL_SUBMITTED);
EXPECT_EQ(CompletionStamp::levelNotReady, uEvent.getTaskLevel()); EXPECT_EQ(CompletionStamp::notReady, uEvent.getTaskLevel());
uEvent.setStatus(CL_RUNNING); uEvent.setStatus(CL_RUNNING);
EXPECT_EQ(CompletionStamp::levelNotReady, uEvent.getTaskLevel()); EXPECT_EQ(CompletionStamp::notReady, uEvent.getTaskLevel());
uEvent.setStatus(CL_COMPLETE); uEvent.setStatus(CL_COMPLETE);
EXPECT_EQ(0u, uEvent.getTaskLevel()); EXPECT_EQ(0u, uEvent.getTaskLevel());
@@ -172,10 +172,10 @@ TEST_F(MockEventTests, GivenBlockedUserEventWhenEnqueueingNdRangeWithoutReturnEv
auto taskCountAfter = csr.peekTaskCount(); auto taskCountAfter = csr.peekTaskCount();
//queue should be in blocked state at this moment, task level should be inherited from user event //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 //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 //queue should be in blocked state
EXPECT_EQ(pCmdQ->isQueueBlocked(), true); EXPECT_EQ(pCmdQ->isQueueBlocked(), true);
@@ -205,10 +205,10 @@ TEST_F(MockEventTests, GivenBlockedUserEventWhenEnqueueingNdRangeWithReturnEvent
auto taskCountAfter = csr.peekTaskCount(); auto taskCountAfter = csr.peekTaskCount();
//queue should be in blocked state at this moment, task level should be inherited from user event //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 //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 //queue should be in blocked state
EXPECT_EQ(pCmdQ->isQueueBlocked(), true); EXPECT_EQ(pCmdQ->isQueueBlocked(), true);
@@ -224,7 +224,7 @@ TEST_F(MockEventTests, GivenBlockedUserEventWhenEnqueueingNdRangeWithReturnEvent
//and if normal event inherited status from user event //and if normal event inherited status from user event
Event *returnEvent = castToObject<Event>(retEvent); Event *returnEvent = castToObject<Event>(retEvent);
EXPECT_EQ(returnEvent->taskLevel, CompletionStamp::levelNotReady); EXPECT_EQ(returnEvent->taskLevel, CompletionStamp::notReady);
EXPECT_EQ(CL_SUCCESS, retVal); EXPECT_EQ(CL_SUCCESS, retVal);
@@ -376,7 +376,7 @@ TEST_F(EventTests, givenQueueThatIsBlockedByUserEventWhenIsQueueBlockedIsCalledT
} }
bool updateExecutionStatusCalled = false; 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; pCmdQ->virtualEvent = &mockedVirtualEvent;
EXPECT_TRUE(pCmdQ->isQueueBlocked()); EXPECT_TRUE(pCmdQ->isQueueBlocked());
@@ -454,8 +454,8 @@ TEST_F(MockEventTests, GivenUserEventWhenSettingStatusCompleteThenTaskLevelIsUpd
//check if dependency count is increased //check if dependency count is increased
Event *returnEvent = castToObject<Event>(retEvent); Event *returnEvent = castToObject<Event>(retEvent);
EXPECT_EQ(CompletionStamp::levelNotReady, returnEvent->taskLevel); EXPECT_EQ(CompletionStamp::notReady, returnEvent->taskLevel);
EXPECT_EQ(CompletionStamp::levelNotReady, returnEvent->peekTaskCount()); EXPECT_EQ(CompletionStamp::notReady, returnEvent->peekTaskCount());
//now set user event for complete status, this triggers update of childs. //now set user event for complete status, this triggers update of childs.
uEvent->setStatus(CL_COMPLETE); uEvent->setStatus(CL_COMPLETE);
@@ -481,7 +481,7 @@ TEST_F(MockEventTests, GivenCompleteParentWhenWaitingForEventsThenChildrenAreCom
//check if dependency count is increased //check if dependency count is increased
Event *returnEvent = castToObject<Event>(retEvent); 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. //now set user event for complete status, this triggers update of childs.
uEvent->setStatus(CL_COMPLETE); uEvent->setStatus(CL_COMPLETE);
@@ -527,7 +527,7 @@ TEST_F(MockEventTests, GivenAbortedUserEventWhenEnqueingNdrThenDoNotFlushToCsr)
EXPECT_EQ(taskCount, taskCountAfter); EXPECT_EQ(taskCount, taskCountAfter);
Event *pChildEvent = (Event *)retEvent; Event *pChildEvent = (Event *)retEvent;
EXPECT_EQ(CompletionStamp::levelNotReady, pChildEvent->getTaskLevel()); EXPECT_EQ(CompletionStamp::notReady, pChildEvent->getTaskLevel());
cl_int eventStatus = 0; cl_int eventStatus = 0;
retVal = clGetEventInfo(retEvent, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(cl_int), &eventStatus, NULL); 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); EXPECT_EQ(taskCount, taskCountAfter);
Event *pChildEvent = (Event *)retEvent; Event *pChildEvent = (Event *)retEvent;
EXPECT_EQ(CompletionStamp::levelNotReady, pChildEvent->taskLevel); EXPECT_EQ(CompletionStamp::notReady, pChildEvent->taskLevel);
cl_int eventStatus = 0; cl_int eventStatus = 0;
retVal = clGetEventInfo(retEvent, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(cl_int), &eventStatus, NULL); retVal = clGetEventInfo(retEvent, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(cl_int), &eventStatus, NULL);

View File

@@ -101,7 +101,7 @@ TEST_F(InternalAllocationStorageTest, whenAllocationIsStoredAsTemporaryAndIsStil
memoryManager->freeGraphicsMemory(newAllocation.release()); memoryManager->freeGraphicsMemory(newAllocation.release());
} }
TEST_F(InternalAllocationStorageTest, givenTemporaryAllocationWhenAllocationIsObtainedThenItsTaskCountIsSetToLevelNotReady) { TEST_F(InternalAllocationStorageTest, givenTemporaryAllocationWhenAllocationIsObtainedThenItsTaskCountIsSetToNotReady) {
const uint32_t initialTaskCount = 37u; const uint32_t initialTaskCount = 37u;
const uint32_t contextId = csr->getOsContext().getContextId(); 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); auto newAllocation = storage->obtainTemporaryAllocationWithPtr(1, allocation->getUnderlyingBuffer(), GraphicsAllocation::AllocationType::BUFFER);
EXPECT_EQ(allocation, newAllocation.get()); EXPECT_EQ(allocation, newAllocation.get());
EXPECT_EQ(CompletionStamp::levelNotReady, allocation->getTaskCount(contextId)); EXPECT_EQ(CompletionStamp::notReady, allocation->getTaskCount(contextId));
memoryManager->freeGraphicsMemory(newAllocation.release()); memoryManager->freeGraphicsMemory(newAllocation.release());
} }

View File

@@ -95,7 +95,7 @@ TEST_F(EventTests, givenUserEventBlockingEnqueueWithBlockingFlagWhenUserEventIsC
while (true) { while (true) {
pCmdQ->takeOwnership(); pCmdQ->takeOwnership();
if (pCmdQ->taskLevel == CompletionStamp::levelNotReady) { if (pCmdQ->taskLevel == CompletionStamp::notReady) {
pCmdQ->releaseOwnership(); pCmdQ->releaseOwnership();
break; break;
} }

View File

@@ -956,7 +956,7 @@ struct ProfilingTimestampPacketsTest : public ::testing::Test {
MockContext context; MockContext context;
cl_command_queue_properties props[5] = {0, 0, 0, 0, 0}; cl_command_queue_properties props[5] = {0, 0, 0, 0, 0};
ReleaseableObjectPtr<MockCommandQueue> cmdQ = clUniquePtr(new MockCommandQueue(&context, context.getDevice(0), props)); 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) { TEST_F(ProfilingTimestampPacketsTest, givenTimestampsPacketContainerWithOneElementAndTimestampNodeWhenCalculatingProfilingThenTimesAreTakenFromPacket) {

View File

@@ -38,14 +38,14 @@ HWTEST_F(BarrierScenarioTest, givenBlockedEnqueueBarrierOnOOQWhenUserEventIsUnbl
retVal = clEnqueueBarrierWithWaitList(clCommandQ, 1, &eventBlocking, nullptr); retVal = clEnqueueBarrierWithWaitList(clCommandQ, 1, &eventBlocking, nullptr);
EXPECT_EQ(success, retVal); EXPECT_EQ(success, retVal);
EXPECT_EQ(CompletionStamp::levelNotReady, mockCmdQ->taskLevel); EXPECT_EQ(CompletionStamp::notReady, mockCmdQ->taskLevel);
EXPECT_NE(nullptr, mockCmdQ->virtualEvent); EXPECT_NE(nullptr, mockCmdQ->virtualEvent);
clSetUserEventStatus(eventBlocking, CL_COMPLETE); clSetUserEventStatus(eventBlocking, CL_COMPLETE);
userEvent->release(); userEvent->release();
mockCmdQ->isQueueBlocked(); mockCmdQ->isQueueBlocked();
EXPECT_NE(CompletionStamp::levelNotReady, mockCmdQ->taskLevel); EXPECT_NE(CompletionStamp::notReady, mockCmdQ->taskLevel);
EXPECT_EQ(nullptr, mockCmdQ->virtualEvent); EXPECT_EQ(nullptr, mockCmdQ->virtualEvent);
retVal = clEnqueueNDRangeKernel(clCommandQ, clKernel, 1, offset, gws, nullptr, 0, nullptr, nullptr); retVal = clEnqueueNDRangeKernel(clCommandQ, clKernel, 1, offset, gws, nullptr, 0, nullptr, nullptr);

View File

@@ -107,7 +107,7 @@ struct GlArbSyncEventTest : public ::testing::Test {
MockBaseEvent *getBaseEvent() { MockBaseEvent *getBaseEvent() {
if (baseEvent == nullptr) { if (baseEvent == nullptr) {
triggerEvent = new UserEvent(ctx.get()); 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); triggerEvent->addChild(*baseEvent);
} }
return baseEvent; return baseEvent;
@@ -231,7 +231,7 @@ TEST_F(GlArbSyncEventTest, whenGlArbSyncEventGetsUnblockedBySubmittedOrCompleted
} }
TEST_F(GlArbSyncEventTest, whenGlArbSyncEventIsCreatedFromBaseEventWithoutValidContextThenCreationFails) { 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); auto *arbEvent = GlArbSyncEvent::create(*baseEvent);
EXPECT_EQ(nullptr, arbEvent); EXPECT_EQ(nullptr, arbEvent);
baseEvent->release(); baseEvent->release();

View File

@@ -1102,8 +1102,8 @@ HWTEST_F(glSharingTests, givenSyncObjectWhenCreateEventIsCalledThenCreateGLSyncO
auto eventObj = castToObject<Event>(event); auto eventObj = castToObject<Event>(event);
EXPECT_TRUE(eventObj->getCommandType() == CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR); EXPECT_TRUE(eventObj->getCommandType() == CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR);
EXPECT_TRUE(eventObj->peekExecutionStatus() == CL_SUBMITTED); EXPECT_TRUE(eventObj->peekExecutionStatus() == CL_SUBMITTED);
EXPECT_EQ(CompletionStamp::levelNotReady, eventObj->taskLevel); EXPECT_EQ(CompletionStamp::notReady, eventObj->taskLevel);
EXPECT_EQ(CompletionStamp::levelNotReady, eventObj->getTaskLevel()); EXPECT_EQ(CompletionStamp::notReady, eventObj->getTaskLevel());
EXPECT_EQ(1, mockGlSharing->dllParam->getParam("GLRetainSyncCalled")); EXPECT_EQ(1, mockGlSharing->dllParam->getParam("GLRetainSyncCalled"));
eventObj->setStatus(CL_COMPLETE); eventObj->setStatus(CL_COMPLETE);

View File

@@ -490,7 +490,7 @@ bool CommandStreamReceiver::createAllocationForHostSurface(HostPtrSurface &surfa
if (allocation == nullptr) { if (allocation == nullptr) {
return false; return false;
} }
allocation->updateTaskCount(CompletionStamp::levelNotReady, osContext->getContextId()); allocation->updateTaskCount(CompletionStamp::notReady, osContext->getContextId());
surface.setAllocation(allocation.get()); surface.setAllocation(allocation.get());
internalAllocationStorage->storeAllocation(std::move(allocation), TEMPORARY_ALLOCATION); internalAllocationStorage->storeAllocation(std::move(allocation), TEMPORARY_ALLOCATION);
return true; return true;

View File

@@ -169,7 +169,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
DEBUG_BREAK_IF(&commandStreamTask == &commandStream); DEBUG_BREAK_IF(&commandStreamTask == &commandStream);
DEBUG_BREAK_IF(!(dispatchFlags.preemptionMode == PreemptionMode::Disabled ? device.getPreemptionMode() == PreemptionMode::Disabled : true)); 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); DBG_LOG(LogTaskCounts, __FUNCTION__, "Line: ", __LINE__, "taskLevel", taskLevel);

View File

@@ -9,6 +9,6 @@
namespace NEO { namespace NEO {
const uint32_t CompletionStamp::levelNotReady = 0xFFFFFFF0; const uint32_t CompletionStamp::notReady = 0xFFFFFFF0;
} // namespace NEO } // namespace NEO

View File

@@ -16,7 +16,7 @@ struct CompletionStamp {
uint32_t taskLevel; uint32_t taskLevel;
FlushStamp flushStamp; FlushStamp flushStamp;
static const uint32_t levelNotReady; static const uint32_t notReady;
}; };
} // namespace NEO } // namespace NEO

View File

@@ -32,6 +32,6 @@ enum CommandStreamReceiverType {
extern const char *folderAUB; extern const char *folderAUB;
// Initial value for HW tag // 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; extern uint32_t initialHardwareTag;
} // namespace NEO } // namespace NEO

View File

@@ -107,8 +107,8 @@ GraphicsAllocation *AllocationsList::detachAllocationImpl(GraphicsAllocation *,
(this->allocationUsage == TEMPORARY_ALLOCATION || *req->csrTagAddress >= curr->getTaskCount(req->contextId)) && (this->allocationUsage == TEMPORARY_ALLOCATION || *req->csrTagAddress >= curr->getTaskCount(req->contextId)) &&
(req->requiredPtr == nullptr || req->requiredPtr == curr->getUnderlyingBuffer())) { (req->requiredPtr == nullptr || req->requiredPtr == curr->getUnderlyingBuffer())) {
if (this->allocationUsage == TEMPORARY_ALLOCATION) { if (this->allocationUsage == TEMPORARY_ALLOCATION) {
// We may not have proper task count yet, so set levelNotReady to avoid releasing in a different thread // We may not have proper task count yet, so set notReady to avoid releasing in a different thread
curr->updateTaskCount(CompletionStamp::levelNotReady, req->contextId); curr->updateTaskCount(CompletionStamp::notReady, req->contextId);
} }
return removeOneImpl(curr, nullptr); return removeOneImpl(curr, nullptr);
} }