2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2023-04-26 18:13:07 +08:00
|
|
|
* Copyright (C) 2018-2023 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/memory_manager/graphics_allocation.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
#include <cinttypes>
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2021-03-25 02:21:13 +08:00
|
|
|
class HwTimeStamps : public TagTypeBase {
|
|
|
|
public:
|
2018-08-30 19:37:39 +08:00
|
|
|
void initialize() {
|
2023-04-26 18:13:07 +08:00
|
|
|
globalStartTS = 0;
|
|
|
|
contextStartTS = 0;
|
|
|
|
globalEndTS = 0;
|
|
|
|
contextEndTS = 0;
|
|
|
|
globalCompleteTS = 0;
|
|
|
|
contextCompleteTS = 0;
|
2018-08-30 19:37:39 +08:00
|
|
|
}
|
2020-04-23 16:38:14 +08:00
|
|
|
|
2022-02-04 21:59:01 +08:00
|
|
|
static constexpr AllocationType getAllocationType() {
|
2023-12-11 22:24:36 +08:00
|
|
|
return AllocationType::profilingTagBuffer;
|
2019-02-08 17:27:48 +08:00
|
|
|
}
|
2021-03-25 02:21:13 +08:00
|
|
|
|
2023-12-05 20:06:54 +08:00
|
|
|
static constexpr TagNodeType getTagNodeType() { return TagNodeType::hwTimeStamps; }
|
2021-03-25 02:21:13 +08:00
|
|
|
|
2023-04-26 18:13:07 +08:00
|
|
|
uint64_t getContextStartValue(uint32_t) const { return contextStartTS; }
|
|
|
|
uint64_t getGlobalStartValue(uint32_t) const { return globalStartTS; }
|
|
|
|
uint64_t getContextEndValue(uint32_t) const { return contextEndTS; }
|
|
|
|
uint64_t getGlobalEndValue(uint32_t) const { return globalEndTS; }
|
|
|
|
|
|
|
|
uint64_t globalStartTS;
|
|
|
|
uint64_t contextStartTS;
|
|
|
|
uint64_t globalEndTS;
|
|
|
|
uint64_t contextEndTS;
|
|
|
|
uint64_t globalCompleteTS;
|
|
|
|
uint64_t contextCompleteTS;
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
2021-03-25 02:21:13 +08:00
|
|
|
|
|
|
|
static_assert((6 * sizeof(uint64_t)) == sizeof(HwTimeStamps),
|
|
|
|
"This structure is consumed by GPU and has to follow specific restrictions for padding and size");
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|