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

@@ -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) {