From 46e67c892a70cd7e964e9e431b69b8edf3166ee0 Mon Sep 17 00:00:00 2001 From: Maciej Dziuban Date: Thu, 28 May 2020 12:26:18 +0200 Subject: [PATCH] Add overrideSupportedDevicesCount helper function Change-Id: I3ae4a7534322956eda894b097e8a74cb9fb050e3 Signed-off-by: Maciej Dziuban --- .../source/os_interface/linux/drm_command_stream.h | 2 +- shared/source/helpers/CMakeLists.txt | 1 + shared/source/helpers/timestamp_packet.h | 4 ++++ shared/source/helpers/timestamp_packet_extra.cpp | 13 +++++++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 shared/source/helpers/timestamp_packet_extra.cpp diff --git a/opencl/source/os_interface/linux/drm_command_stream.h b/opencl/source/os_interface/linux/drm_command_stream.h index 5c2f45e1ea..a5aa472389 100644 --- a/opencl/source/os_interface/linux/drm_command_stream.h +++ b/opencl/source/os_interface/linux/drm_command_stream.h @@ -53,7 +53,7 @@ class DrmCommandStreamReceiver : public DeviceCommandStreamReceiver { void makeResidentBufferObjects(const DrmAllocation *drmAllocation, uint32_t handleId); void makeResident(BufferObject *bo); void flushInternal(const BatchBuffer &batchBuffer, const ResidencyContainer &allocationsForResidency); - void exec(const BatchBuffer &batchBuffer, uint32_t drmContextId); + MOCKABLE_VIRTUAL void exec(const BatchBuffer &batchBuffer, uint32_t drmContextId); std::vector residency; std::vector execObjectsStorage; diff --git a/shared/source/helpers/CMakeLists.txt b/shared/source/helpers/CMakeLists.txt index 5ee6daf249..adb42dc30a 100644 --- a/shared/source/helpers/CMakeLists.txt +++ b/shared/source/helpers/CMakeLists.txt @@ -81,6 +81,7 @@ set(NEO_CORE_HELPERS ${CMAKE_CURRENT_SOURCE_DIR}/surface_format_info.h ${CMAKE_CURRENT_SOURCE_DIR}/timestamp_packet.cpp ${CMAKE_CURRENT_SOURCE_DIR}/timestamp_packet.h + ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/timestamp_packet_extra.cpp ${CMAKE_CURRENT_SOURCE_DIR}/vec.h ${CMAKE_CURRENT_SOURCE_DIR}/definitions/pipe_control_args_base.h ${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}/pipe_control_args.h diff --git a/shared/source/helpers/timestamp_packet.h b/shared/source/helpers/timestamp_packet.h index 65db946648..a6332b72d8 100644 --- a/shared/source/helpers/timestamp_packet.h +++ b/shared/source/helpers/timestamp_packet.h @@ -118,6 +118,8 @@ struct TimestampPacketHelper { return timestampPacketNode.getGpuAddress() + offsetof(TimestampPacketStorage, implicitGpuDependenciesCount); } + static void overrideSupportedDevicesCount(uint32_t &numSupportedDevices); + template static void programSemaphoreWithImplicitDependency(LinearStream &cmdStream, TagNode ×tampPacketNode, uint32_t numSupportedDevices) { using MI_ATOMIC = typename GfxFamily::MI_ATOMIC; @@ -139,6 +141,8 @@ struct TimestampPacketHelper { } if (trackPostSyncDependencies) { + overrideSupportedDevicesCount(numSupportedDevices); + for (uint32_t i = 0; i < numSupportedDevices; i++) { timestampPacketNode.incImplicitCpuDependenciesCount(); } diff --git a/shared/source/helpers/timestamp_packet_extra.cpp b/shared/source/helpers/timestamp_packet_extra.cpp new file mode 100644 index 0000000000..e239371ad2 --- /dev/null +++ b/shared/source/helpers/timestamp_packet_extra.cpp @@ -0,0 +1,13 @@ +/* + * Copyright (C) 2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/helpers/timestamp_packet.h" + +namespace NEO { +void TimestampPacketHelper::overrideSupportedDevicesCount(uint32_t &numSupportedDevices) { +} +} // namespace NEO