TSP: Move packetsUsed member out of GraphicsAllocation

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2021-07-22 15:27:05 +00:00
committed by Compute-Runtime-Automation
parent f22251f68a
commit 31250b343f
8 changed files with 24 additions and 45 deletions

View File

@@ -55,7 +55,6 @@ class TimestampPackets : public TagTypeBase {
packet.contextEnd = 1u;
packet.globalEnd = 1u;
}
packetsUsed = 1;
}
void assignDataToAllTimestamps(uint32_t packetIndex, void *source) {
@@ -72,16 +71,12 @@ class TimestampPackets : public TagTypeBase {
uint64_t getContextEndValue(uint32_t packetIndex) const { return static_cast<uint64_t>(packets[packetIndex].contextEnd); }
uint64_t getGlobalEndValue(uint32_t packetIndex) const { return static_cast<uint64_t>(packets[packetIndex].globalEnd); }
void setPacketsUsed(uint32_t used) { packetsUsed = used; }
uint32_t getPacketsUsed() const { return packetsUsed; }
protected:
Packet packets[TimestampPacketSizeControl::preferredPacketCount];
uint32_t packetsUsed = 1;
};
#pragma pack()
static_assert(((4 * TimestampPacketSizeControl::preferredPacketCount + 1) * sizeof(uint32_t)) == sizeof(TimestampPackets<uint32_t>),
static_assert(((4 * TimestampPacketSizeControl::preferredPacketCount) * 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 {

View File

@@ -72,8 +72,8 @@ class TagNodeBase : public NonCopyableOrMovableClass {
virtual uint64_t &getGlobalEndRef() const = 0;
virtual uint64_t &getContextCompleteRef() const = 0;
virtual void setPacketsUsed(uint32_t used) = 0;
virtual uint32_t getPacketsUsed() const = 0;
void setPacketsUsed(uint32_t used) { packetsUsed = used; };
uint32_t getPacketsUsed() const { return packetsUsed; };
virtual size_t getSinglePacketSize() const = 0;
@@ -87,6 +87,7 @@ class TagNodeBase : public NonCopyableOrMovableClass {
MultiGraphicsAllocation *gfxAllocation = nullptr;
uint64_t gpuAddress = 0;
std::atomic<uint32_t> refCount{0};
uint32_t packetsUsed = 1;
bool doNotReleaseNodes = false;
bool profilingCapable = true;
@@ -104,6 +105,7 @@ class TagNode : public TagNodeBase, public IDNode<TagNode<TagType>> {
void initialize() override {
tagForCpuAccess->initialize();
packetsUsed = 1;
setProfilingCapable(true);
}
@@ -124,9 +126,6 @@ class TagNode : public TagNodeBase, public IDNode<TagNode<TagType>> {
uint64_t &getGlobalEndRef() const override;
uint64_t &getContextCompleteRef() const override;
void setPacketsUsed(uint32_t used) override;
uint32_t getPacketsUsed() const override;
size_t getSinglePacketSize() const override;
MetricsLibraryApi::QueryHandle_1_0 &getQueryHandleRef() const override;

View File

@@ -222,25 +222,6 @@ uint64_t &TagNode<TagType>::getGlobalEndRef() const {
}
}
template <typename TagType>
void TagNode<TagType>::setPacketsUsed(uint32_t used) {
if constexpr (TagType::getTagNodeType() == TagNodeType::TimestampPacket) {
return tagForCpuAccess->setPacketsUsed(used);
} else {
UNUSED_VARIABLE(used);
UNRECOVERABLE_IF(true);
}
}
template <typename TagType>
uint32_t TagNode<TagType>::getPacketsUsed() const {
if constexpr (TagType::getTagNodeType() == TagNodeType::TimestampPacket) {
return tagForCpuAccess->getPacketsUsed();
} else {
UNRECOVERABLE_IF(true);
}
}
template <typename TagType>
size_t TagNode<TagType>::getSinglePacketSize() const {
if constexpr (TagType::getTagNodeType() == TagNodeType::TimestampPacket) {