2018-05-08 19:51:31 +08:00
|
|
|
/*
|
2023-01-26 21:39:28 +08:00
|
|
|
* Copyright (C) 2018-2023 Intel Corporation
|
2018-05-08 19:51:31 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-05-08 19:51:31 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/helpers/aux_translation.h"
|
2022-07-27 23:35:15 +08:00
|
|
|
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
|
2020-02-24 17:22:30 +08:00
|
|
|
|
2022-06-26 06:24:42 +08:00
|
|
|
#include <cstddef>
|
|
|
|
#include <vector>
|
2020-07-30 21:02:11 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2018-05-08 19:51:31 +08:00
|
|
|
|
2022-04-26 22:28:18 +08:00
|
|
|
class CommandStreamReceiver;
|
|
|
|
class LinearStream;
|
2023-01-26 22:33:36 +08:00
|
|
|
struct DeviceInfo;
|
2021-04-13 19:03:51 +08:00
|
|
|
struct KernelDescriptor;
|
2018-10-03 01:10:29 +08:00
|
|
|
struct HardwareInfo;
|
2023-01-26 21:39:28 +08:00
|
|
|
struct RootDeviceEnvironment;
|
2018-08-22 01:55:20 +08:00
|
|
|
|
2018-05-08 19:51:31 +08:00
|
|
|
template <typename GfxFamily>
|
2018-08-21 19:58:37 +08:00
|
|
|
struct UnitTestHelper {
|
2021-04-13 08:36:24 +08:00
|
|
|
using COHERENCY_TYPE = typename GfxFamily::RENDER_SURFACE_STATE::COHERENCY_TYPE;
|
|
|
|
|
2018-05-08 19:51:31 +08:00
|
|
|
static bool isL3ConfigProgrammable();
|
2018-08-22 01:55:20 +08:00
|
|
|
|
2021-04-13 19:03:51 +08:00
|
|
|
static bool evaluateDshUsage(size_t sizeBeforeEnqueue, size_t sizeAfterEnqueue, const KernelDescriptor *kernelDescriptor, uint32_t rootDeviceIndex);
|
2018-10-03 01:10:29 +08:00
|
|
|
|
|
|
|
static bool isPageTableManagerSupported(const HardwareInfo &hwInfo);
|
2018-10-18 19:40:53 +08:00
|
|
|
|
2018-11-14 22:29:10 +08:00
|
|
|
static bool isTimestampPacketWriteSupported();
|
2018-11-28 22:32:13 +08:00
|
|
|
|
|
|
|
static bool isExpectMemoryNotEqualSupported();
|
2019-01-04 00:52:08 +08:00
|
|
|
|
|
|
|
static uint32_t getDefaultSshUsage();
|
|
|
|
|
2022-03-08 01:00:26 +08:00
|
|
|
static uint32_t getAppropriateThreadArbitrationPolicy(int32_t policy);
|
2019-11-12 20:59:37 +08:00
|
|
|
|
2021-04-13 08:36:24 +08:00
|
|
|
static auto getCoherencyTypeSupported(COHERENCY_TYPE coherencyType) -> decltype(coherencyType);
|
|
|
|
|
2019-01-04 00:52:08 +08:00
|
|
|
static bool evaluateGshAddressForScratchSpace(uint64_t usedScratchGpuAddress, uint64_t retrievedGshAddress);
|
2019-08-14 15:33:51 +08:00
|
|
|
|
|
|
|
static bool isPipeControlWArequired(const HardwareInfo &hwInfo);
|
2019-08-29 16:42:17 +08:00
|
|
|
|
2020-12-01 02:32:05 +08:00
|
|
|
static bool isAdditionalSynchronizationRequired();
|
2020-04-25 17:09:57 +08:00
|
|
|
|
2023-01-26 21:39:28 +08:00
|
|
|
static bool isAdditionalMiSemaphoreWaitRequired(const RootDeviceEnvironment &rootDeviceEnvironment);
|
2020-02-05 03:26:04 +08:00
|
|
|
|
|
|
|
static bool isAdditionalMiSemaphoreWait(const typename GfxFamily::MI_SEMAPHORE_WAIT &semaphoreWait);
|
|
|
|
|
2021-06-09 18:00:13 +08:00
|
|
|
static uint64_t getAtomicMemoryAddress(const typename GfxFamily::MI_ATOMIC &atomic);
|
2019-09-06 16:25:14 +08:00
|
|
|
|
2021-10-26 15:42:53 +08:00
|
|
|
static bool requiresTimestampPacketsInSystemMemory(HardwareInfo &hwInfo);
|
2020-05-27 23:39:43 +08:00
|
|
|
|
2021-09-08 21:38:48 +08:00
|
|
|
static void setExtraMidThreadPreemptionFlag(HardwareInfo &hwInfo, bool value);
|
2021-09-08 00:07:23 +08:00
|
|
|
|
2021-09-24 00:46:42 +08:00
|
|
|
static uint32_t getDebugModeRegisterOffset();
|
|
|
|
static uint32_t getDebugModeRegisterValue();
|
|
|
|
static uint32_t getTdCtlRegisterOffset();
|
|
|
|
static uint32_t getTdCtlRegisterValue();
|
|
|
|
|
2023-04-27 22:13:51 +08:00
|
|
|
static uint32_t getMiLoadRegisterImmProgrammedCmdsCount(bool debuggingEnabled);
|
|
|
|
|
2019-10-01 14:35:02 +08:00
|
|
|
static const uint32_t smallestTestableSimdSize;
|
2019-11-22 16:50:10 +08:00
|
|
|
|
|
|
|
static const AuxTranslationMode requiredAuxTranslationMode;
|
2020-02-05 00:58:41 +08:00
|
|
|
|
|
|
|
static const bool useFullRowForLocalIdsGeneration;
|
2020-03-12 17:49:20 +08:00
|
|
|
|
|
|
|
static const bool additionalMiFlushDwRequired;
|
2021-11-09 00:50:31 +08:00
|
|
|
|
|
|
|
static uint64_t getPipeControlPostSyncAddress(const typename GfxFamily::PIPE_CONTROL &pipeControl);
|
2022-01-17 20:54:53 +08:00
|
|
|
static bool getPipeControlHdcPipelineFlush(const typename GfxFamily::PIPE_CONTROL &pipeControl);
|
|
|
|
static void setPipeControlHdcPipelineFlush(typename GfxFamily::PIPE_CONTROL &pipeControl, bool hdcPipelineFlush);
|
2022-02-23 21:27:24 +08:00
|
|
|
|
|
|
|
static void adjustKernelDescriptorForImplicitArgs(KernelDescriptor &kernelDescriptor);
|
2022-04-26 22:28:18 +08:00
|
|
|
|
|
|
|
static std::vector<bool> getProgrammedLargeGrfValues(CommandStreamReceiver &csr, LinearStream &linearStream);
|
2022-04-09 02:48:45 +08:00
|
|
|
|
2023-04-20 21:28:57 +08:00
|
|
|
static uint32_t getProgrammedGrfValue(CommandStreamReceiver &csr, LinearStream &linearStream);
|
|
|
|
|
2022-04-09 02:48:45 +08:00
|
|
|
static bool getWorkloadPartitionForStoreRegisterMemCmd(typename GfxFamily::MI_STORE_REGISTER_MEM &storeRegisterMem);
|
|
|
|
|
|
|
|
static bool timestampRegisterHighAddress();
|
2022-06-29 02:52:33 +08:00
|
|
|
|
|
|
|
static void validateSbaMocs(uint32_t expectedMocs, CommandStreamReceiver &csr);
|
2022-07-27 23:35:15 +08:00
|
|
|
|
|
|
|
static GenCmdList::iterator findMidThreadPreemptionAllocationCommand(GenCmdList::iterator begin, GenCmdList::iterator end);
|
|
|
|
|
|
|
|
static std::vector<GenCmdList::iterator> findAllMidThreadPreemptionAllocationCommand(GenCmdList::iterator begin, GenCmdList::iterator end);
|
2022-09-02 21:15:59 +08:00
|
|
|
|
|
|
|
static bool getDisableFusionStateFromFrontEndCommand(const typename GfxFamily::VFE_STATE_TYPE &feCmd);
|
|
|
|
static bool getComputeDispatchAllWalkerFromFrontEndCommand(const typename GfxFamily::VFE_STATE_TYPE &feCmd);
|
2022-09-19 21:09:56 +08:00
|
|
|
static bool getSystolicFlagValueFromPipelineSelectCommand(const typename GfxFamily::PIPELINE_SELECT &pipelineSelectCmd);
|
2023-02-03 02:57:24 +08:00
|
|
|
static size_t getAdditionalDshSize(uint32_t iddCount);
|
2023-01-26 22:33:36 +08:00
|
|
|
static bool expectNullDsh(const DeviceInfo &deviceInfo);
|
2023-03-28 05:37:18 +08:00
|
|
|
|
|
|
|
static bool findStateCacheFlushPipeControl(LinearStream &csrStream);
|
2018-05-08 19:51:31 +08:00
|
|
|
};
|
2020-02-05 03:26:04 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|