/* * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "shared/source/device/device_info.h" #include "shared/source/helpers/hw_info.h" #include "shared/test/common/cmd_parse/gen_cmd_parse.h" #include "shared/test/common/cmd_parse/hw_parse.h" #include "gtest/gtest.h" namespace NEO { template bool UnitTestHelper::isPageTableManagerSupported(const HardwareInfo &hwInfo) { return false; } template inline uint32_t UnitTestHelper::getAppropriateThreadArbitrationPolicy(int32_t policy) { return static_cast(policy); } template bool UnitTestHelper::isPipeControlWArequired(const HardwareInfo &hwInfo) { 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 bool UnitTestHelper::tiledImagesSupported = true; template const uint32_t UnitTestHelper::smallestTestableSimdSize = 8; template const AuxTranslationMode UnitTestHelper::requiredAuxTranslationMode = AuxTranslationMode::Builtin; template const bool UnitTestHelper::useFullRowForLocalIdsGeneration = false; template const bool UnitTestHelper::additionalMiFlushDwRequired = false; template inline uint64_t UnitTestHelper::getPipeControlPostSyncAddress(const typename GfxFamily::PIPE_CONTROL &pipeControl) { uint64_t gpuAddress = pipeControl.getAddress(); uint64_t gpuAddressHigh = pipeControl.getAddressHigh(); 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; HardwareParse hwParse; hwParse.parseCommands(csr.getCS(0), 0); auto itorCmd = reverseFind(hwParse.cmdList.rbegin(), hwParse.cmdList.rend()); EXPECT_NE(hwParse.cmdList.rend(), itorCmd); auto sba = genCmdCast(*itorCmd); EXPECT_NE(nullptr, sba); auto mocs = sba->getStatelessDataPortAccessMemoryObjectControlState(); EXPECT_EQ(expectedMocs, mocs); } template bool UnitTestHelper::getDisableFusionStateFromFrontEndCommand(const typename GfxFamily::VFE_STATE_TYPE &feCmd) { return false; } template bool UnitTestHelper::getComputeDispatchAllWalkerFromFrontEndCommand(const typename GfxFamily::VFE_STATE_TYPE &feCmd) { return false; } template bool UnitTestHelper::expectNullDsh(const DeviceInfo &deviceInfo) { if constexpr (GfxFamily::supportsSampler) { return !deviceInfo.imageSupport; } return true; } } // namespace NEO