From 0cde8eb7ffa675a750a70c0f6dcd12cd94c1545c Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Mon, 25 Oct 2021 16:22:35 +0000 Subject: [PATCH] Change default revision for xe_hp_sdv Signed-off-by: Mateusz Jablonski --- cmake/setup_platform_flags.cmake | 2 +- manifests/manifest.yml | 2 +- .../context/driver_diagnostics_tests.cpp | 2 +- .../unit_test/fixtures/device_info_fixture.h | 2 +- .../unit_test/helpers/hw_helper_tests.cpp | 2 +- .../hw_helper_tests_xehp_and_later.cpp | 28 +++-- .../unit_test/memory_manager/CMakeLists.txt | 7 -- ...nager_allocate_in_preferred_pool_tests.cpp | 34 +++++ .../memory_manager_tests_xehp_and_later.cpp | 116 ------------------ .../memory_manager_tests_xehp_and_later.h | 19 --- .../xe_hp_core/excludes_xe_hp_core.cpp | 1 + .../xe_hp_core/hw_helper_tests_xe_hp_core.cpp | 4 + .../unit_test/xe_hp_core/xehp/CMakeLists.txt | 4 +- .../xe_hp_core/xehp/get_device_info_xehp.inl | 9 +- .../xehp/memory_manager_tests_xehp.inl | 55 ++------- .../xehp/test_hw_info_config_xehp.inl | 1 + .../xehp/test_local_work_size_xehp.inl | 7 +- .../xe_hp_core/hw_helper_xe_hp_core.cpp | 5 + .../source/xe_hp_core/hw_info_xe_hp_sdv.cpp | 2 +- .../xe_hp_sdv/enable_xe_hp_sdv_testing.cmake | 2 +- 20 files changed, 93 insertions(+), 211 deletions(-) delete mode 100644 opencl/test/unit_test/memory_manager/memory_manager_tests_xehp_and_later.cpp delete mode 100644 opencl/test/unit_test/memory_manager/memory_manager_tests_xehp_and_later.h diff --git a/cmake/setup_platform_flags.cmake b/cmake/setup_platform_flags.cmake index a71c435b9a..74af14c725 100644 --- a/cmake/setup_platform_flags.cmake +++ b/cmake/setup_platform_flags.cmake @@ -208,7 +208,7 @@ endif() if(SUPPORT_XE_HP_CORE) SET_FLAGS_FOR("XE_HP_CORE") - set(CORE_XE_HP_CORE_REVISIONS 0) + set(CORE_XE_HP_CORE_REVISIONS 4) if(TESTS_XE_HP_CORE) if(TESTS_XE_HP_SDV) ADD_ITEM_FOR_GEN("FAMILY_NAME" "TESTED" "XE_HP_CORE" "XeHpFamily") diff --git a/manifests/manifest.yml b/manifests/manifest.yml index f941aa513c..5fcf976380 100644 --- a/manifests/manifest.yml +++ b/manifests/manifest.yml @@ -20,7 +20,7 @@ components: infra: branch: master dest_dir: infra - revision: a3577a9aeb5fcc4b825ceaa521631aa676931512 + revision: 493155e4b2e3df7e81ced35f1d29c5fa9dc29db4 type: git internal: branch: master diff --git a/opencl/test/unit_test/context/driver_diagnostics_tests.cpp b/opencl/test/unit_test/context/driver_diagnostics_tests.cpp index 4bdda25b8b..6c2c842791 100644 --- a/opencl/test/unit_test/context/driver_diagnostics_tests.cpp +++ b/opencl/test/unit_test/context/driver_diagnostics_tests.cpp @@ -705,7 +705,7 @@ TEST_F(PerformanceHintTest, givenUncompressedBufferWhenItsCreatedThenProperPerfo } snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[BUFFER_IS_NOT_COMPRESSED], buffer.get()); - if (isCompressed) { + if (isCompressed || is32bit) { Buffer::provideCompressionHint(GraphicsAllocation::AllocationType::BUFFER, context.get(), buffer.get()); } EXPECT_TRUE(containsHint(expectedHint, userData)); diff --git a/opencl/test/unit_test/fixtures/device_info_fixture.h b/opencl/test/unit_test/fixtures/device_info_fixture.h index 93dfc3afff..680f4bc184 100644 --- a/opencl/test/unit_test/fixtures/device_info_fixture.h +++ b/opencl/test/unit_test/fixtures/device_info_fixture.h @@ -23,7 +23,7 @@ struct GetDeviceInfoMemCapabilitiesTest : ::testing::Test { void check(std::vector ¶ms) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); - for (auto param : params) { + for (auto ¶m : params) { cl_unified_shared_memory_capabilities_intel unifiedSharedMemoryCapabilities{}; size_t paramRetSize; diff --git a/opencl/test/unit_test/helpers/hw_helper_tests.cpp b/opencl/test/unit_test/helpers/hw_helper_tests.cpp index 7caa3b8a18..c03a837809 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests.cpp @@ -1221,7 +1221,7 @@ TEST_F(HwHelperTest, whenFtrGpGpuMidThreadLevelPreemptFeatureDisabledThenFalseIs EXPECT_FALSE(result); } -TEST_F(HwHelperTest, whenGettingDefaultRevisionIdThenCorrectValueIsReturned) { +HWTEST_F(HwHelperTest, whenGettingDefaultRevisionIdThenCorrectValueIsReturned) { auto &hwHelper = HwHelper::get(renderCoreFamily); auto revisionId = hwHelper.getDefaultRevisionId(*defaultHwInfo); if ((defaultHwInfo->platform.eRenderCoreFamily == IGFX_GEN9_CORE) && diff --git a/opencl/test/unit_test/helpers/hw_helper_tests_xehp_and_later.cpp b/opencl/test/unit_test/helpers/hw_helper_tests_xehp_and_later.cpp index 99dabf3367..f1a42384a3 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests_xehp_and_later.cpp @@ -364,19 +364,27 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, HwHelperTestXeHPAndLater, WhenIsPipeControlWArequir HWCMDTEST_F(IGFX_XE_HP_CORE, HwHelperTestXeHPAndLater, whenGettingPreferenceForSmallKernelsThenCertainThresholdIsTested) { DebugManagerStateRestore restorer; + auto &hwInfo = pDevice->getHardwareInfo(); auto &helper = HwHelper::get(renderCoreFamily); - EXPECT_TRUE(helper.preferSmallWorkgroupSizeForKernel(512u, this->pClDevice->getHardwareInfo())); - EXPECT_FALSE(helper.preferSmallWorkgroupSizeForKernel(10000u, this->pClDevice->getHardwareInfo())); - EXPECT_TRUE(helper.preferSmallWorkgroupSizeForKernel(2047u, this->pClDevice->getHardwareInfo())); - EXPECT_FALSE(helper.preferSmallWorkgroupSizeForKernel(2048u, this->pClDevice->getHardwareInfo())); + if (HwInfoConfig::get(hwInfo.platform.eProductFamily)->getSteppingFromHwRevId(hwInfo) >= REVISION_B) { + EXPECT_FALSE(helper.preferSmallWorkgroupSizeForKernel(512u, hwInfo)); + EXPECT_FALSE(helper.preferSmallWorkgroupSizeForKernel(10000u, hwInfo)); + EXPECT_FALSE(helper.preferSmallWorkgroupSizeForKernel(2047u, hwInfo)); + EXPECT_FALSE(helper.preferSmallWorkgroupSizeForKernel(2048u, hwInfo)); + } else { + EXPECT_TRUE(helper.preferSmallWorkgroupSizeForKernel(512u, hwInfo)); + EXPECT_FALSE(helper.preferSmallWorkgroupSizeForKernel(10000u, hwInfo)); + EXPECT_TRUE(helper.preferSmallWorkgroupSizeForKernel(2047u, hwInfo)); + EXPECT_FALSE(helper.preferSmallWorkgroupSizeForKernel(2048u, hwInfo)); - DebugManager.flags.OverrideKernelSizeLimitForSmallDispatch.set(1u); - EXPECT_FALSE(helper.preferSmallWorkgroupSizeForKernel(1u, this->pClDevice->getHardwareInfo())); - EXPECT_TRUE(helper.preferSmallWorkgroupSizeForKernel(0u, this->pClDevice->getHardwareInfo())); + DebugManager.flags.OverrideKernelSizeLimitForSmallDispatch.set(1u); + EXPECT_FALSE(helper.preferSmallWorkgroupSizeForKernel(1u, hwInfo)); + EXPECT_TRUE(helper.preferSmallWorkgroupSizeForKernel(0u, hwInfo)); - DebugManager.flags.OverrideKernelSizeLimitForSmallDispatch.set(0u); - EXPECT_FALSE(helper.preferSmallWorkgroupSizeForKernel(1u, this->pClDevice->getHardwareInfo())); - EXPECT_FALSE(helper.preferSmallWorkgroupSizeForKernel(0u, this->pClDevice->getHardwareInfo())); + DebugManager.flags.OverrideKernelSizeLimitForSmallDispatch.set(0u); + EXPECT_FALSE(helper.preferSmallWorkgroupSizeForKernel(1u, hwInfo)); + EXPECT_FALSE(helper.preferSmallWorkgroupSizeForKernel(0u, hwInfo)); + } } HWCMDTEST_F(IGFX_XE_HP_CORE, HwHelperTestXeHPAndLater, givenHwHelperWhenGettingBindlessSurfaceExtendedMessageDescriptorValueThenCorrectValueIsReturned) { diff --git a/opencl/test/unit_test/memory_manager/CMakeLists.txt b/opencl/test/unit_test/memory_manager/CMakeLists.txt index 9eca043795..a943dd00fc 100644 --- a/opencl/test/unit_test/memory_manager/CMakeLists.txt +++ b/opencl/test/unit_test/memory_manager/CMakeLists.txt @@ -33,12 +33,5 @@ if(UNIX) list(APPEND IGDRCL_SRCS_tests_memory_manager ${NEO_CORE_PAGE_FAULT_MANAGER_LINUX_TESTS}) endif() -if(TESTS_XEHP_AND_LATER) - list(APPEND IGDRCL_SRCS_tests_memory_manager - ${CMAKE_CURRENT_SOURCE_DIR}/memory_manager_tests_xehp_and_later.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/memory_manager_tests_xehp_and_later.h - ) -endif() - target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_memory_manager}) add_subdirectories() diff --git a/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.cpp b/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.cpp index 5185e9436d..93c47d4720 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.cpp +++ b/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.cpp @@ -713,6 +713,40 @@ HWTEST_F(GetAllocationDataTestHw, givenInternalHeapTypeWhenGetAllocationDataIsCa EXPECT_TRUE(allocData.flags.requiresCpuAccess); } +HWTEST_F(GetAllocationDataTestHw, givenGpuTimestampDeviceBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { + AllocationData allocData; + MockMemoryManager mockMemoryManager; + AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, mockDeviceBitfield}; + mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); + EXPECT_FALSE(allocData.flags.useSystemMemory); + EXPECT_TRUE(allocData.flags.requiresCpuAccess); +} +HWTEST_F(GetAllocationDataTestHw, givenPrintfAllocationWhenGetAllocationDataIsCalledThenDontForceSystemMemoryAndRequireCpuAccess) { + AllocationData allocData; + MockMemoryManager mockMemoryManager; + AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, mockDeviceBitfield}; + mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); + EXPECT_FALSE(allocData.flags.useSystemMemory); + EXPECT_TRUE(allocData.flags.requiresCpuAccess); +} + +HWTEST_F(GetAllocationDataTestHw, givenLinearStreamAllocationWhenGetAllocationDataIsCalledThenDontForceSystemMemoryAndRequireCpuAccess) { + AllocationData allocData; + MockMemoryManager mockMemoryManager; + AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::LINEAR_STREAM, mockDeviceBitfield}; + mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); + EXPECT_FALSE(allocData.flags.useSystemMemory); + EXPECT_TRUE(allocData.flags.requiresCpuAccess); +} + +HWTEST_F(GetAllocationDataTestHw, givenConstantSurfaceAllocationWhenGetAllocationDataIsCalledThenDontForceSystemMemoryAndRequireCpuAccess) { + AllocationData allocData; + MockMemoryManager mockMemoryManager; + AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::CONSTANT_SURFACE, mockDeviceBitfield}; + mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); + EXPECT_FALSE(allocData.flags.useSystemMemory); + EXPECT_TRUE(allocData.flags.requiresCpuAccess); +} HWTEST_F(GetAllocationDataTestHw, givenKernelIsaTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { AllocationData allocData; MockMemoryManager mockMemoryManager; diff --git a/opencl/test/unit_test/memory_manager/memory_manager_tests_xehp_and_later.cpp b/opencl/test/unit_test/memory_manager/memory_manager_tests_xehp_and_later.cpp deleted file mode 100644 index 939f34a01e..0000000000 --- a/opencl/test/unit_test/memory_manager/memory_manager_tests_xehp_and_later.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (C) 2021 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/test/common/mocks/mock_execution_environment.h" -#include "shared/test/common/mocks/mock_graphics_allocation.h" -#include "shared/test/common/mocks/mock_memory_manager.h" - -#include "test.h" - -using namespace NEO; - -void givenEnabledLocalMemoryWhenLinearStreamIsAllocatedInSystemPoolThenLocalMemoryPoolIsUsed() { - MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); - MockMemoryManager memoryManager(false, true, executionEnvironment); - - auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::LINEAR_STREAM, mockDeviceBitfield}, nullptr); - EXPECT_NE(MemoryPool::LocalMemory, allocation->getMemoryPool()); - EXPECT_FALSE(memoryManager.allocationInDevicePoolCreated); - - memoryManager.freeGraphicsMemory(allocation); -} - -void givenLinearStreamTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested() { - AllocationData allocData; - MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::LINEAR_STREAM, mockDeviceBitfield}; - mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); - EXPECT_TRUE(allocData.flags.useSystemMemory); - EXPECT_TRUE(allocData.flags.requiresCpuAccess); -} - -void givenLinearStreamWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested() { - AllocationData allocData; - MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::LINEAR_STREAM, mockDeviceBitfield}; - mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); - EXPECT_TRUE(allocData.flags.useSystemMemory); - EXPECT_TRUE(allocData.flags.requiresCpuAccess); -} - -void givenEnabledLocalMemoryWhenAllocateInternalHeapInSystemPoolThenLocalMemoryPoolIsNotUsed() { - MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); - MockMemoryManager memoryManager(false, true, executionEnvironment); - - auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::KERNEL_ISA, mockDeviceBitfield}, nullptr); - EXPECT_NE(MemoryPool::LocalMemory, allocation->getMemoryPool()); - EXPECT_FALSE(memoryManager.allocationInDevicePoolCreated); - - memoryManager.freeGraphicsMemory(allocation); -} - -void givenKernelIsaTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested() { - AllocationData allocData; - MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::KERNEL_ISA, mockDeviceBitfield}; - mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); - EXPECT_TRUE(allocData.flags.useSystemMemory); -} - -void givenRingBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet() { - AllocationData allocData; - MockMemoryManager mockMemoryManager; - AllocationProperties properties{0, 0x10000u, GraphicsAllocation::AllocationType::RING_BUFFER, 1}; - mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); - EXPECT_TRUE(allocData.flags.useSystemMemory); - EXPECT_TRUE(allocData.flags.allocateMemory); - EXPECT_FALSE(allocData.flags.allow32Bit); - EXPECT_FALSE(allocData.flags.allow64kbPages); - EXPECT_EQ(0x10000u, allocData.size); - EXPECT_EQ(nullptr, allocData.hostPtr); - EXPECT_TRUE(allocData.flags.requiresCpuAccess); -} - -void givenSemaphoreBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet() { - AllocationData allocData; - MockMemoryManager mockMemoryManager; - AllocationProperties properties{0, 0x1000u, GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER, 1}; - mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); - EXPECT_TRUE(allocData.flags.useSystemMemory); - EXPECT_TRUE(allocData.flags.allocateMemory); - EXPECT_FALSE(allocData.flags.allow32Bit); - EXPECT_FALSE(allocData.flags.allow64kbPages); - EXPECT_EQ(0x1000u, allocData.size); - EXPECT_EQ(nullptr, allocData.hostPtr); - EXPECT_TRUE(allocData.flags.requiresCpuAccess); -} - -void givenConstantSurfaceTypeWhenGetAllocationDataIsCalledThenLocalMemoryIsRequestedWithoutCpuAccess() { - AllocationData allocData; - MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::CONSTANT_SURFACE, mockDeviceBitfield}; - mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); - EXPECT_FALSE(allocData.flags.useSystemMemory); - EXPECT_FALSE(allocData.flags.requiresCpuAccess); -} - -void givenPrintfAllocationWhenGetAllocationDataIsCalledThenUseSystemMemoryAndRequireCpuAccess() { - AllocationData allocData; - MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::PRINTF_SURFACE, mockDeviceBitfield}; - mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); - EXPECT_TRUE(allocData.flags.useSystemMemory); - EXPECT_TRUE(allocData.flags.requiresCpuAccess); -} - -void givenGpuTimestampTagBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested() { - AllocationData allocData; - MockMemoryManager mockMemoryManager; - AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, mockDeviceBitfield}; - mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); - EXPECT_TRUE(allocData.flags.useSystemMemory); -} \ No newline at end of file diff --git a/opencl/test/unit_test/memory_manager/memory_manager_tests_xehp_and_later.h b/opencl/test/unit_test/memory_manager/memory_manager_tests_xehp_and_later.h deleted file mode 100644 index a8ecbd9fc2..0000000000 --- a/opencl/test/unit_test/memory_manager/memory_manager_tests_xehp_and_later.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2021 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#pragma once - -void givenEnabledLocalMemoryWhenLinearStreamIsAllocatedInSystemPoolThenLocalMemoryPoolIsUsed(); -void givenLinearStreamTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested(); -void givenLinearStreamWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested(); -void givenEnabledLocalMemoryWhenAllocateInternalHeapInSystemPoolThenLocalMemoryPoolIsNotUsed(); -void givenKernelIsaTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested(); -void givenRingBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet(); -void givenSemaphoreBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet(); -void givenConstantSurfaceTypeWhenGetAllocationDataIsCalledThenLocalMemoryIsRequestedWithoutCpuAccess(); -void givenPrintfAllocationWhenGetAllocationDataIsCalledThenUseSystemMemoryAndRequireCpuAccess(); -void givenGpuTimestampTagBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested(); \ No newline at end of file diff --git a/opencl/test/unit_test/xe_hp_core/excludes_xe_hp_core.cpp b/opencl/test/unit_test/xe_hp_core/excludes_xe_hp_core.cpp index 47279fe877..bc0c54a9f5 100644 --- a/opencl/test/unit_test/xe_hp_core/excludes_xe_hp_core.cpp +++ b/opencl/test/unit_test/xe_hp_core/excludes_xe_hp_core.cpp @@ -16,3 +16,4 @@ HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfExtraParame HWTEST_EXCLUDE_PRODUCT(CommandStreamReceiverFlushTaskXeHPAndLaterTests, givenProgramPipeControlPriorToNonPipelinedStateCommandDebugKeyAndStateSipWhenItIsRequiredThenThereIsPipeControlPriorToIt, IGFX_XE_HP_CORE); HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfTile64With3DSurfaceOnBCSIsSupportedThenTrueIsReturned, IGFX_XE_HP_CORE); HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfBlitterForImagesIsSupportedThenFalseIsReturned, IGFX_XE_HP_CORE); +HWTEST_EXCLUDE_PRODUCT(HwHelperTest, whenGettingDefaultRevisionIdThenCorrectValueIsReturned, IGFX_XE_HP_CORE); diff --git a/opencl/test/unit_test/xe_hp_core/hw_helper_tests_xe_hp_core.cpp b/opencl/test/unit_test/xe_hp_core/hw_helper_tests_xe_hp_core.cpp index 4e4db67a51..c6352cad8b 100644 --- a/opencl/test/unit_test/xe_hp_core/hw_helper_tests_xe_hp_core.cpp +++ b/opencl/test/unit_test/xe_hp_core/hw_helper_tests_xe_hp_core.cpp @@ -308,3 +308,7 @@ XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenXeHpCoreHelperWhenCheckDirectSubm XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, WhenGettingDeviceIpVersionThenMakeCorrectDeviceIpVersion) { EXPECT_EQ(ClHwHelperMock::makeDeviceIpVersion(12, 5, 1), ClHwHelper::get(renderCoreFamily).getDeviceIpVersion(*defaultHwInfo)); } + +XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, whenGettingDefaultRevisionThenB0IsReturned) { + EXPECT_EQ(HwInfoConfigHw::get()->getHwRevIdFromStepping(REVISION_B, *defaultHwInfo), HwHelperHw::get().getDefaultRevisionId(*defaultHwInfo)); +} \ No newline at end of file diff --git a/opencl/test/unit_test/xe_hp_core/xehp/CMakeLists.txt b/opencl/test/unit_test/xe_hp_core/xehp/CMakeLists.txt index 69240fbdb9..ffb2d207b7 100644 --- a/opencl/test/unit_test/xe_hp_core/xehp/CMakeLists.txt +++ b/opencl/test/unit_test/xe_hp_core/xehp/CMakeLists.txt @@ -26,6 +26,6 @@ if(TESTS_XE_HP_SDV) target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_xe_hp_core_xehp}) add_subdirectories() - neo_copy_test_files_with_revision(copy_test_files_xe_hp_sdv_0 xe_hp_sdv 0) - add_dependencies(copy_test_files_per_product copy_test_files_xe_hp_sdv_0) + neo_copy_test_files_with_revision(copy_test_files_xe_hp_sdv_4 xe_hp_sdv 4) + add_dependencies(copy_test_files_per_product copy_test_files_xe_hp_sdv_4) endif() diff --git a/opencl/test/unit_test/xe_hp_core/xehp/get_device_info_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/get_device_info_xehp.inl index 65ffc058fb..9ae99b016f 100644 --- a/opencl/test/unit_test/xe_hp_core/xehp/get_device_info_xehp.inl +++ b/opencl/test/unit_test/xe_hp_core/xehp/get_device_info_xehp.inl @@ -42,7 +42,10 @@ XEHPTEST_F(GetDeviceInfoMemCapabilitiesTest, GivenDebugVariableIsEnabledThenUsmH check(params); } -XEHPTEST_F(GetDeviceInfoMemCapabilitiesTest, GivenDebugVariableIsDisabledThenUsmHostMemSupportIsDisabled) { +XEHPTEST_F(GetDeviceInfoMemCapabilitiesTest, GivenA0AndDebugVariableIsDisabledThenUsmHostMemSupportIsDisabled) { + VariableBackup backupHwInfo(defaultHwInfo.get()); + const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); + defaultHwInfo->platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A0, *defaultHwInfo); DebugManagerStateRestore dbgRestorer; DebugManager.flags.EnableHostUsmSupport.set(0); std::vector params = {{CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL, 0}}; @@ -61,8 +64,8 @@ XEHPTEST_F(GetDeviceInfoMemCapabilitiesTest, GivenDebugVariableIsDisabledThenUsm } XEHPTEST_F(GetDeviceInfoMemCapabilitiesTest, GivenB0ThenUsmHostMemSupportIsSetCorrectly) { - auto steppingSave = defaultHwInfo->platform.usRevId; const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); + VariableBackup backupHwInfo(defaultHwInfo.get()); defaultHwInfo->platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, *defaultHwInfo); std::vector params = {{CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL, CL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL}}; std::vector disabledParameters = {{CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL, 0u}}; @@ -80,6 +83,4 @@ XEHPTEST_F(GetDeviceInfoMemCapabilitiesTest, GivenB0ThenUsmHostMemSupportIsSetCo DebugManager.flags.EnableHostUsmSupport.set(1); check(params); } - - defaultHwInfo->platform.usRevId = steppingSave; } diff --git a/opencl/test/unit_test/xe_hp_core/xehp/memory_manager_tests_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/memory_manager_tests_xehp.inl index 0e3e0fb355..8f52924f6c 100644 --- a/opencl/test/unit_test/xe_hp_core/xehp/memory_manager_tests_xehp.inl +++ b/opencl/test/unit_test/xe_hp_core/xehp/memory_manager_tests_xehp.inl @@ -5,7 +5,10 @@ * */ -#include "opencl/test/unit_test/memory_manager/memory_manager_tests_xehp_and_later.h" +#include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/mocks/mock_graphics_allocation.h" +#include "shared/test/common/mocks/mock_memory_manager.h" + #include "test.h" using namespace NEO; @@ -14,51 +17,15 @@ HWTEST_EXCLUDE_PRODUCT(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocateIn HWTEST_EXCLUDE_PRODUCT(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocateKernelIsaInDevicePoolThenLocalMemoryPoolIsUsed, IGFX_XE_HP_SDV); HWTEST_EXCLUDE_PRODUCT(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocateInternalHeapInDevicePoolThenLocalMemoryPoolIsUsed, IGFX_XE_HP_SDV); HWTEST_EXCLUDE_PRODUCT(MemoryManagerTests, givenEnabledLocalMemoryWhenLinearStreamIsAllocatedInDevicePoolThenLocalMemoryPoolIsUsed, IGFX_XE_HP_SDV); -HWTEST_EXCLUDE_PRODUCT(GetAllocationDataTestHw, givenLinearStreamTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested, IGFX_XE_HP_SDV); -HWTEST_EXCLUDE_PRODUCT(GetAllocationDataTestHw, givenLinearStreamWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested, IGFX_XE_HP_SDV); -HWTEST_EXCLUDE_PRODUCT(GetAllocationDataTestHw, givenKernelIsaTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested, IGFX_XE_HP_SDV); -HWTEST_EXCLUDE_PRODUCT(GetAllocationDataTestHw, givenInternalHeapTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested, IGFX_XE_HP_SDV); -HWTEST_EXCLUDE_PRODUCT(GetAllocationDataTestHw, givenRingBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet, IGFX_XE_HP_SDV); -HWTEST_EXCLUDE_PRODUCT(GetAllocationDataTestHw, givenSemaphoreBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet, IGFX_XE_HP_SDV); -HWTEST_EXCLUDE_PRODUCT(GetAllocationDataTestHw, givenPrintfAllocationWhenGetAllocationDataIsCalledThenDontUseSystemMemoryAndRequireCpuAccess, IGFX_XE_HP_SDV); using MemoryManagerTestsXeHP = ::testing::Test; -XEHPTEST_F(MemoryManagerTestsXeHP, givenEnabledLocalMemoryWhenLinearStreamIsAllocatedInSystemPoolThenLocalMemoryPoolIsUsed) { - givenEnabledLocalMemoryWhenLinearStreamIsAllocatedInSystemPoolThenLocalMemoryPoolIsUsed(); -} +XEHPTEST_F(MemoryManagerTestsXeHP, givenEnabledLocalMemoryWhenLinearStreamIsAllocatedInPreferredPoolThenLocalMemoryPoolIsUsed) { + MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); + MockMemoryManager memoryManager(false, true, executionEnvironment); -XEHPTEST_F(MemoryManagerTestsXeHP, givenLinearStreamTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { - givenLinearStreamTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested(); -} + auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::LINEAR_STREAM, mockDeviceBitfield}, nullptr); + EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool()); + EXPECT_TRUE(memoryManager.allocationInDevicePoolCreated); -XEHPTEST_F(MemoryManagerTestsXeHP, givenLinearStreamWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { - givenLinearStreamWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested(); -} - -XEHPTEST_F(MemoryManagerTestsXeHP, givenEnabledLocalMemoryWhenAllocateInternalHeapInSystemPoolThenLocalMemoryPoolIsNotUsed) { - givenEnabledLocalMemoryWhenAllocateInternalHeapInSystemPoolThenLocalMemoryPoolIsNotUsed(); -} - -XEHPTEST_F(MemoryManagerTestsXeHP, givenKernelIsaTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { - givenKernelIsaTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested(); -} - -XEHPTEST_F(MemoryManagerTestsXeHP, givenRingBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet) { - givenRingBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet(); -} - -XEHPTEST_F(MemoryManagerTestsXeHP, givenSemaphoreBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet) { - givenSemaphoreBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet(); -} - -XEHPTEST_F(MemoryManagerTestsXeHP, givenConstantSurfaceTypeWhenGetAllocationDataIsCalledThenLocalMemoryIsRequestedWithoutCpuAccess) { - givenConstantSurfaceTypeWhenGetAllocationDataIsCalledThenLocalMemoryIsRequestedWithoutCpuAccess(); -} - -XEHPTEST_F(MemoryManagerTestsXeHP, givenPrintfAllocationWhenGetAllocationDataIsCalledThenUseSystemMemoryAndRequireCpuAccess) { - givenPrintfAllocationWhenGetAllocationDataIsCalledThenUseSystemMemoryAndRequireCpuAccess(); -} - -XEHPTEST_F(MemoryManagerTestsXeHP, givenGpuTimestampTagBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { - givenGpuTimestampTagBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested(); + memoryManager.freeGraphicsMemory(allocation); } diff --git a/opencl/test/unit_test/xe_hp_core/xehp/test_hw_info_config_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/test_hw_info_config_xehp.inl index b2dcba0baa..76c7dd7eee 100644 --- a/opencl/test/unit_test/xe_hp_core/xehp/test_hw_info_config_xehp.inl +++ b/opencl/test/unit_test/xe_hp_core/xehp/test_hw_info_config_xehp.inl @@ -108,6 +108,7 @@ XEHPTEST_F(XeHPHwHelperTest, givenXeHPMultiConfigWhenAllowRenderCompressionIsCal XEHPTEST_F(XeHPHwInfoConfig, givenHwInfoConfigWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned) { const auto &hwInfoConfig = *HwInfoConfig::get(productFamily); auto hwInfo = *defaultHwInfo; + hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A0, hwInfo); EXPECT_FALSE(hwInfoConfig.isDisableOverdispatchAvailable(hwInfo)); hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hwInfo); diff --git a/opencl/test/unit_test/xe_hp_core/xehp/test_local_work_size_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/test_local_work_size_xehp.inl index 4363442d14..8c8f3bb8bd 100644 --- a/opencl/test/unit_test/xe_hp_core/xehp/test_local_work_size_xehp.inl +++ b/opencl/test/unit_test/xe_hp_core/xehp/test_local_work_size_xehp.inl @@ -99,7 +99,7 @@ XEHPTEST_F(XeHPComputeWorkgroupSizeTest, givenXeHPAndForceWorkgroupSize1x1x1Flag EXPECT_NE(1u, expectedLws.x * expectedLws.y * expectedLws.z); } } -XEHPTEST_F(XeHPComputeWorkgroupSizeTest, giveXeHpWhenKernelIsaIsBelowThresholdAndThereAreNoImageBarriersAndSlmThenSmallWorkgorupSizeIsSelected) { +XEHPTEST_F(XeHPComputeWorkgroupSizeTest, giveXeHpA0WhenKernelIsaIsBelowThresholdAndThereAreNoImageBarriersAndSlmThenSmallWorkgorupSizeIsSelected) { auto program = std::make_unique(toClDeviceVector(*pClDevice)); MockKernelWithInternals mockKernel(*pClDevice); @@ -114,6 +114,9 @@ XEHPTEST_F(XeHPComputeWorkgroupSizeTest, giveXeHpWhenKernelIsaIsBelowThresholdAn auto maxWgSize = pClDevice->getSharedDeviceInfo().maxWorkGroupSize; + auto &hwInfo = *pDevice->getRootDeviceEnvironment().getMutableHardwareInfo(); + const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); + hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A0, hwInfo); { auto expectedLws = computeWorkgroupSize(dispatchInfo); EXPECT_EQ(64u, expectedLws.x * expectedLws.y * expectedLws.z); @@ -139,7 +142,7 @@ XEHPTEST_F(XeHPComputeWorkgroupSizeTest, giveXeHpWhenKernelIsaIsBelowThresholdAn mockKernel.kernelInfo.kernelDescriptor.kernelAttributes.barrierCount = 0u; //on B0 algorithm is disabled - pClDevice->getRootDeviceEnvironment().getMutableHardwareInfo()->platform.usRevId = REVISION_B; + hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hwInfo); { auto expectedLws = computeWorkgroupSize(dispatchInfo); EXPECT_EQ(maxWgSize, expectedLws.x * expectedLws.y * expectedLws.z); diff --git a/shared/source/xe_hp_core/hw_helper_xe_hp_core.cpp b/shared/source/xe_hp_core/hw_helper_xe_hp_core.cpp index 91bbe5921a..467055ac55 100644 --- a/shared/source/xe_hp_core/hw_helper_xe_hp_core.cpp +++ b/shared/source/xe_hp_core/hw_helper_xe_hp_core.cpp @@ -167,6 +167,11 @@ bool HwHelperHw::additionalPipeControlArgsRequired() const { return false; } +template <> +uint32_t HwHelperHw::getDefaultRevisionId(const HardwareInfo &hwInfo) const { + return HwInfoConfig::get(hwInfo.platform.eProductFamily)->getHwRevIdFromStepping(REVISION_B, hwInfo); +} + template class HwHelperHw; template class FlatBatchBufferHelperHw; template struct MemorySynchronizationCommands; diff --git a/shared/source/xe_hp_core/hw_info_xe_hp_sdv.cpp b/shared/source/xe_hp_core/hw_info_xe_hp_sdv.cpp index a71a620f84..cd393d57b7 100644 --- a/shared/source/xe_hp_core/hw_info_xe_hp_sdv.cpp +++ b/shared/source/xe_hp_core/hw_info_xe_hp_sdv.cpp @@ -28,7 +28,7 @@ const PLATFORM XE_HP_SDV::platform = { IGFX_XE_HP_CORE, PLATFORM_NONE, // default init 0, // usDeviceID - 0, // usRevId. 0 sets the stepping to A0 + 4, // usRevId. 0 sets the stepping to A0 0, // usDeviceID_PCH 0, // usRevId_PCH GTTYPE_UNDEFINED}; diff --git a/target_unit_tests/xe_hp_core/xe_hp_sdv/enable_xe_hp_sdv_testing.cmake b/target_unit_tests/xe_hp_core/xe_hp_sdv/enable_xe_hp_sdv_testing.cmake index 82988128b4..be1e6aa779 100644 --- a/target_unit_tests/xe_hp_core/xe_hp_sdv/enable_xe_hp_sdv_testing.cmake +++ b/target_unit_tests/xe_hp_core/xe_hp_sdv/enable_xe_hp_sdv_testing.cmake @@ -5,6 +5,6 @@ # if(TESTS_XE_HP_SDV) - set(unit_test_config "xe_hp_sdv/2/4/5/0") # non-zero values for unit tests + set(unit_test_config "xe_hp_sdv/2/4/5/4") # non-zero values for unit tests include(${NEO_SOURCE_DIR}/cmake/run_ult_target.cmake) endif()