mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 10:26:29 +08:00
Assign data only to unused barrier timestamps
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
5350553f72
commit
aa46dd9cdf
@@ -985,6 +985,16 @@ void CommandQueue::aubCaptureHook(bool &blocking, bool &clearAllDependencies, co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CommandQueue::assignDataToOverwrittenBcsNode(TagNodeBase *node) {
|
||||||
|
std::array<uint32_t, 8u> timestampData;
|
||||||
|
timestampData.fill(std::numeric_limits<uint32_t>::max());
|
||||||
|
if (node->refCountFetchSub(0) <= 2) { //One ref from deferred container and one from bcs barrier container it is going to be released from
|
||||||
|
for (uint32_t i = 0; i < node->getPacketsUsed(); i++) {
|
||||||
|
node->assignDataToAllTimestamps(i, timestampData.data());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool CommandQueue::isWaitForTimestampsEnabled() const {
|
bool CommandQueue::isWaitForTimestampsEnabled() const {
|
||||||
auto &hwHelper = HwHelper::get(getDevice().getHardwareInfo().platform.eRenderCoreFamily);
|
auto &hwHelper = HwHelper::get(getDevice().getHardwareInfo().platform.eRenderCoreFamily);
|
||||||
auto enabled = CommandQueue::isTimestampWaitEnabled();
|
auto enabled = CommandQueue::isTimestampWaitEnabled();
|
||||||
@@ -1061,12 +1071,8 @@ void CommandQueue::setupBarrierTimestampForBcsEngines(aub_stream::EngineType eng
|
|||||||
|
|
||||||
// Save latest timestamp (override previous, if any).
|
// Save latest timestamp (override previous, if any).
|
||||||
if (!bcsTimestampPacketContainers[currentBcsIndex].lastBarrierToWaitFor.peekNodes().empty()) {
|
if (!bcsTimestampPacketContainers[currentBcsIndex].lastBarrierToWaitFor.peekNodes().empty()) {
|
||||||
std::array<uint32_t, 8u> timestampData;
|
|
||||||
timestampData.fill(std::numeric_limits<uint32_t>::max());
|
|
||||||
for (auto &node : bcsTimestampPacketContainers[currentBcsIndex].lastBarrierToWaitFor.peekNodes()) {
|
for (auto &node : bcsTimestampPacketContainers[currentBcsIndex].lastBarrierToWaitFor.peekNodes()) {
|
||||||
for (uint32_t i = 0; i < node->getPacketsUsed(); i++) {
|
this->assignDataToOverwrittenBcsNode(node);
|
||||||
node->assignDataToAllTimestamps(i, timestampData.data());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TimestampPacketContainer newContainer{};
|
TimestampPacketContainer newContainer{};
|
||||||
|
|||||||
@@ -383,6 +383,7 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
|
|||||||
MOCKABLE_VIRTUAL bool blitEnqueueImageAllowed(const size_t *origin, const size_t *region, const Image &image) const;
|
MOCKABLE_VIRTUAL bool blitEnqueueImageAllowed(const size_t *origin, const size_t *region, const Image &image) const;
|
||||||
void aubCaptureHook(bool &blocking, bool &clearAllDependencies, const MultiDispatchInfo &multiDispatchInfo);
|
void aubCaptureHook(bool &blocking, bool &clearAllDependencies, const MultiDispatchInfo &multiDispatchInfo);
|
||||||
virtual bool obtainTimestampPacketForCacheFlush(bool isCacheFlushRequired) const = 0;
|
virtual bool obtainTimestampPacketForCacheFlush(bool isCacheFlushRequired) const = 0;
|
||||||
|
void assignDataToOverwrittenBcsNode(TagNodeBase *node);
|
||||||
|
|
||||||
Context *context = nullptr;
|
Context *context = nullptr;
|
||||||
ClDevice *device = nullptr;
|
ClDevice *device = nullptr;
|
||||||
|
|||||||
@@ -2135,6 +2135,19 @@ TEST_F(CommandQueueWithTimestampPacketTests, givenOutOfOrderQueueWhenSetupBarrie
|
|||||||
EXPECT_EQ(1u, barrierNode->getContextEndValue(0u));
|
EXPECT_EQ(1u, barrierNode->getContextEndValue(0u));
|
||||||
dependencies.moveNodesToNewContainer(*queue.getDeferredTimestampPackets());
|
dependencies.moveNodesToNewContainer(*queue.getDeferredTimestampPackets());
|
||||||
queue.getGpgpuCommandStreamReceiver().requestStallingCommandsOnNextFlush();
|
queue.getGpgpuCommandStreamReceiver().requestStallingCommandsOnNextFlush();
|
||||||
|
barrierNode->incRefCount();
|
||||||
|
barrierNode->incRefCount();
|
||||||
|
barrierNode->incRefCount();
|
||||||
|
barrierNode->incRefCount();
|
||||||
|
|
||||||
|
queue.setupBarrierTimestampForBcsEngines(aub_stream::EngineType::ENGINE_BCS, dependencies);
|
||||||
|
EXPECT_EQ(1u, barrierNode->getContextEndValue(0u));
|
||||||
|
EXPECT_EQ(1u, dependencies.barrierNodes.peekNodes().size());
|
||||||
|
barrierNode->refCountFetchSub(4u);
|
||||||
|
barrierNode = dependencies.barrierNodes.peekNodes()[0];
|
||||||
|
EXPECT_EQ(1u, barrierNode->getContextEndValue(0u));
|
||||||
|
dependencies.moveNodesToNewContainer(*queue.getDeferredTimestampPackets());
|
||||||
|
queue.getGpgpuCommandStreamReceiver().requestStallingCommandsOnNextFlush();
|
||||||
|
|
||||||
queue.setupBarrierTimestampForBcsEngines(aub_stream::EngineType::ENGINE_BCS, dependencies);
|
queue.setupBarrierTimestampForBcsEngines(aub_stream::EngineType::ENGINE_BCS, dependencies);
|
||||||
EXPECT_NE(1u, barrierNode->getContextEndValue(0u));
|
EXPECT_NE(1u, barrierNode->getContextEndValue(0u));
|
||||||
|
|||||||
Reference in New Issue
Block a user