Reinitialize new tag taken from TagAllocator

Change-Id: I1fbc06224e64b77de0f481553eddc4abde8f8a1c
This commit is contained in:
Dunajski, Bartosz
2018-08-30 13:37:39 +02:00
committed by sys_ocldev
parent 0abbd881d4
commit ed26e38f38
7 changed files with 57 additions and 14 deletions

View File

@@ -674,12 +674,6 @@ HwTimeStamps *Event::getHwTimeStamp() {
if (!timeStampNode) {
TagAllocator<HwTimeStamps> *allocator = getCommandQueue()->getDevice().getMemoryManager()->getEventTsAllocator();
timeStampNode = allocator->getTag();
timeStampNode->tag->GlobalStartTS = 0;
timeStampNode->tag->ContextStartTS = 0;
timeStampNode->tag->GlobalEndTS = 0;
timeStampNode->tag->ContextEndTS = 0;
timeStampNode->tag->GlobalCompleteTS = 0;
timeStampNode->tag->ContextCompleteTS = 0;
}
node = timeStampNode;
return node->tag;
@@ -701,7 +695,6 @@ HwPerfCounter *Event::getHwPerfCounter() {
if (!perfCounterNode) {
TagAllocator<HwPerfCounter> *allocator = getCommandQueue()->getDevice().getMemoryManager()->getEventPerfCountAllocator();
perfCounterNode = allocator->getTag();
memset(perfCounterNode->tag, 0, sizeof(HwPerfCounter));
}
node = perfCounterNode;
return node->tag;

View File

@@ -27,6 +27,14 @@
namespace OCLRT {
struct HwTimeStamps {
void initialize() {
GlobalStartTS = 0;
ContextStartTS = 0;
GlobalEndTS = 0;
ContextEndTS = 0;
GlobalCompleteTS = 0;
ContextCompleteTS = 0;
}
uint64_t GlobalStartTS;
uint64_t ContextStartTS;
uint64_t GlobalEndTS;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2017 - 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -28,6 +28,10 @@
namespace OCLRT {
struct HwPerfCounter {
void initialize() {
HWPerfCounters = {};
HWTimeStamp.initialize();
}
HwPerfCounters HWPerfCounters;
HwTimeStamps HWTimeStamp;
};

View File

@@ -53,6 +53,8 @@ class TimestampPacket {
uint32_t pickDataValue(DataIndex index) const { return data[static_cast<uint32_t>(index)]; }
void initialize() { data = {{1, 1, 1, 1}}; }
protected:
std::array<uint32_t, static_cast<uint32_t>(DataIndex::Max)> data = {{1, 1, 1, 1}};
};

View File

@@ -91,6 +91,7 @@ class TagAllocator {
}
usedTags.pushFrontOne(*node);
node->incRefCount();
node->tag->initialize();
return node;
}