L0::Event to support dynamic size - part 3

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2021-05-19 15:36:43 +00:00
committed by Compute-Runtime-Automation
parent 1c9bd5f114
commit 1bca3b2ab5
11 changed files with 339 additions and 195 deletions

View File

@@ -18,10 +18,16 @@ enum class ImageType;
}
namespace L0 {
#pragma pack(1)
struct EventData {
uint64_t address;
uint64_t packetsInUse;
uint64_t timestampSizeInDw;
};
#pragma pack()
static_assert(sizeof(EventData) == (3 * sizeof(uint64_t)),
"This structure is consumed by GPU and has to follow specific restrictions for padding and size");
struct AlignedAllocationData {
uintptr_t alignedAllocationPtr = 0u;

View File

@@ -1728,6 +1728,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendQueryKernelTimestamps(
commandContainer.addToResidencyContainer(&event->getAllocation(this->device));
timestampsData[i].address = event->getGpuAddress(this->device);
timestampsData[i].packetsInUse = event->getPacketsInUse();
timestampsData[i].timestampSizeInDw = event->getTimestampSizeInDw();
}
size_t alignedSize = alignUp<size_t>(sizeof(EventData) * numEvents, MemoryConstants::pageSize64k);

View File

@@ -58,6 +58,7 @@ struct Event : _ze_event_handle_t {
void *getHostAddress() { return hostAddress; }
virtual void setPacketsInUse(uint32_t value) = 0;
uint32_t getCurrKernelDataIndex() const { return kernelCount - 1; }
virtual size_t getTimestampSizeInDw() const = 0;
void *hostAddress = nullptr;
uint32_t kernelCount = 1u;
ze_event_scope_flags_t signalScope = 0u;
@@ -104,6 +105,7 @@ struct EventImp : public Event {
uint64_t getPacketAddress(Device *device) override;
uint32_t getPacketsInUse() override;
void setPacketsInUse(uint32_t value) override;
size_t getTimestampSizeInDw() const override { return (sizeof(TagSizeT) / 4); };
std::unique_ptr<NEO::TimestampPackets<TagSizeT>[]> kernelTimestampsData;