Use CPU pointers for TimestampPacket where appropriate.

Related-To: NEO-2872

Change-Id: Ic91a1dd6252d2970e20bb32c3d867449041cbb8a
Signed-off-by: Piotr Fusik <piotr.fusik@intel.com>
This commit is contained in:
Piotr Fusik
2019-04-11 11:34:22 +02:00
committed by sys_ocldev
parent dd4b3a9f14
commit 543b3d39d0
3 changed files with 11 additions and 27 deletions

View File

@@ -60,15 +60,12 @@ class TimestampPacket {
}
void initialize() {
for (auto index = 0u; index < data.size(); index++) {
data[index] = 1;
}
std::fill(data.begin(), data.end(), 1u);
implicitDependenciesCount.store(0);
}
void incImplicitDependenciesCount() { implicitDependenciesCount++; }
protected:
std::array<uint32_t, static_cast<uint32_t>(DataIndex::Max) * TimestampPacketSizeControl::preferedChunkCount> data;
std::atomic<uint32_t> implicitDependenciesCount;
};
@@ -99,7 +96,7 @@ struct TimestampPacketHelper {
static void programSemaphoreWithImplicitDependency(LinearStream &cmdStream, TagNode<TimestampPacket> &timestampPacketNode) {
using MI_ATOMIC = typename GfxFamily::MI_ATOMIC;
auto compareAddress = getGpuAddressForDataWrite(timestampPacketNode, TimestampPacket::DataIndex::ContextEnd);
auto dependenciesCountAddress = getImplicitDependenciesCounGpuWriteAddress(timestampPacketNode);
auto dependenciesCountAddress = timestampPacketNode.getGpuAddress() + offsetof(TimestampPacket, implicitDependenciesCount);
KernelCommandsHelper<GfxFamily>::programMiSemaphoreWait(cmdStream, compareAddress, 1);
@@ -115,13 +112,6 @@ struct TimestampPacketHelper {
return timestampPacketNodes.getGpuAddress() + offset;
}
static uint64_t getImplicitDependenciesCounGpuWriteAddress(TagNode<TimestampPacket> &timestampPacketNodes) {
auto offset = static_cast<uint32_t>(TimestampPacket::DataIndex::Max) *
TimestampPacketSizeControl::preferedChunkCount *
sizeof(uint32_t);
return timestampPacketNodes.getGpuAddress() + offset;
}
template <typename GfxFamily>
static void programCsrDependencies(LinearStream &cmdStream, const CsrDependencies &csrDependencies) {
for (auto timestampPacketContainer : csrDependencies) {