mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-01 04:23:00 +08:00
Cleanup includes 37
Cleaned up files: level_zero/core/source/event/event.h Related-To: NEO-5548 Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
4d359b5eef
commit
286c672ef4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "shared/source/command_stream/linear_stream.h"
|
||||
#include "shared/source/device/device.h"
|
||||
#include "shared/source/helpers/engine_node_helper.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/helpers/logical_state_helper.h"
|
||||
#include "shared/source/indirect_heap/indirect_heap.h"
|
||||
#include "shared/source/os_interface/sys_calls_common.h"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "shared/source/command_stream/command_stream_receiver.h"
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
#include "shared/source/helpers/basic_math.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/memory_manager/allocation_properties.h"
|
||||
#include "shared/source/memory_manager/memory_operations_handler.h"
|
||||
#include "shared/source/memory_manager/unified_memory_manager.h"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
#include "shared/source/helpers/aligned_memory.h"
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/helpers/string.h"
|
||||
#include "shared/source/memory_manager/allocation_properties.h"
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
@@ -239,6 +240,15 @@ void Event::setGpuEndTimestamp() {
|
||||
}
|
||||
}
|
||||
|
||||
void *Event::getCompletionFieldHostAddress() const {
|
||||
return ptrOffset(getHostAddress(), getCompletionFieldOffset());
|
||||
}
|
||||
|
||||
void Event::increaseKernelCount() {
|
||||
kernelCount++;
|
||||
UNRECOVERABLE_IF(kernelCount > maxKernelCount);
|
||||
}
|
||||
|
||||
void Event::resetPackets(bool resetAllPackets) {
|
||||
if (resetAllPackets) {
|
||||
resetKernelCountAndPacketUsedCount();
|
||||
|
||||
@@ -6,20 +6,28 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/helpers/timestamp_packet.h"
|
||||
#include "shared/source/helpers/timestamp_packet_size_control.h"
|
||||
#include "shared/source/memory_manager/multi_graphics_allocation.h"
|
||||
|
||||
#include <level_zero/ze_api.h>
|
||||
|
||||
#include <atomic>
|
||||
#include <bitset>
|
||||
#include <chrono>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
struct _ze_event_handle_t {};
|
||||
|
||||
struct _ze_event_pool_handle_t {};
|
||||
|
||||
namespace NEO {
|
||||
class CommandStreamReceiver;
|
||||
class GraphicsAllocation;
|
||||
class MultiGraphicsAllocation;
|
||||
struct RootDeviceEnvironment;
|
||||
}
|
||||
} // namespace NEO
|
||||
|
||||
namespace L0 {
|
||||
typedef uint64_t FlushStamp;
|
||||
@@ -91,9 +99,7 @@ struct Event : _ze_event_handle_t {
|
||||
uint64_t getCompletionFieldGpuAddress(Device *device) const {
|
||||
return this->getGpuAddress(device) + getCompletionFieldOffset();
|
||||
}
|
||||
void *getCompletionFieldHostAddress() const {
|
||||
return ptrOffset(getHostAddress(), getCompletionFieldOffset());
|
||||
}
|
||||
void *getCompletionFieldHostAddress() const;
|
||||
size_t getContextStartOffset() const {
|
||||
return contextStartOffset;
|
||||
}
|
||||
@@ -128,10 +134,7 @@ struct Event : _ze_event_handle_t {
|
||||
this->csr = csr;
|
||||
}
|
||||
|
||||
void increaseKernelCount() {
|
||||
kernelCount++;
|
||||
UNRECOVERABLE_IF(kernelCount > maxKernelCount);
|
||||
}
|
||||
void increaseKernelCount();
|
||||
uint32_t getKernelCount() const {
|
||||
return kernelCount;
|
||||
}
|
||||
@@ -222,63 +225,6 @@ struct Event : _ze_event_handle_t {
|
||||
bool isFromIpcPool = false;
|
||||
};
|
||||
|
||||
template <typename TagSizeT>
|
||||
class KernelEventCompletionData : public NEO::TimestampPackets<TagSizeT> {
|
||||
public:
|
||||
uint32_t getPacketsUsed() const { return packetsUsed; }
|
||||
void setPacketsUsed(uint32_t value) { packetsUsed = value; }
|
||||
|
||||
protected:
|
||||
uint32_t packetsUsed = 1;
|
||||
};
|
||||
|
||||
template <typename TagSizeT>
|
||||
struct EventImp : public Event {
|
||||
|
||||
EventImp(EventPool *eventPool, int index, Device *device, bool downloadAllocationRequired)
|
||||
: Event(eventPool, index, device), downloadAllocationRequired(downloadAllocationRequired) {
|
||||
contextStartOffset = NEO::TimestampPackets<TagSizeT>::getContextStartOffset();
|
||||
contextEndOffset = NEO::TimestampPackets<TagSizeT>::getContextEndOffset();
|
||||
globalStartOffset = NEO::TimestampPackets<TagSizeT>::getGlobalStartOffset();
|
||||
globalEndOffset = NEO::TimestampPackets<TagSizeT>::getGlobalEndOffset();
|
||||
timestampSizeInDw = (sizeof(TagSizeT) / sizeof(uint32_t));
|
||||
singlePacketSize = NEO::TimestampPackets<TagSizeT>::getSinglePacketSize();
|
||||
}
|
||||
|
||||
~EventImp() override {}
|
||||
|
||||
ze_result_t hostSignal() override;
|
||||
|
||||
ze_result_t hostSynchronize(uint64_t timeout) override;
|
||||
|
||||
ze_result_t queryStatus() override;
|
||||
|
||||
ze_result_t reset() override;
|
||||
|
||||
ze_result_t queryKernelTimestamp(ze_kernel_timestamp_result_t *dstptr) override;
|
||||
ze_result_t queryTimestampsExp(Device *device, uint32_t *count, ze_kernel_timestamp_result_t *timestamps) override;
|
||||
|
||||
void resetDeviceCompletionData(bool resetAllPackets);
|
||||
void resetKernelCountAndPacketUsedCount() override;
|
||||
|
||||
uint64_t getPacketAddress(Device *device) override;
|
||||
uint32_t getPacketsInUse() const override;
|
||||
uint32_t getPacketsUsedInLastKernel() override;
|
||||
void setPacketsInUse(uint32_t value) override;
|
||||
|
||||
std::unique_ptr<KernelEventCompletionData<TagSizeT>[]> kernelEventCompletionData;
|
||||
|
||||
const bool downloadAllocationRequired = false;
|
||||
|
||||
protected:
|
||||
ze_result_t calculateProfilingData();
|
||||
ze_result_t queryStatusEventPackets();
|
||||
MOCKABLE_VIRTUAL ze_result_t hostEventSetValue(TagSizeT eventValue);
|
||||
ze_result_t hostEventSetValueTimestamps(TagSizeT eventVal);
|
||||
MOCKABLE_VIRTUAL void assignKernelEventCompletionData(void *address);
|
||||
void setRemainingPackets(TagSizeT eventVal, void *nextPacketAddress, uint32_t packetsAlreadySet);
|
||||
};
|
||||
|
||||
struct EventPool : _ze_event_pool_handle_t {
|
||||
static EventPool *create(DriverHandle *driver, Context *context, uint32_t numDevices, ze_device_handle_t *deviceHandles, const ze_event_pool_desc_t *desc, ze_result_t &result);
|
||||
EventPool(const ze_event_pool_desc_t *desc) : EventPool(desc->count) {
|
||||
|
||||
72
level_zero/core/source/event/event_imp.h
Normal file
72
level_zero/core/source/event/event_imp.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/helpers/timestamp_packet.h"
|
||||
|
||||
#include "level_zero/core/source/event/event.h"
|
||||
|
||||
namespace L0 {
|
||||
|
||||
template <typename TagSizeT>
|
||||
class KernelEventCompletionData : public NEO::TimestampPackets<TagSizeT> {
|
||||
public:
|
||||
uint32_t getPacketsUsed() const { return packetsUsed; }
|
||||
void setPacketsUsed(uint32_t value) { packetsUsed = value; }
|
||||
|
||||
protected:
|
||||
uint32_t packetsUsed = 1;
|
||||
};
|
||||
|
||||
template <typename TagSizeT>
|
||||
struct EventImp : public Event {
|
||||
|
||||
EventImp(EventPool *eventPool, int index, Device *device, bool downloadAllocationRequired)
|
||||
: Event(eventPool, index, device), downloadAllocationRequired(downloadAllocationRequired) {
|
||||
contextStartOffset = NEO::TimestampPackets<TagSizeT>::getContextStartOffset();
|
||||
contextEndOffset = NEO::TimestampPackets<TagSizeT>::getContextEndOffset();
|
||||
globalStartOffset = NEO::TimestampPackets<TagSizeT>::getGlobalStartOffset();
|
||||
globalEndOffset = NEO::TimestampPackets<TagSizeT>::getGlobalEndOffset();
|
||||
timestampSizeInDw = (sizeof(TagSizeT) / sizeof(uint32_t));
|
||||
singlePacketSize = NEO::TimestampPackets<TagSizeT>::getSinglePacketSize();
|
||||
}
|
||||
|
||||
~EventImp() override {}
|
||||
|
||||
ze_result_t hostSignal() override;
|
||||
|
||||
ze_result_t hostSynchronize(uint64_t timeout) override;
|
||||
|
||||
ze_result_t queryStatus() override;
|
||||
|
||||
ze_result_t reset() override;
|
||||
|
||||
ze_result_t queryKernelTimestamp(ze_kernel_timestamp_result_t *dstptr) override;
|
||||
ze_result_t queryTimestampsExp(Device *device, uint32_t *count, ze_kernel_timestamp_result_t *timestamps) override;
|
||||
|
||||
void resetDeviceCompletionData(bool resetAllPackets);
|
||||
void resetKernelCountAndPacketUsedCount() override;
|
||||
|
||||
uint64_t getPacketAddress(Device *device) override;
|
||||
uint32_t getPacketsInUse() const override;
|
||||
uint32_t getPacketsUsedInLastKernel() override;
|
||||
void setPacketsInUse(uint32_t value) override;
|
||||
|
||||
std::unique_ptr<KernelEventCompletionData<TagSizeT>[]> kernelEventCompletionData;
|
||||
|
||||
const bool downloadAllocationRequired = false;
|
||||
|
||||
protected:
|
||||
ze_result_t calculateProfilingData();
|
||||
ze_result_t queryStatusEventPackets();
|
||||
MOCKABLE_VIRTUAL ze_result_t hostEventSetValue(TagSizeT eventValue);
|
||||
ze_result_t hostEventSetValueTimestamps(TagSizeT eventVal);
|
||||
MOCKABLE_VIRTUAL void assignKernelEventCompletionData(void *address);
|
||||
void setRemainingPackets(TagSizeT eventVal, void *nextPacketAddress, uint32_t packetsAlreadySet);
|
||||
};
|
||||
|
||||
} // namespace L0
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "shared/source/memory_manager/memory_operations_handler.h"
|
||||
#include "shared/source/os_interface/os_time.h"
|
||||
|
||||
#include "level_zero/core/source/event/event.h"
|
||||
#include "level_zero/core/source/event/event_imp.h"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper.h"
|
||||
|
||||
namespace L0 {
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/string.h"
|
||||
|
||||
#include "level_zero/core/source/device/device.h"
|
||||
#include "level_zero/core/source/device/device_imp.h"
|
||||
#include "level_zero/core/source/fabric/fabric.h"
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "shared/source/helpers/aligned_memory.h"
|
||||
#include "shared/source/helpers/definitions/engine_group_types.h"
|
||||
#include "shared/source/helpers/engine_node_helper.h"
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper.h"
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/helpers/aligned_memory.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
|
||||
#include "level_zero/core/source/device/device.h"
|
||||
#include "level_zero/core/source/event/event.h"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/aligned_memory.h"
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper.h"
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "shared/source/helpers/basic_math.h"
|
||||
#include "shared/source/helpers/bindless_heaps_helper.h"
|
||||
#include "shared/source/helpers/blit_commands_helper.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
#include "shared/source/helpers/kernel_helpers.h"
|
||||
#include "shared/source/helpers/local_work_size.h"
|
||||
|
||||
Reference in New Issue
Block a user