Move stamps allocators from memory manager to CSR.

Change-Id: Ib399e462cdddad89fcc470df4c4f0f5e4591a6b2
This commit is contained in:
Piotr Fusik
2018-11-27 13:07:41 +01:00
committed by sys_ocldev
parent 2d77b86e70
commit 87bb6afa56
20 changed files with 159 additions and 228 deletions

View File

@@ -64,7 +64,7 @@ Event::Event(
if ((this->ctx == nullptr) && (cmdQueue != nullptr)) {
this->ctx = &cmdQueue->getContext();
if (cmdQueue->getCommandStreamReceiver().peekTimestampPacketWriteEnabled()) {
timestampPacketContainer = std::make_unique<TimestampPacketContainer>(cmdQueue->getDevice().getMemoryManager());
timestampPacketContainer = std::make_unique<TimestampPacketContainer>();
}
}
@@ -124,12 +124,10 @@ Event::~Event() {
if (cmdQueue != nullptr) {
if (timeStampNode != nullptr) {
TagAllocator<HwTimeStamps> *allocator = cmdQueue->getDevice().getMemoryManager()->peekEventTsAllocator();
allocator->returnTag(timeStampNode);
timeStampNode->returnTag();
}
if (perfCounterNode != nullptr) {
TagAllocator<HwPerfCounter> *allocator = cmdQueue->getDevice().getMemoryManager()->peekEventPerfCountAllocator();
allocator->returnTag(perfCounterNode);
perfCounterNode->returnTag();
}
cmdQueue->decRefInternal();
}
@@ -669,20 +667,14 @@ void Event::setEndTimeStamp() {
TagNode<HwTimeStamps> *Event::getHwTimeStampNode() {
if (!timeStampNode) {
auto &device = getCommandQueue()->getDevice();
auto preferredPoolSize = cmdQueue->getCommandStreamReceiver().getPreferredTagPoolSize();
timeStampNode = device.getMemoryManager()->obtainEventTsAllocator(preferredPoolSize)->getTag();
timeStampNode = cmdQueue->getCommandStreamReceiver().getEventTsAllocator()->getTag();
}
return timeStampNode;
}
TagNode<HwPerfCounter> *Event::getHwPerfCounterNode() {
if (!perfCounterNode) {
auto &device = getCommandQueue()->getDevice();
auto preferredPoolSize = cmdQueue->getCommandStreamReceiver().getPreferredTagPoolSize();
perfCounterNode = device.getMemoryManager()->obtainEventPerfCountAllocator(preferredPoolSize)->getTag();
perfCounterNode = cmdQueue->getCommandStreamReceiver().getEventPerfCountAllocator()->getTag();
}
return perfCounterNode;
}
@@ -692,7 +684,7 @@ void Event::copyPerfCounters(InstrPmRegsCfg *config) {
memcpy_s(perfConfigurationData, sizeof(InstrPmRegsCfg), config, sizeof(InstrPmRegsCfg));
}
void Event::addTimestampPacketNodes(TimestampPacketContainer &inputTimestampPacketContainer) {
void Event::addTimestampPacketNodes(const TimestampPacketContainer &inputTimestampPacketContainer) {
timestampPacketContainer->assignAndIncrementNodesRefCounts(inputTimestampPacketContainer);
}

View File

@@ -95,7 +95,7 @@ class Event : public BaseObject<_cl_event>, public IDNode<Event> {
cl_ulong endTime);
bool calcProfilingData();
void setCPUProfilingPath(bool isCPUPath) { this->profilingCpuPath = isCPUPath; }
bool isCPUProfilingPath() {
bool isCPUProfilingPath() const {
return profilingCpuPath;
}
@@ -104,16 +104,16 @@ class Event : public BaseObject<_cl_event>, public IDNode<Event> {
void *paramValue,
size_t *paramValueSizeRet);
bool isProfilingEnabled() { return profilingEnabled; }
bool isProfilingEnabled() const { return profilingEnabled; }
void setProfilingEnabled(bool profilingEnabled) { this->profilingEnabled = profilingEnabled; }
TagNode<HwTimeStamps> *getHwTimeStampNode();
void addTimestampPacketNodes(TimestampPacketContainer &inputTimestampPacketContainer);
void addTimestampPacketNodes(const TimestampPacketContainer &inputTimestampPacketContainer);
TimestampPacketContainer *getTimestampPacketNodes() const;
bool isPerfCountersEnabled() {
bool isPerfCountersEnabled() const {
return perfCountersEnabled;
}