mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Remove TSP atomic dependency tracking
This reverts commit d17668f023bee409ee68e766bbc7d5f16ce8d52b. Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
13b9f54c7d
commit
e1f42c2ae1
@@ -102,7 +102,6 @@ set(NEO_CORE_HELPERS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/timestamp_offsets.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/timestamp_packet.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/timestamp_packet.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/timestamp_packet_extra.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/uint16_avx2.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/uint16_sse4.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/vec.h
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#include "pipe_control_args.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
@@ -49,20 +48,6 @@ class TimestampPackets : public TagTypeBase {
|
||||
|
||||
static constexpr size_t getSinglePacketSize() { return sizeof(Packet); }
|
||||
|
||||
bool isCompleted() const {
|
||||
if (DebugManager.flags.DisableAtomicForPostSyncs.get()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < packetsUsed; i++) {
|
||||
if (packets[i].contextEnd == 1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void initialize() {
|
||||
for (auto &packet : packets) {
|
||||
packet.contextStart = 1u;
|
||||
@@ -71,7 +56,6 @@ class TimestampPackets : public TagTypeBase {
|
||||
packet.globalEnd = 1u;
|
||||
}
|
||||
packetsUsed = 1;
|
||||
implicitGpuDependenciesCount = 0;
|
||||
}
|
||||
|
||||
void assignDataToAllTimestamps(uint32_t packetIndex, void *source) {
|
||||
@@ -82,7 +66,6 @@ class TimestampPackets : public TagTypeBase {
|
||||
static constexpr size_t getContextStartOffset() { return offsetof(Packet, contextStart); }
|
||||
static constexpr size_t getContextEndOffset() { return offsetof(Packet, contextEnd); }
|
||||
static constexpr size_t getGlobalEndOffset() { return offsetof(Packet, globalEnd); }
|
||||
size_t getImplicitGpuDependenciesCountOffset() const { return ptrDiff(&implicitGpuDependenciesCount, this); }
|
||||
|
||||
uint64_t getContextStartValue(uint32_t packetIndex) const { return static_cast<uint64_t>(packets[packetIndex].contextStart); }
|
||||
uint64_t getGlobalStartValue(uint32_t packetIndex) const { return static_cast<uint64_t>(packets[packetIndex].globalStart); }
|
||||
@@ -92,16 +75,13 @@ class TimestampPackets : public TagTypeBase {
|
||||
void setPacketsUsed(uint32_t used) { packetsUsed = used; }
|
||||
uint32_t getPacketsUsed() const { return packetsUsed; }
|
||||
|
||||
uint32_t getImplicitGpuDependenciesCount() const { return implicitGpuDependenciesCount; }
|
||||
|
||||
protected:
|
||||
Packet packets[TimestampPacketSizeControl::preferredPacketCount];
|
||||
uint32_t implicitGpuDependenciesCount = 0;
|
||||
uint32_t packetsUsed = 1;
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
static_assert(((4 * TimestampPacketSizeControl::preferredPacketCount + 2) * sizeof(uint32_t)) == sizeof(TimestampPackets<uint32_t>),
|
||||
static_assert(((4 * TimestampPacketSizeControl::preferredPacketCount + 1) * sizeof(uint32_t)) == sizeof(TimestampPackets<uint32_t>),
|
||||
"This structure is consumed by GPU and has to follow specific restrictions for padding and size");
|
||||
|
||||
class TimestampPacketContainer : public NonCopyableClass {
|
||||
@@ -146,49 +126,24 @@ struct TimestampPacketHelper {
|
||||
return timestampPacketNode.getGpuAddress() + timestampPacketNode.getGlobalStartOffset();
|
||||
}
|
||||
|
||||
static uint64_t getGpuDependenciesCountGpuAddress(const TagNodeBase ×tampPacketNode) {
|
||||
return timestampPacketNode.getGpuAddress() + timestampPacketNode.getImplicitGpuDependenciesCountOffset();
|
||||
}
|
||||
|
||||
static void overrideSupportedDevicesCount(uint32_t &numSupportedDevices);
|
||||
|
||||
template <typename GfxFamily>
|
||||
static void programSemaphoreWithImplicitDependency(LinearStream &cmdStream, TagNodeBase ×tampPacketNode, uint32_t numSupportedDevices) {
|
||||
using MI_ATOMIC = typename GfxFamily::MI_ATOMIC;
|
||||
static void programSemaphore(LinearStream &cmdStream, TagNodeBase ×tampPacketNode) {
|
||||
using COMPARE_OPERATION = typename GfxFamily::MI_SEMAPHORE_WAIT::COMPARE_OPERATION;
|
||||
using MI_SEMAPHORE_WAIT = typename GfxFamily::MI_SEMAPHORE_WAIT;
|
||||
|
||||
auto compareAddress = getContextEndGpuAddress(timestampPacketNode);
|
||||
auto dependenciesCountAddress = getGpuDependenciesCountGpuAddress(timestampPacketNode);
|
||||
|
||||
for (uint32_t packetId = 0; packetId < timestampPacketNode.getPacketsUsed(); packetId++) {
|
||||
uint64_t compareOffset = packetId * timestampPacketNode.getSinglePacketSize();
|
||||
EncodeSempahore<GfxFamily>::addMiSemaphoreWaitCommand(cmdStream, compareAddress + compareOffset, 1, COMPARE_OPERATION::COMPARE_OPERATION_SAD_NOT_EQUAL_SDD);
|
||||
}
|
||||
|
||||
bool trackPostSyncDependencies = true;
|
||||
if (DebugManager.flags.DisableAtomicForPostSyncs.get()) {
|
||||
trackPostSyncDependencies = false;
|
||||
}
|
||||
|
||||
if (trackPostSyncDependencies) {
|
||||
overrideSupportedDevicesCount(numSupportedDevices);
|
||||
|
||||
for (uint32_t i = 0; i < numSupportedDevices; i++) {
|
||||
timestampPacketNode.incImplicitCpuDependenciesCount();
|
||||
}
|
||||
EncodeAtomic<GfxFamily>::programMiAtomic(cmdStream, dependenciesCountAddress,
|
||||
MI_ATOMIC::ATOMIC_OPCODES::ATOMIC_4B_INCREMENT,
|
||||
MI_ATOMIC::DATA_SIZE::DATA_SIZE_DWORD,
|
||||
0u, 0u, 0x0u, 0x0u);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
static void programCsrDependenciesForTimestampPacketContainer(LinearStream &cmdStream, const CsrDependencies &csrDependencies, uint32_t numSupportedDevices) {
|
||||
static void programCsrDependenciesForTimestampPacketContainer(LinearStream &cmdStream, const CsrDependencies &csrDependencies) {
|
||||
for (auto timestampPacketContainer : csrDependencies.timestampPacketContainer) {
|
||||
for (auto &node : timestampPacketContainer->peekNodes()) {
|
||||
TimestampPacketHelper::programSemaphoreWithImplicitDependency<GfxFamily>(cmdStream, *node, numSupportedDevices);
|
||||
TimestampPacketHelper::programSemaphore<GfxFamily>(cmdStream, *node);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,9 +164,9 @@ struct TimestampPacketHelper {
|
||||
}
|
||||
|
||||
template <typename GfxFamily, AuxTranslationDirection auxTranslationDirection>
|
||||
static void programSemaphoreWithImplicitDependencyForAuxTranslation(LinearStream &cmdStream,
|
||||
const TimestampPacketDependencies *timestampPacketDependencies,
|
||||
const HardwareInfo &hwInfo, uint32_t numSupportedDevices) {
|
||||
static void programSemaphoreForAuxTranslation(LinearStream &cmdStream,
|
||||
const TimestampPacketDependencies *timestampPacketDependencies,
|
||||
const HardwareInfo &hwInfo) {
|
||||
auto &container = (auxTranslationDirection == AuxTranslationDirection::AuxToNonAux)
|
||||
? timestampPacketDependencies->auxToNonAuxNodes
|
||||
: timestampPacketDependencies->nonAuxToAuxNodes;
|
||||
@@ -228,7 +183,7 @@ struct TimestampPacketHelper {
|
||||
}
|
||||
|
||||
for (auto &node : container.peekNodes()) {
|
||||
TimestampPacketHelper::programSemaphoreWithImplicitDependency<GfxFamily>(cmdStream, *node, numSupportedDevices);
|
||||
TimestampPacketHelper::programSemaphore<GfxFamily>(cmdStream, *node);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,14 +200,12 @@ struct TimestampPacketHelper {
|
||||
|
||||
template <typename GfxFamily>
|
||||
static size_t getRequiredCmdStreamSizeForNodeDependencyWithBlitEnqueue() {
|
||||
return sizeof(typename GfxFamily::MI_SEMAPHORE_WAIT) + sizeof(typename GfxFamily::MI_ATOMIC);
|
||||
return sizeof(typename GfxFamily::MI_SEMAPHORE_WAIT);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
static size_t getRequiredCmdStreamSizeForNodeDependency(TagNodeBase ×tampPacketNode) {
|
||||
size_t totalMiSemaphoreWaitSize = timestampPacketNode.getPacketsUsed() * sizeof(typename GfxFamily::MI_SEMAPHORE_WAIT);
|
||||
|
||||
return totalMiSemaphoreWaitSize + sizeof(typename GfxFamily::MI_ATOMIC);
|
||||
return (timestampPacketNode.getPacketsUsed() * sizeof(typename GfxFamily::MI_SEMAPHORE_WAIT));
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/timestamp_packet.h"
|
||||
|
||||
namespace NEO {
|
||||
void TimestampPacketHelper::overrideSupportedDevicesCount(uint32_t &numSupportedDevices) {
|
||||
}
|
||||
} // namespace NEO
|
||||
Reference in New Issue
Block a user