1 /*
2  * Copyright (C) 2018-2021 Intel Corporation
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  */
7 
8 #pragma once
9 #include "shared/source/memory_manager/graphics_allocation.h"
10 
11 #include <cinttypes>
12 
13 namespace NEO {
14 
15 class HwTimeStamps : public TagTypeBase {
16   public:
initialize()17     void initialize() {
18         GlobalStartTS = 0;
19         ContextStartTS = 0;
20         GlobalEndTS = 0;
21         ContextEndTS = 0;
22         GlobalCompleteTS = 0;
23         ContextCompleteTS = 0;
24     }
25 
getAllocationType()26     static constexpr GraphicsAllocation::AllocationType getAllocationType() {
27         return GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER;
28     }
29 
getTagNodeType()30     static constexpr TagNodeType getTagNodeType() { return TagNodeType::HwTimeStamps; }
31 
getContextStartValue(uint32_t)32     uint64_t getContextStartValue(uint32_t) const { return ContextStartTS; }
getGlobalStartValue(uint32_t)33     uint64_t getGlobalStartValue(uint32_t) const { return GlobalStartTS; }
getContextEndValue(uint32_t)34     uint64_t getContextEndValue(uint32_t) const { return ContextEndTS; }
getGlobalEndValue(uint32_t)35     uint64_t getGlobalEndValue(uint32_t) const { return GlobalEndTS; }
36 
37     uint64_t GlobalStartTS;
38     uint64_t ContextStartTS;
39     uint64_t GlobalEndTS;
40     uint64_t ContextEndTS;
41     uint64_t GlobalCompleteTS;
42     uint64_t ContextCompleteTS;
43 };
44 
45 static_assert((6 * sizeof(uint64_t)) == sizeof(HwTimeStamps),
46               "This structure is consumed by GPU and has to follow specific restrictions for padding and size");
47 } // namespace NEO
48