mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Reinitialize new tag taken from TagAllocator
Change-Id: I1fbc06224e64b77de0f481553eddc4abde8f8a1c
This commit is contained in:
committed by
sys_ocldev
parent
0abbd881d4
commit
ed26e38f38
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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}};
|
||||
};
|
||||
|
||||
@@ -91,6 +91,7 @@ class TagAllocator {
|
||||
}
|
||||
usedTags.pushFrontOne(*node);
|
||||
node->incRefCount();
|
||||
node->tag->initialize();
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user