diff --git a/level_zero/CMakeLists.txt b/level_zero/CMakeLists.txt index e3661fbc95..bc0c5ccac1 100644 --- a/level_zero/CMakeLists.txt +++ b/level_zero/CMakeLists.txt @@ -209,6 +209,7 @@ if(BUILD_WITH_L0) SHARED ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${NEO_SHARED_DIRECTORY}/dll/create_command_stream.cpp + ${NEO_SHARED_DIRECTORY}/dll/device_dll.cpp ${NEO_SHARED_DIRECTORY}/dll/direct_submission_controller_enabled.cpp ${NEO_SHARED_DIRECTORY}/dll/options_dll.cpp ${NEO_SHARED_DIRECTORY}/gmm_helper/page_table_mngr.cpp diff --git a/opencl/source/dll/CMakeLists.txt b/opencl/source/dll/CMakeLists.txt index d8180f9aa5..4671678899 100644 --- a/opencl/source/dll/CMakeLists.txt +++ b/opencl/source/dll/CMakeLists.txt @@ -16,6 +16,7 @@ set(RUNTIME_SRCS_DLL_BASE ${NEO_SHARED_DIRECTORY}/dll/create_deferred_deleter.cpp ${NEO_SHARED_DIRECTORY}/dll/create_memory_manager_${DRIVER_MODEL}.cpp ${NEO_SHARED_DIRECTORY}/dll/create_tbx_sockets.cpp + ${NEO_SHARED_DIRECTORY}/dll/device_dll.cpp ${NEO_SHARED_DIRECTORY}/dll/direct_submission_controller_enabled.cpp ${NEO_SHARED_DIRECTORY}/dll/source_level_debugger_dll.cpp ${NEO_SHARED_DIRECTORY}/dll/get_devices.cpp diff --git a/opencl/test/unit_test/command_queue/command_queue_hw_2_tests.cpp b/opencl/test/unit_test/command_queue/command_queue_hw_2_tests.cpp index edb15829f1..200e507384 100644 --- a/opencl/test/unit_test/command_queue/command_queue_hw_2_tests.cpp +++ b/opencl/test/unit_test/command_queue/command_queue_hw_2_tests.cpp @@ -307,6 +307,8 @@ HWTEST_F(IoqCommandQueueHwBlitTest, givenSplitBcsCopyWhenCheckIsSplitEnqueueBlit DebugManagerStateRestore restorer; DebugManager.flags.SplitBcsCopy.set(1); auto *cmdQHw = static_cast *>(this->pCmdQ); + VariableBackup backup{&ultHwConfig}; + ultHwConfig.useBlitSplit = true; { EXPECT_FALSE(cmdQHw->isSplitEnqueueBlitNeeded(TransferDirection::HostToHost, 64 * MemoryConstants::megaByte, *cmdQHw->getBcsCommandStreamReceiver(aub_stream::EngineType::ENGINE_BCS))); EXPECT_FALSE(cmdQHw->isSplitEnqueueBlitNeeded(TransferDirection::LocalToLocal, 64 * MemoryConstants::megaByte, *cmdQHw->getBcsCommandStreamReceiver(aub_stream::EngineType::ENGINE_BCS))); @@ -332,6 +334,14 @@ HWTEST_F(IoqCommandQueueHwBlitTest, givenSplitBcsCopyWhenCheckIsSplitEnqueueBlit EXPECT_FALSE(cmdQHw->isSplitEnqueueBlitNeeded(TransferDirection::LocalToHost, 64 * MemoryConstants::megaByte, *cmdQHw->getBcsCommandStreamReceiver(aub_stream::EngineType::ENGINE_BCS))); EXPECT_FALSE(cmdQHw->isSplitEnqueueBlitNeeded(TransferDirection::HostToLocal, 64 * MemoryConstants::megaByte, *cmdQHw->getBcsCommandStreamReceiver(aub_stream::EngineType::ENGINE_BCS))); } + { + DebugManager.flags.SplitBcsCopy.set(-1); + ultHwConfig.useBlitSplit = false; + EXPECT_FALSE(cmdQHw->isSplitEnqueueBlitNeeded(TransferDirection::HostToHost, 64 * MemoryConstants::megaByte, *cmdQHw->getBcsCommandStreamReceiver(aub_stream::EngineType::ENGINE_BCS))); + EXPECT_FALSE(cmdQHw->isSplitEnqueueBlitNeeded(TransferDirection::LocalToLocal, 64 * MemoryConstants::megaByte, *cmdQHw->getBcsCommandStreamReceiver(aub_stream::EngineType::ENGINE_BCS))); + EXPECT_FALSE(cmdQHw->isSplitEnqueueBlitNeeded(TransferDirection::LocalToHost, 64 * MemoryConstants::megaByte, *cmdQHw->getBcsCommandStreamReceiver(aub_stream::EngineType::ENGINE_BCS))); + EXPECT_FALSE(cmdQHw->isSplitEnqueueBlitNeeded(TransferDirection::HostToLocal, 64 * MemoryConstants::megaByte, *cmdQHw->getBcsCommandStreamReceiver(aub_stream::EngineType::ENGINE_BCS))); + } } char hostPtr[16 * MemoryConstants::megaByte]; diff --git a/opencl/test/unit_test/linux/CMakeLists.txt b/opencl/test/unit_test/linux/CMakeLists.txt index 72c1e7ff21..0ff2049574 100644 --- a/opencl/test/unit_test/linux/CMakeLists.txt +++ b/opencl/test/unit_test/linux/CMakeLists.txt @@ -23,6 +23,7 @@ add_executable(igdrcl_${target_name} ${CMAKE_CURRENT_SOURCE_DIR}/os_interface_linux_tests.cpp ${NEO_SHARED_DIRECTORY}/os_interface/linux/sys_calls_linux.cpp ${NEO_SHARED_DIRECTORY}/dll/create_memory_manager_drm.cpp + ${NEO_SHARED_DIRECTORY}/dll/device_dll.cpp ${NEO_SHARED_DIRECTORY}/dll/direct_submission_controller_enabled.cpp ${NEO_SHARED_DIRECTORY}/dll/linux/drm_neo_create.cpp ${NEO_SHARED_DIRECTORY}/dll/linux/options_linux.cpp diff --git a/opencl/test/unit_test/linux/main_linux_dll.cpp b/opencl/test/unit_test/linux/main_linux_dll.cpp index fb5c3fab67..0af88773eb 100644 --- a/opencl/test/unit_test/linux/main_linux_dll.cpp +++ b/opencl/test/unit_test/linux/main_linux_dll.cpp @@ -895,6 +895,10 @@ TEST(CommandQueueTest, whenCheckEngineTimestampWaitEnabledThenReturnsTrue) { EXPECT_TRUE(CommandQueue::isTimestampWaitEnabled()); } +TEST(DeviceTest, whenCheckBlitSplitEnabledThenReturnsTrue) { + EXPECT_TRUE(Device::isBlitSplitEnabled()); +} + TEST(PlatformsDestructor, whenGlobalPlatformsDestructorIsCalledThenGlobalPlatformsAreDestroyed) { EXPECT_NE(nullptr, platformsImpl); platformsDestructor(); diff --git a/opencl/test/unit_test/windows/CMakeLists.txt b/opencl/test/unit_test/windows/CMakeLists.txt index f9e4688538..a346f94a8c 100644 --- a/opencl/test/unit_test/windows/CMakeLists.txt +++ b/opencl/test/unit_test/windows/CMakeLists.txt @@ -21,6 +21,7 @@ if(WIN32) ${CMAKE_CURRENT_SOURCE_DIR}/os_interface_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/wddm_create_tests.cpp ${NEO_IGDRCL_WINDOWS_DLL_TESTS_TARGET_OBJECTS} + ${NEO_SHARED_DIRECTORY}/dll/device_dll.cpp ${NEO_SHARED_DIRECTORY}/dll/direct_submission_controller_enabled.cpp ${NEO_SHARED_DIRECTORY}/dll/get_devices.cpp ${NEO_SHARED_DIRECTORY}/dll/windows/os_interface.cpp diff --git a/shared/source/device/device.cpp b/shared/source/device/device.cpp index d32e1c8ecd..11761c5c21 100644 --- a/shared/source/device/device.cpp +++ b/shared/source/device/device.cpp @@ -397,7 +397,8 @@ uint64_t Device::getProfilingTimerClock() { bool Device::isBcsSplitSupported() { auto bcsSplit = HwInfoConfig::get(getHardwareInfo().platform.eProductFamily)->isBlitSplitEnqueueWARequired(getHardwareInfo()) && - ApiSpecificConfig::isBcsSplitWaSupported(); + ApiSpecificConfig::isBcsSplitWaSupported() && + Device::isBlitSplitEnabled(); if (DebugManager.flags.SplitBcsCopy.get() != -1) { bcsSplit = DebugManager.flags.SplitBcsCopy.get(); diff --git a/shared/source/device/device.h b/shared/source/device/device.h index d39204e46e..f7d2b70f1f 100644 --- a/shared/source/device/device.h +++ b/shared/source/device/device.h @@ -106,6 +106,7 @@ class Device : public ReferenceTrackedObject { bool isFullRangeSvm() const { return getRootDeviceEnvironment().isFullRangeSvm(); } + static bool isBlitSplitEnabled(); bool isBcsSplitSupported(); bool areSharedSystemAllocationsAllowed() const; template diff --git a/shared/source/dll/device_dll.cpp b/shared/source/dll/device_dll.cpp new file mode 100644 index 0000000000..63559a8656 --- /dev/null +++ b/shared/source/dll/device_dll.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/device/device.h" + +namespace NEO { + +bool Device::isBlitSplitEnabled() { + return true; +} + +} // namespace NEO diff --git a/shared/source/os_interface/device_factory.cpp b/shared/source/os_interface/device_factory.cpp index db7b8e4c54..519ccedcf9 100644 --- a/shared/source/os_interface/device_factory.cpp +++ b/shared/source/os_interface/device_factory.cpp @@ -9,7 +9,6 @@ #include "shared/source/aub/aub_center.h" #include "shared/source/debug_settings/debug_settings_manager.h" -#include "shared/source/device/device.h" #include "shared/source/device/root_device.h" #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/helpers/compiler_hw_info_config.h" diff --git a/shared/source/xe_hpc_core/pvc/os_agnostic_hw_info_config_pvc.inl b/shared/source/xe_hpc_core/pvc/os_agnostic_hw_info_config_pvc.inl index bc4ca63eac..abacedff06 100644 --- a/shared/source/xe_hpc_core/pvc/os_agnostic_hw_info_config_pvc.inl +++ b/shared/source/xe_hpc_core/pvc/os_agnostic_hw_info_config_pvc.inl @@ -165,6 +165,11 @@ bool HwInfoConfigHw::isBlitCopyRequiredForLocalMemory(const Hardware return false; } +template <> +bool HwInfoConfigHw::isBlitSplitEnqueueWARequired(const HardwareInfo &hwInfo) const { + return true; +} + template <> bool HwInfoConfigHw::isImplicitScalingSupported(const HardwareInfo &hwInfo) const { return getSteppingFromHwRevId(hwInfo) >= REVISION_B; diff --git a/shared/test/common/base_ult_config_listener.cpp b/shared/test/common/base_ult_config_listener.cpp index ebcb1a1be7..1bce974bb1 100644 --- a/shared/test/common/base_ult_config_listener.cpp +++ b/shared/test/common/base_ult_config_listener.cpp @@ -36,7 +36,7 @@ void NEO::BaseUltConfigListener::OnTestEnd(const ::testing::TestInfo &) { // Ensure that global state is restored UltHwConfig expectedState{}; - static_assert(sizeof(UltHwConfig) == 12 * sizeof(bool), ""); // Ensure that there is no internal padding + static_assert(sizeof(UltHwConfig) == 13 * sizeof(bool), ""); // Ensure that there is no internal padding EXPECT_EQ(0, memcmp(&expectedState, &ultHwConfig, sizeof(UltHwConfig))); EXPECT_EQ(0, memcmp(&referencedHwInfo.platform, &defaultHwInfo->platform, sizeof(PLATFORM))); diff --git a/shared/test/common/helpers/ult_hw_config.h b/shared/test/common/helpers/ult_hw_config.h index d58705fd16..cc69980ab4 100644 --- a/shared/test/common/helpers/ult_hw_config.h +++ b/shared/test/common/helpers/ult_hw_config.h @@ -13,6 +13,7 @@ struct UltHwConfig { bool useMockedPrepareDeviceEnvironmentsFunc = true; bool forceOsAgnosticMemoryManager = true; bool useWaitForTimestamps = false; + bool useBlitSplit = false; bool csrFailInitDirectSubmission = false; bool csrBaseCallDirectSubmissionAvailable = false; diff --git a/shared/test/common/libult/CMakeLists.txt b/shared/test/common/libult/CMakeLists.txt index 56b2bb9fa7..56c3786afb 100644 --- a/shared/test/common/libult/CMakeLists.txt +++ b/shared/test/common/libult/CMakeLists.txt @@ -175,6 +175,7 @@ set(neo_libult_SRCS_LINUX ${NEO_SHARED_TEST_DIRECTORY}/common/libult/os_interface.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/linux/mock_drm_memory_manager.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/linux/mock_drm_memory_manager.h + ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/device_ult.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_direct_submission_controller_enabled.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/linux/create_drm_memory_manager.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/linux/drm_memory_manager_fixture.cpp @@ -186,6 +187,7 @@ set(neo_libult_SRCS_LINUX set_property(GLOBAL APPEND PROPERTY neo_libult_SRCS_LINUX ${neo_libult_SRCS_LINUX}) set(neo_libult_SRCS_WINDOWS ${NEO_SHARED_TEST_DIRECTORY}/common/libult/os_interface.cpp + ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/device_ult.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_direct_submission_controller_enabled.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_wddm.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/windows/create_wddm_memory_manager.cpp diff --git a/shared/test/common/mocks/device_ult.cpp b/shared/test/common/mocks/device_ult.cpp new file mode 100644 index 0000000000..a3d5f5d52f --- /dev/null +++ b/shared/test/common/mocks/device_ult.cpp @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/device/device.h" +#include "shared/test/common/helpers/ult_hw_config.h" + +namespace NEO { + +bool Device::isBlitSplitEnabled() { + return ultHwConfig.useBlitSplit; +} + +} // namespace NEO diff --git a/shared/test/unit_test/xe_hpc_core/pvc/CMakeLists.txt b/shared/test/unit_test/xe_hpc_core/pvc/CMakeLists.txt index 13caa60af1..9712af2065 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/CMakeLists.txt +++ b/shared/test/unit_test/xe_hpc_core/pvc/CMakeLists.txt @@ -10,6 +10,7 @@ if(TESTS_PVC) ${CMAKE_CURRENT_SOURCE_DIR}/device_binary_format_ar_tests_pvc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/device_tests_pvc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/dispatch_walker_tests_pvc.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/excludes_xe_hpc_core_pvc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/hw_info_tests_pvc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/product_config_helper_tests_pvc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/product_config_tests_pvc.cpp diff --git a/shared/test/unit_test/xe_hpc_core/pvc/excludes_xe_hpc_core_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/excludes_xe_hpc_core_pvc.cpp new file mode 100644 index 0000000000..16da2942fe --- /dev/null +++ b/shared/test/unit_test/xe_hpc_core/pvc/excludes_xe_hpc_core_pvc.cpp @@ -0,0 +1,10 @@ +/* + * Copyright (C) 2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/test/common/test_macros/hw_test_base.h" + +HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfIsBlitSplitEnqueueWARequiredThenReturnFalse, IGFX_PVC); diff --git a/shared/test/unit_test/xe_hpc_core/pvc/linux/hw_info_config_tests_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/linux/hw_info_config_tests_pvc.cpp index c9b8f865a1..c9b364bb7f 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/linux/hw_info_config_tests_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/linux/hw_info_config_tests_pvc.cpp @@ -83,6 +83,11 @@ PVCTEST_F(HwInfoConfigTestLinuxPvc, givenOsInterfaceIsNullWhenGetDeviceMemoryPhy EXPECT_EQ(0u, hwInfoConfig->getDeviceMemoryPhysicalSizeInBytes(nullptr, 0)); } +PVCTEST_F(HwInfoConfigTestLinuxPvc, givenHwInfoConfigWhenAskedIsBlitSplitEnqueueWARequiredThenReturnTrue) { + auto hwInfoConfig = HwInfoConfig::get(productFamily); + EXPECT_TRUE(hwInfoConfig->isBlitSplitEnqueueWARequired(pInHwInfo)); +} + PVCTEST_F(HwInfoConfigTestLinuxPvc, givenOsInterfaceIsNullWhenGetDeviceMemoryMaxBandWidthInBytesPerSecondIsCalledThenReturnZero) { auto hwInfoConfig = HwInfoConfig::get(productFamily); auto testHwInfo = *defaultHwInfo;