From d48f5b01f6ee99fa3bd04dfc2aedb84849555e3e Mon Sep 17 00:00:00 2001 From: Zbigniew Zdanowicz Date: Wed, 12 Apr 2023 21:33:35 +0000 Subject: [PATCH] [refactor] reposition implementations of unit test hw helper - remove double implementation between similar hw generation. - group the same implementations into dedicated inl files. Signed-off-by: Zbigniew Zdanowicz --- .../common/gen11/unit_test_helper_gen11.cpp | 17 +----- .../gen12lp/unit_test_helper_gen12lp.cpp | 17 +----- .../common/gen8/unit_test_helper_gen8.cpp | 12 +--- .../common/gen9/unit_test_helper_gen9.cpp | 12 +--- .../test/common/helpers/unit_test_helper.inl | 44 ++------------- .../unit_test_helper_bdw_and_later.inl | 53 ++++++++++++++++++ .../unit_test_helper_xe_hpc_and_later.inl | 37 ++++++++++++ .../unit_test_helper_xe_hpg_and_xe_hpc.inl | 51 +++++++++++++++++ .../unit_test_helper_xehp_and_later.inl | 43 ++++++-------- shared/test/common/libult/CMakeLists.txt | 12 ++++ .../unit_test_helper_xe_hpc_core.cpp | 56 +------------------ .../unit_test_helper_xe_hpg_core.cpp | 49 ++++++++-------- 12 files changed, 208 insertions(+), 195 deletions(-) create mode 100644 shared/test/common/helpers/unit_test_helper_xe_hpc_and_later.inl create mode 100644 shared/test/common/helpers/unit_test_helper_xe_hpg_and_xe_hpc.inl diff --git a/shared/test/common/gen11/unit_test_helper_gen11.cpp b/shared/test/common/gen11/unit_test_helper_gen11.cpp index 8f74315c45..907c8f734d 100644 --- a/shared/test/common/gen11/unit_test_helper_gen11.cpp +++ b/shared/test/common/gen11/unit_test_helper_gen11.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -20,20 +20,5 @@ uint32_t UnitTestHelper::getDebugModeRegisterOffset() { return 0x20d8; } -template <> -uint32_t UnitTestHelper::getDebugModeRegisterValue() { - return (1u << 5) | (1u << 21); -} - -template <> -uint32_t UnitTestHelper::getTdCtlRegisterOffset() { - return 0xe400; -} - -template <> -uint32_t UnitTestHelper::getTdCtlRegisterValue() { - return (1u << 7) | (1u << 4); -} - template struct UnitTestHelper; } // namespace NEO diff --git a/shared/test/common/gen12lp/unit_test_helper_gen12lp.cpp b/shared/test/common/gen12lp/unit_test_helper_gen12lp.cpp index 9342262321..ef3317125f 100644 --- a/shared/test/common/gen12lp/unit_test_helper_gen12lp.cpp +++ b/shared/test/common/gen12lp/unit_test_helper_gen12lp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -36,21 +36,6 @@ uint32_t UnitTestHelper::getDebugModeRegisterOffset() { return 0x20d8; } -template <> -uint32_t UnitTestHelper::getDebugModeRegisterValue() { - return (1u << 5) | (1u << 21); -} - -template <> -uint32_t UnitTestHelper::getTdCtlRegisterOffset() { - return 0xe400; -} - -template <> -uint32_t UnitTestHelper::getTdCtlRegisterValue() { - return (1u << 7) | (1u << 4); -} - template <> bool UnitTestHelper::getDisableFusionStateFromFrontEndCommand(const typename Family::VFE_STATE_TYPE &feCmd) { return feCmd.getDisableSlice0Subslice2(); diff --git a/shared/test/common/gen8/unit_test_helper_gen8.cpp b/shared/test/common/gen8/unit_test_helper_gen8.cpp index d7f7bc0372..05a381f45d 100644 --- a/shared/test/common/gen8/unit_test_helper_gen8.cpp +++ b/shared/test/common/gen8/unit_test_helper_gen8.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -25,15 +25,5 @@ uint32_t UnitTestHelper::getDebugModeRegisterValue() { return (1u << 6) | (1u << 22); } -template <> -uint32_t UnitTestHelper::getTdCtlRegisterOffset() { - return 0xe400; -} - -template <> -uint32_t UnitTestHelper::getTdCtlRegisterValue() { - return (1u << 7) | (1u << 4); -} - template struct UnitTestHelper; } // namespace NEO diff --git a/shared/test/common/gen9/unit_test_helper_gen9.cpp b/shared/test/common/gen9/unit_test_helper_gen9.cpp index 3ae6f9cadc..f7b8b5b532 100644 --- a/shared/test/common/gen9/unit_test_helper_gen9.cpp +++ b/shared/test/common/gen9/unit_test_helper_gen9.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -29,15 +29,5 @@ uint32_t UnitTestHelper::getDebugModeRegisterValue() { return (1u << 6) | (1u << 22); } -template <> -uint32_t UnitTestHelper::getTdCtlRegisterOffset() { - return 0xe400; -} - -template <> -uint32_t UnitTestHelper::getTdCtlRegisterValue() { - return (1u << 7) | (1u << 4); -} - template struct UnitTestHelper; } // namespace NEO diff --git a/shared/test/common/helpers/unit_test_helper.inl b/shared/test/common/helpers/unit_test_helper.inl index 4050aec7c0..b9bb1e79b4 100644 --- a/shared/test/common/helpers/unit_test_helper.inl +++ b/shared/test/common/helpers/unit_test_helper.inl @@ -16,13 +16,13 @@ namespace NEO { template -bool UnitTestHelper::isPageTableManagerSupported(const HardwareInfo &hwInfo) { - return false; +uint32_t UnitTestHelper::getTdCtlRegisterOffset() { + return 0xe400; } template -inline uint32_t UnitTestHelper::getAppropriateThreadArbitrationPolicy(int32_t policy) { - return static_cast(policy); +bool UnitTestHelper::isPageTableManagerSupported(const HardwareInfo &hwInfo) { + return false; } template @@ -30,37 +30,6 @@ bool UnitTestHelper::isPipeControlWArequired(const HardwareInfo &hwIn return false; } -template -bool UnitTestHelper::isAdditionalSynchronizationRequired() { - return false; -} - -template -bool UnitTestHelper::isAdditionalMiSemaphoreWaitRequired(const RootDeviceEnvironment &rootDeviceEnvironment) { - return false; -} - -template -inline uint64_t UnitTestHelper::getAtomicMemoryAddress(const typename GfxFamily::MI_ATOMIC &atomic) { - return atomic.getMemoryAddress() | ((static_cast(atomic.getMemoryAddressHigh())) << 32); -} - -template -inline bool UnitTestHelper::requiresTimestampPacketsInSystemMemory(HardwareInfo &hwInfo) { - return true; -} - -template -void UnitTestHelper::setExtraMidThreadPreemptionFlag(HardwareInfo &hwInfo, bool value) { - hwInfo.featureTable.flags.ftrGpGpuMidThreadLevelPreempt = value; -} - -template -const uint32_t UnitTestHelper::smallestTestableSimdSize = 8; - -template -const AuxTranslationMode UnitTestHelper::requiredAuxTranslationMode = AuxTranslationMode::Builtin; - template const bool UnitTestHelper::useFullRowForLocalIdsGeneration = false; @@ -75,11 +44,6 @@ inline uint64_t UnitTestHelper::getPipeControlPostSyncAddress(const t return (gpuAddressHigh << 32) | gpuAddress; } -template -bool UnitTestHelper::timestampRegisterHighAddress() { - return false; -} - template void UnitTestHelper::validateSbaMocs(uint32_t expectedMocs, CommandStreamReceiver &csr) { using STATE_BASE_ADDRESS = typename GfxFamily::STATE_BASE_ADDRESS; diff --git a/shared/test/common/helpers/unit_test_helper_bdw_and_later.inl b/shared/test/common/helpers/unit_test_helper_bdw_and_later.inl index 5e0e18eaf5..51c7ccb6f2 100644 --- a/shared/test/common/helpers/unit_test_helper_bdw_and_later.inl +++ b/shared/test/common/helpers/unit_test_helper_bdw_and_later.inl @@ -5,16 +5,69 @@ * */ +#include "shared/source/helpers/hw_info.h" #include "shared/source/kernel/kernel_descriptor.h" +#include "shared/test/common/cmd_parse/gen_cmd_parse.h" #include "shared/test/common/helpers/unit_test_helper.h" namespace NEO { +template +uint64_t UnitTestHelper::getAtomicMemoryAddress(const typename GfxFamily::MI_ATOMIC &atomic) { + return atomic.getMemoryAddress() | ((static_cast(atomic.getMemoryAddressHigh())) << 32); +} + +template +const uint32_t UnitTestHelper::smallestTestableSimdSize = 8; + +template +uint32_t UnitTestHelper::getAppropriateThreadArbitrationPolicy(int32_t policy) { + return static_cast(policy); +} + +template +void UnitTestHelper::setExtraMidThreadPreemptionFlag(HardwareInfo &hwInfo, bool value) { + hwInfo.featureTable.flags.ftrGpGpuMidThreadLevelPreempt = value; +} + +template +bool UnitTestHelper::isAdditionalMiSemaphoreWaitRequired(const RootDeviceEnvironment &rootDeviceEnvironment) { + return false; +} + +template +uint32_t UnitTestHelper::getDebugModeRegisterValue() { + return (1u << 5) | (1u << 21); +} + +template +bool UnitTestHelper::isAdditionalSynchronizationRequired() { + return false; +} + +template +bool UnitTestHelper::requiresTimestampPacketsInSystemMemory(HardwareInfo &hwInfo) { + return true; +} + +template +const AuxTranslationMode UnitTestHelper::requiredAuxTranslationMode = AuxTranslationMode::Builtin; + +template +uint32_t UnitTestHelper::getTdCtlRegisterValue() { + return (1u << 7) | (1u << 4); +} + template bool UnitTestHelper::isL3ConfigProgrammable() { return true; }; +template +bool UnitTestHelper::timestampRegisterHighAddress() { + return false; +} + template bool UnitTestHelper::evaluateDshUsage(size_t sizeBeforeEnqueue, size_t sizeAfterEnqueue, const KernelDescriptor *kernelDescriptor, uint32_t rootDeviceIndex) { if (sizeBeforeEnqueue != sizeAfterEnqueue) { diff --git a/shared/test/common/helpers/unit_test_helper_xe_hpc_and_later.inl b/shared/test/common/helpers/unit_test_helper_xe_hpc_and_later.inl new file mode 100644 index 0000000000..b33787b27f --- /dev/null +++ b/shared/test/common/helpers/unit_test_helper_xe_hpc_and_later.inl @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/test/common/helpers/unit_test_helper.h" + +namespace NEO { + +template +uint64_t UnitTestHelper::getAtomicMemoryAddress(const typename GfxFamily::MI_ATOMIC &atomic) { + return atomic.getMemoryAddress(); +} + +template +uint32_t UnitTestHelper::getAppropriateThreadArbitrationPolicy(int32_t policy) { + using STATE_COMPUTE_MODE = typename GfxFamily::STATE_COMPUTE_MODE; + switch (policy) { + case ThreadArbitrationPolicy::RoundRobin: + return STATE_COMPUTE_MODE::EU_THREAD_SCHEDULING_MODE_OVERRIDE::EU_THREAD_SCHEDULING_MODE_OVERRIDE_ROUND_ROBIN; + case ThreadArbitrationPolicy::AgeBased: + return STATE_COMPUTE_MODE::EU_THREAD_SCHEDULING_MODE_OVERRIDE::EU_THREAD_SCHEDULING_MODE_OVERRIDE_OLDEST_FIRST; + case ThreadArbitrationPolicy::RoundRobinAfterDependency: + return STATE_COMPUTE_MODE::EU_THREAD_SCHEDULING_MODE_OVERRIDE::EU_THREAD_SCHEDULING_MODE_OVERRIDE_STALL_BASED_ROUND_ROBIN; + default: + return STATE_COMPUTE_MODE::EU_THREAD_SCHEDULING_MODE_OVERRIDE::EU_THREAD_SCHEDULING_MODE_OVERRIDE_HW_DEFAULT; + } +} + +template +bool UnitTestHelper::isAdditionalSynchronizationRequired() { + return true; +} + +} // namespace NEO diff --git a/shared/test/common/helpers/unit_test_helper_xe_hpg_and_xe_hpc.inl b/shared/test/common/helpers/unit_test_helper_xe_hpg_and_xe_hpc.inl new file mode 100644 index 0000000000..e1867807b8 --- /dev/null +++ b/shared/test/common/helpers/unit_test_helper_xe_hpg_and_xe_hpc.inl @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/test/common/helpers/unit_test_helper.h" + +namespace NEO { + +template +const AuxTranslationMode UnitTestHelper::requiredAuxTranslationMode = AuxTranslationMode::Blit; + +template +GenCmdList::iterator UnitTestHelper::findMidThreadPreemptionAllocationCommand(GenCmdList::iterator begin, GenCmdList::iterator end) { + return end; +} + +template +std::vector UnitTestHelper::findAllMidThreadPreemptionAllocationCommand(GenCmdList::iterator begin, GenCmdList::iterator end) { + std::vector emptyList; + return emptyList; +} + +template +bool UnitTestHelper::timestampRegisterHighAddress() { + return false; +} + +template +void UnitTestHelper::setExtraMidThreadPreemptionFlag(HardwareInfo &hwInfo, bool value) { + hwInfo.featureTable.flags.ftrGpGpuMidThreadLevelPreempt = value; +} + +template +inline void UnitTestHelper::setPipeControlHdcPipelineFlush(typename GfxFamily::PIPE_CONTROL &pipeControl, bool hdcPipelineFlush) { + pipeControl.setHdcPipelineFlush(hdcPipelineFlush); +} + +template +inline bool UnitTestHelper::getPipeControlHdcPipelineFlush(const typename GfxFamily::PIPE_CONTROL &pipeControl) { + return pipeControl.getHdcPipelineFlush(); +} + +template +bool UnitTestHelper::getSystolicFlagValueFromPipelineSelectCommand(const typename GfxFamily::PIPELINE_SELECT &pipelineSelectCmd) { + return pipelineSelectCmd.getSystolicModeEnable(); +} + +} // namespace NEO diff --git a/shared/test/common/helpers/unit_test_helper_xehp_and_later.inl b/shared/test/common/helpers/unit_test_helper_xehp_and_later.inl index 28fec2525a..36ecddcda4 100644 --- a/shared/test/common/helpers/unit_test_helper_xehp_and_later.inl +++ b/shared/test/common/helpers/unit_test_helper_xehp_and_later.inl @@ -14,6 +14,24 @@ namespace NEO { +template +const uint32_t UnitTestHelper::smallestTestableSimdSize = 16; + +template +uint32_t UnitTestHelper::getDebugModeRegisterOffset() { + return 0x20d8; +} + +template +uint32_t UnitTestHelper::getDebugModeRegisterValue() { + return (1u << 5) | (1u << 21); +} + +template +uint32_t UnitTestHelper::getTdCtlRegisterValue() { + return (1u << 7) | (1u << 4) | (1u << 2) | (1u << 0); +} + template bool UnitTestHelper::isL3ConfigProgrammable() { return false; @@ -72,15 +90,6 @@ auto UnitTestHelper::getCoherencyTypeSupported(COHERENCY_TYPE coheren return GfxFamily::RENDER_SURFACE_STATE::COHERENCY_TYPE_GPU_COHERENT; } -template -inline bool UnitTestHelper::getPipeControlHdcPipelineFlush(const typename GfxFamily::PIPE_CONTROL &pipeControl) { - return pipeControl.getHdcPipelineFlush(); -} -template -inline void UnitTestHelper::setPipeControlHdcPipelineFlush(typename GfxFamily::PIPE_CONTROL &pipeControl, bool hdcPipelineFlush) { - pipeControl.setHdcPipelineFlush(hdcPipelineFlush); -} - template inline void UnitTestHelper::adjustKernelDescriptorForImplicitArgs(KernelDescriptor &kernelDescriptor) { kernelDescriptor.kernelAttributes.flags.requiresImplicitArgs = true; @@ -105,22 +114,6 @@ inline bool UnitTestHelper::getWorkloadPartitionForStoreRegisterMemCm return storeRegisterMem.getWorkloadPartitionIdOffsetEnable(); } -template -GenCmdList::iterator UnitTestHelper::findMidThreadPreemptionAllocationCommand(GenCmdList::iterator begin, GenCmdList::iterator end) { - return end; -} - -template -std::vector UnitTestHelper::findAllMidThreadPreemptionAllocationCommand(GenCmdList::iterator begin, GenCmdList::iterator end) { - std::vector emptyList; - return emptyList; -} - -template -bool UnitTestHelper::getSystolicFlagValueFromPipelineSelectCommand(const typename GfxFamily::PIPELINE_SELECT &pipelineSelectCmd) { - return pipelineSelectCmd.getSystolicModeEnable(); -} - template size_t UnitTestHelper::getAdditionalDshSize(uint32_t iddCount) { return 0; diff --git a/shared/test/common/libult/CMakeLists.txt b/shared/test/common/libult/CMakeLists.txt index f1bdb71e7d..6429a1a85a 100644 --- a/shared/test/common/libult/CMakeLists.txt +++ b/shared/test/common/libult/CMakeLists.txt @@ -137,6 +137,18 @@ if(TESTS_XEHP_AND_LATER) ) endif() +if(TESTS_XE_HPG_CORE OR TESTS_XE_HPC_CORE) + list(APPEND neo_libult_common_SRCS_LIB_ULT + ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/unit_test_helper_xe_hpg_and_xe_hpc.inl + ) +endif() + +if(TESTS_PVC_AND_LATER) + list(APPEND neo_libult_common_SRCS_LIB_ULT + ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/unit_test_helper_xe_hpc_and_later.inl + ) +endif() + set_property(GLOBAL PROPERTY neo_libult_common_SRCS_LIB_ULT ${neo_libult_common_SRCS_LIB_ULT}) set_property(GLOBAL PROPERTY neo_libult_common_SRCS_ENABLE_TESTED_HW ${neo_libult_common_SRCS_ENABLE_TESTED_HW}) diff --git a/shared/test/common/xe_hpc_core/unit_test_helper_xe_hpc_core.cpp b/shared/test/common/xe_hpc_core/unit_test_helper_xe_hpc_core.cpp index 365669cc24..a549de9914 100644 --- a/shared/test/common/xe_hpc_core/unit_test_helper_xe_hpc_core.cpp +++ b/shared/test/common/xe_hpc_core/unit_test_helper_xe_hpc_core.cpp @@ -11,6 +11,8 @@ #include "shared/source/xe_hpc_core/hw_info.h" #include "shared/test/common/helpers/unit_test_helper.h" #include "shared/test/common/helpers/unit_test_helper.inl" +#include "shared/test/common/helpers/unit_test_helper_xe_hpc_and_later.inl" +#include "shared/test/common/helpers/unit_test_helper_xe_hpg_and_xe_hpc.inl" #include "shared/test/common/helpers/unit_test_helper_xehp_and_later.inl" using Family = NEO::XeHpcCoreFamily; @@ -19,42 +21,11 @@ using Family = NEO::XeHpcCoreFamily; namespace NEO { -template <> -const AuxTranslationMode UnitTestHelper::requiredAuxTranslationMode = AuxTranslationMode::Blit; - -template <> -uint64_t UnitTestHelper::getAtomicMemoryAddress(const Family::MI_ATOMIC &atomic) { - return atomic.getMemoryAddress(); -} - -template <> -const uint32_t UnitTestHelper::smallestTestableSimdSize = 16; - -template <> -uint32_t UnitTestHelper::getAppropriateThreadArbitrationPolicy(int32_t policy) { - using STATE_COMPUTE_MODE = typename Family::STATE_COMPUTE_MODE; - switch (policy) { - case ThreadArbitrationPolicy::RoundRobin: - return STATE_COMPUTE_MODE::EU_THREAD_SCHEDULING_MODE_OVERRIDE::EU_THREAD_SCHEDULING_MODE_OVERRIDE_ROUND_ROBIN; - case ThreadArbitrationPolicy::AgeBased: - return STATE_COMPUTE_MODE::EU_THREAD_SCHEDULING_MODE_OVERRIDE::EU_THREAD_SCHEDULING_MODE_OVERRIDE_OLDEST_FIRST; - case ThreadArbitrationPolicy::RoundRobinAfterDependency: - return STATE_COMPUTE_MODE::EU_THREAD_SCHEDULING_MODE_OVERRIDE::EU_THREAD_SCHEDULING_MODE_OVERRIDE_STALL_BASED_ROUND_ROBIN; - default: - return STATE_COMPUTE_MODE::EU_THREAD_SCHEDULING_MODE_OVERRIDE::EU_THREAD_SCHEDULING_MODE_OVERRIDE_HW_DEFAULT; - } -} - template <> bool UnitTestHelper::requiresTimestampPacketsInSystemMemory(HardwareInfo &hwInfo) { return false; } -template <> -bool UnitTestHelper::isAdditionalSynchronizationRequired() { - return true; -} - template <> bool UnitTestHelper::isAdditionalMiSemaphoreWaitRequired(const RootDeviceEnvironment &rootDeviceEnvironment) { const auto &productHelper = rootDeviceEnvironment.getHelper(); @@ -66,29 +37,6 @@ bool UnitTestHelper::isAdditionalMiSemaphoreWaitRequired(const RootDevic return !programGlobalFenceAsMiMemFenceCommandInCommandStream; } -template <> -const bool UnitTestHelper::additionalMiFlushDwRequired = false; - -template <> -uint32_t UnitTestHelper::getDebugModeRegisterOffset() { - return 0x20d8; -} - -template <> -uint32_t UnitTestHelper::getDebugModeRegisterValue() { - return (1u << 5) | (1u << 21); -} - -template <> -uint32_t UnitTestHelper::getTdCtlRegisterOffset() { - return 0xe400; -} - -template <> -uint32_t UnitTestHelper::getTdCtlRegisterValue() { - return (1u << 7) | (1u << 4) | (1u << 2) | (1u << 0); -} - template <> bool UnitTestHelper::getComputeDispatchAllWalkerFromFrontEndCommand(const typename Family::VFE_STATE_TYPE &feCmd) { return feCmd.getComputeDispatchAllWalkerEnable(); diff --git a/shared/test/common/xe_hpg_core/unit_test_helper_xe_hpg_core.cpp b/shared/test/common/xe_hpg_core/unit_test_helper_xe_hpg_core.cpp index 201143aef0..35365c07c0 100644 --- a/shared/test/common/xe_hpg_core/unit_test_helper_xe_hpg_core.cpp +++ b/shared/test/common/xe_hpg_core/unit_test_helper_xe_hpg_core.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -9,40 +9,45 @@ #include "shared/source/xe_hpg_core/hw_info.h" #include "shared/test/common/helpers/unit_test_helper.h" #include "shared/test/common/helpers/unit_test_helper.inl" +#include "shared/test/common/helpers/unit_test_helper_xe_hpg_and_xe_hpc.inl" #include "shared/test/common/helpers/unit_test_helper_xehp_and_later.inl" + using Family = NEO::XeHpgCoreFamily; namespace NEO { + template <> -const AuxTranslationMode UnitTestHelper::requiredAuxTranslationMode = AuxTranslationMode::Blit; +uint64_t UnitTestHelper::getAtomicMemoryAddress(const typename Family::MI_ATOMIC &atomic) { + return atomic.getMemoryAddress() | ((static_cast(atomic.getMemoryAddressHigh())) << 32); +} + +template <> +uint32_t UnitTestHelper::getAppropriateThreadArbitrationPolicy(int32_t policy) { + return static_cast(policy); +} template <> const bool UnitTestHelper::additionalMiFlushDwRequired = true; -template <> -uint32_t UnitTestHelper::getDebugModeRegisterOffset() { - return 0x20d8; -} - -template <> -uint32_t UnitTestHelper::getDebugModeRegisterValue() { - return (1u << 5) | (1u << 21); -} - -template <> -uint32_t UnitTestHelper::getTdCtlRegisterOffset() { - return 0xe400; -} - -template <> -uint32_t UnitTestHelper::getTdCtlRegisterValue() { - return (1u << 7) | (1u << 4) | (1u << 2) | (1u << 0); -} - template <> bool UnitTestHelper::getDisableFusionStateFromFrontEndCommand(const typename Family::VFE_STATE_TYPE &feCmd) { return feCmd.getFusedEuDispatch(); } +template <> +bool UnitTestHelper::isAdditionalMiSemaphoreWaitRequired(const RootDeviceEnvironment &rootDeviceEnvironment) { + return false; +} + +template <> +bool UnitTestHelper::isAdditionalSynchronizationRequired() { + return false; +} + +template <> +bool UnitTestHelper::requiresTimestampPacketsInSystemMemory(HardwareInfo &hwInfo) { + return true; +} + template struct UnitTestHelper; } // namespace NEO