diff --git a/unit_tests/gen12lp/CMakeLists.txt b/unit_tests/gen12lp/CMakeLists.txt index dec259c719..151cabaa62 100644 --- a/unit_tests/gen12lp/CMakeLists.txt +++ b/unit_tests/gen12lp/CMakeLists.txt @@ -13,6 +13,7 @@ if(TESTS_GEN12LP) ${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_simulated_common_hw_tests_gen12lp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/compute_mode_tests_gen12lp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/enqueue_media_kernel_gen12lp.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/hardware_commands_helper_tests_gen12lp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_tests_gen12lp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/image_tests_gen12lp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/kernel_tests_gen12lp.cpp diff --git a/unit_tests/gen12lp/hardware_commands_helper_tests_gen12lp.cpp b/unit_tests/gen12lp/hardware_commands_helper_tests_gen12lp.cpp new file mode 100644 index 0000000000..85a877cd5c --- /dev/null +++ b/unit_tests/gen12lp/hardware_commands_helper_tests_gen12lp.cpp @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2019 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "runtime/helpers/hardware_commands_helper.h" +#include "test.h" +#include "unit_tests/mocks/mock_device.h" +#include "unit_tests/mocks/mock_kernel.h" + +using namespace NEO; + +using HardwareCommandsGen12LpTests = ::testing::Test; + +TGLLPTEST_F(HardwareCommandsGen12LpTests, GivenTgllpA0WhenSettingKernelStartOffsetThenAdditionalOffsetIsSet) { + const uint64_t defaultKernelStartOffset = 0; + const uint64_t additionalOffsetDueToFfid = 0x1234; + SPatchThreadPayload threadPayload{}; + threadPayload.OffsetToSkipSetFFIDGP = additionalOffsetDueToFfid; + auto hwInfo = *platformDevices[0]; + + __REVID revIds[] = {REVISION_A0, REVISION_A1}; + for (auto revId : revIds) { + hwInfo.platform.usRevId = revId; + auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); + MockKernelWithInternals mockKernelWithInternals{*device}; + mockKernelWithInternals.kernelInfo.patchInfo.threadPayload = &threadPayload; + + for (auto isCcsUsed : ::testing::Bool()) { + uint64_t kernelStartOffset = defaultKernelStartOffset; + HardwareCommandsHelper::setKernelStartOffset(kernelStartOffset, false, mockKernelWithInternals.kernelInfo, false, + false, *mockKernelWithInternals.mockKernel, isCcsUsed); + + if ((revId == REVISION_A0) && isCcsUsed) { + EXPECT_EQ(defaultKernelStartOffset + additionalOffsetDueToFfid, kernelStartOffset); + } else { + EXPECT_EQ(defaultKernelStartOffset, kernelStartOffset); + } + } + } +} diff --git a/unit_tests/helpers/hardware_commands_helper_tests.cpp b/unit_tests/helpers/hardware_commands_helper_tests.cpp index ca6d5e08a7..95e6645fb1 100644 --- a/unit_tests/helpers/hardware_commands_helper_tests.cpp +++ b/unit_tests/helpers/hardware_commands_helper_tests.cpp @@ -1116,37 +1116,6 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, GivenKernelWithSamplersWhenInd delete[] mockDsh; } -using HardwareCommandsWaTest = ::testing::Test; - -HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsWaTest, GivenTgllpA0WhenSettingKernelStartOffsetThenAdditionalOffsetIsSet) { - const uint64_t defaultKernelStartOffset = 0; - const uint64_t additionalOffsetDueToFfid = 0x1234; - SPatchThreadPayload threadPayload{}; - threadPayload.OffsetToSkipSetFFIDGP = additionalOffsetDueToFfid; - auto hwInfo = *platformDevices[0]; - - hwInfo.platform.eProductFamily = IGFX_TIGERLAKE_LP; - __REVID revIds[] = {REVISION_A0, REVISION_A1}; - for (auto revId : revIds) { - hwInfo.platform.usRevId = revId; - auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); - MockKernelWithInternals mockKernelWithInternals{*device}; - mockKernelWithInternals.kernelInfo.patchInfo.threadPayload = &threadPayload; - - for (auto isCcsUsed : ::testing::Bool()) { - uint64_t kernelStartOffset = defaultKernelStartOffset; - HardwareCommandsHelper::setKernelStartOffset(kernelStartOffset, false, mockKernelWithInternals.kernelInfo, false, - false, *mockKernelWithInternals.mockKernel, isCcsUsed); - - if ((revId == REVISION_A0) && isCcsUsed) { - EXPECT_EQ(defaultKernelStartOffset + additionalOffsetDueToFfid, kernelStartOffset); - } else { - EXPECT_EQ(defaultKernelStartOffset, kernelStartOffset); - } - } - } -} - using HardwareCommandsHelperTests = ::testing::Test; HWTEST_F(HardwareCommandsHelperTests, givenCompareAddressAndDataWhenProgrammingSemaphoreWaitThenSetupAllFields) {