/* * Copyright (C) 2021-2025 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "shared/source/aub_mem_dump/aub_mem_dump.h" #include "shared/source/helpers/cache_policy.h" #include "shared/source/helpers/constants.h" #include "shared/source/helpers/hw_info.h" #include "shared/source/helpers/hw_mapper.h" #include "shared/source/helpers/local_memory_access_modes.h" #include "shared/source/os_interface/product_helper.h" #include "shared/source/os_interface/product_helper_hw.h" #include "shared/source/release_helper/release_helper.h" namespace NEO { template <> void ProductHelperHw::adjustSamplerState(void *sampler, const HardwareInfo &hwInfo) const { } template <> uint32_t ProductHelperHw::getMaxThreadsForWorkgroupInDSSOrSS(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice, uint32_t maxNumEUsPerDualSubSlice) const { return 0; } template <> uint32_t ProductHelperHw::getMaxThreadsForWorkgroup(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice) const { return 0; } template <> void ProductHelperHw::setForceNonCoherent(void *const commandPtr, const StateComputeModeProperties &properties) const { } template <> void ProductHelperHw::adjustPlatformForProductFamily(HardwareInfo *hwInfo) { } template <> uint64_t ProductHelperHw::getHostMemCapabilities(const HardwareInfo *hwInfo) const { return 0; } template <> uint64_t ProductHelperHw::getDeviceMemCapabilities() const { return 0; } template <> uint64_t ProductHelperHw::getSingleDeviceSharedMemCapabilities(bool) const { return 0; } template <> uint64_t ProductHelperHw::getCrossDeviceSharedMemCapabilities() const { return 0; } template <> bool ProductHelperHw::useGemCreateExtInAllocateMemoryByKMD() const { return false; } template <> uint64_t ProductHelperHw::getSharedSystemMemCapabilities(const HardwareInfo *hwInfo) const { return 0; } template <> bool ProductHelperHw::overrideGfxPartitionLayoutForWsl() const { return false; } template <> uint32_t ProductHelperHw::getDeviceMemoryMaxClkRate(const HardwareInfo &hwInfo, const OSInterface *osIface, uint32_t subDeviceIndex) const { return 0; } template <> uint64_t ProductHelperHw::getDeviceMemoryPhysicalSizeInBytes(const OSInterface *osIface, uint32_t subDeviceIndex) const { return 0; } template <> uint64_t ProductHelperHw::getDeviceMemoryMaxBandWidthInBytesPerSecond(const HardwareInfo &hwInfo, const OSInterface *osIface, uint32_t subDeviceIndex) const { return 0; } template <> bool ProductHelperHw::isAdditionalStateBaseAddressWARequired(const HardwareInfo &hwInfo) const { return false; } template <> bool ProductHelperHw::isMaxThreadsForWorkgroupWARequired(const HardwareInfo &hwInfo) const { return false; } template <> bool ProductHelperHw::obtainBlitterPreference(const HardwareInfo &hwInfo) const { return false; } template <> bool ProductHelperHw::isBlitterFullySupported(const HardwareInfo &hwInfo) const { return false; } template <> bool ProductHelperHw::isPageTableManagerSupported(const HardwareInfo &hwInfo) const { return false; } template <> uint32_t ProductHelperHw::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const { return CommonConstants::invalidStepping; } template <> uint32_t ProductHelperHw::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const { return CommonConstants::invalidStepping; } template <> uint32_t ProductHelperHw::getAubStreamSteppingFromHwRevId(const HardwareInfo &hwInfo) const { switch (getSteppingFromHwRevId(hwInfo)) { default: case REVISION_A0: case REVISION_A1: case REVISION_A3: return AubMemDump::SteppingValues::A; case REVISION_B: return AubMemDump::SteppingValues::B; case REVISION_C: return AubMemDump::SteppingValues::C; case REVISION_D: return AubMemDump::SteppingValues::D; case REVISION_K: return AubMemDump::SteppingValues::K; } } template <> bool ProductHelperHw::isDefaultEngineTypeAdjustmentRequired(const HardwareInfo &hwInfo) const { return false; } template <> bool ProductHelperHw::isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const { return false; } template <> bool ProductHelperHw::allowCompression(const HardwareInfo &hwInfo) const { return false; } template <> bool ProductHelperHw::isDirectSubmissionSupported(ReleaseHelper *releaseHelper) const { return false; } template <> bool ProductHelperHw::isDirectSubmissionConstantCacheInvalidationNeeded(const HardwareInfo &hwInfo) const { return false; } template <> LocalMemoryAccessMode ProductHelperHw::getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const { return LocalMemoryAccessMode::defaultMode; } template <> LocalMemoryAccessMode ProductHelperHw::getLocalMemoryAccessMode(const HardwareInfo &hwInfo) const { return LocalMemoryAccessMode::defaultMode; } template <> std::vector ProductHelperHw::getKernelSupportedThreadArbitrationPolicies() const { return {}; } template <> bool ProductHelperHw::isNewResidencyModelSupported() const { return false; } template <> bool ProductHelperHw::deferMOCSToPatIndex() const { return false; } template <> std::pair ProductHelperHw::isPipeControlPriorToNonPipelinedStateCommandsWARequired(const HardwareInfo &hwInfo, bool isRcs, const ReleaseHelper *releaseHelper) const { return {false, false}; } template <> bool ProductHelperHw::heapInLocalMem(const HardwareInfo &hwInfo) const { return false; } template <> void ProductHelperHw::setCapabilityCoherencyFlag(const HardwareInfo &hwInfo, bool &coherencyFlag) const { } template <> bool ProductHelperHw::isInitBuiltinAsyncSupported(const HardwareInfo &hwInfo) const { return false; } template <> bool ProductHelperHw::isCopyBufferRectSplitSupported() const { return false; } template <> bool ProductHelperHw::isAdditionalMediaSamplerProgrammingRequired() const { return false; } template <> bool ProductHelperHw::isInitialFlagsProgrammingRequired() const { return false; } template <> bool ProductHelperHw::isReturnedCmdSizeForMediaSamplerAdjustmentRequired() const { return false; } template <> bool ProductHelperHw::pipeControlWARequired(const HardwareInfo &hwInfo) const { return false; } template <> bool ProductHelperHw::imagePitchAlignmentWARequired(const HardwareInfo &hwInfo) const { return false; } template <> bool ProductHelperHw::isForceEmuInt32DivRemSPWARequired(const HardwareInfo &hwInfo) const { return false; } template <> bool ProductHelperHw::is3DPipelineSelectWARequired() const { return false; } template <> bool ProductHelperHw::isStorageInfoAdjustmentRequired() const { return false; } template <> bool ProductHelperHw::isBlitterForImagesSupported() const { return false; } template <> bool ProductHelperHw::isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const { return false; } template <> bool ProductHelperHw::isDcFlushAllowed() const { return true; } template <> bool ProductHelperHw::isDcFlushMitigated() const { return false; } template <> bool ProductHelperHw::mitigateDcFlush() const { return false; } template <> bool ProductHelperHw::overridePatToUCAndTwoWayCohForDcFlushMitigation(AllocationType allocationType) const { return false; } template <> bool ProductHelperHw::overrideUsageForDcFlushMitigation(AllocationType allocationType) const { return false; } template <> bool ProductHelperHw::overridePatToUCAndOneWayCohForDcFlushMitigation(AllocationType allocationType) const { return false; } template <> bool ProductHelperHw::overrideCacheableForDcFlushMitigation(AllocationType allocationType) const { return false; } template <> uint32_t ProductHelperHw::computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const { return hwInfo.gtSystemInfo.MaxSubSlicesSupported; } template <> bool ProductHelperHw::getUuid(NEO::DriverModel *driverModel, const uint32_t subDeviceCount, const uint32_t deviceIndex, std::array &uuid) const { return false; } template <> bool ProductHelperHw::isFlushTaskAllowed() const { return false; } template <> bool ProductHelperHw::isCopyEngineSelectorEnabled(const HardwareInfo &hwInfo) const { return true; } template <> bool ProductHelperHw::isGlobalFenceInCommandStreamRequired(const HardwareInfo &hwInfo) const { return false; } template <> uint32_t ProductHelperHw::getThreadEuRatioForScratch(const HardwareInfo &hwInfo) const { return 8u; } template <> bool ProductHelperHw::isIpSamplingSupported(const HardwareInfo &hwInfo) const { return false; } template <> bool ProductHelperHw::isVmBindPatIndexProgrammingSupported() const { return false; } template <> void ProductHelperHw::updateScmCommand(void *const commandPtr, const StateComputeModeProperties &properties) const { } template <> void ProductHelperHw::enableCompression(HardwareInfo *hwInfo) const { } template <> bool ProductHelperHw::isCooperativeEngineSupported(const HardwareInfo &hwInfo) const { return false; } template <> bool ProductHelperHw::isTimestampWaitSupportedForEvents() const { return false; } template <> uint32_t ProductHelperHw::getInternalHeapsPreallocated() const { return 0u; } template <> uint64_t ProductHelperHw::getHostMemCapabilitiesValue() const { return 0; } template <> bool ProductHelperHw::isEvictionIfNecessaryFlagSupported() const { return true; } template <> const char *L1CachePolicyHelper::getCachingPolicyOptions(bool isDebuggerActive) { return nullptr; } template <> uint32_t L1CachePolicyHelper::getDefaultL1CachePolicy(bool isDebuggerActive) { return 0u; } template <> bool ProductHelperHw::isPrefetcherDisablingInDirectSubmissionRequired() const { return true; } template <> uint32_t ProductHelperHw::getMaxNumSamplers() const { return 0u; } template <> uint32_t ProductHelperHw::getCommandBuffersPreallocatedPerCommandQueue() const { return 0u; } template <> uint32_t L1CachePolicyHelper::getL1CachePolicy(bool isDebuggerActive) { return L1CachePolicyHelper::getDefaultL1CachePolicy(isDebuggerActive); } template <> uint32_t L1CachePolicyHelper::getUncachedL1CachePolicy() { return 1u; } template <> std::vector ProductHelperHw::getSupportedNumGrfs(const ReleaseHelper *releaseHelper) const { if (releaseHelper) { return releaseHelper->getSupportedNumGrfs(); } return {}; } template <> bool ProductHelperHw::isBufferPoolAllocatorSupported() const { return false; } template <> bool ProductHelperHw::isHostUsmPoolAllocatorSupported() const { return false; } template <> bool ProductHelperHw::isDeviceUsmPoolAllocatorSupported() const { return false; } template <> bool ProductHelperHw::isDeviceUsmAllocationReuseSupported() const { return false; } template <> bool ProductHelperHw::isHostUsmAllocationReuseSupported() const { return false; } template <> bool ProductHelperHw::useLocalPreferredForCacheableBuffers() const { return false; } template <> std::optional ProductHelperHw::isCoherentAllocation(uint64_t patIndex) const { return std::nullopt; } struct UnknownProduct { struct FrontEndStateSupport { static constexpr bool scratchSize = false; static constexpr bool privateScratchSize = false; static constexpr bool computeDispatchAllWalker = false; static constexpr bool disableEuFusion = false; static constexpr bool disableOverdispatch = false; static constexpr bool singleSliceDispatchCcsMode = false; }; struct StateComputeModeStateSupport { static constexpr bool threadArbitrationPolicy = false; static constexpr bool coherencyRequired = false; static constexpr bool largeGrfMode = false; static constexpr bool zPassAsyncComputeThreadLimit = false; static constexpr bool pixelAsyncComputeThreadLimit = false; static constexpr bool devicePreemptionMode = false; }; struct StateBaseAddressStateSupport { static constexpr bool bindingTablePoolBaseAddress = false; }; struct PipelineSelectStateSupport { static constexpr bool mediaSamplerDopClockGate = false; static constexpr bool systolicMode = false; }; struct PreemptionDebugSupport { static constexpr bool preemptionMode = false; static constexpr bool stateSip = false; static constexpr bool csrSurface = false; }; static const uint32_t threadsPerEu = 8; }; template <> struct HwMapper { enum { gfxFamily = IGFX_UNKNOWN_CORE }; static const char *abbreviation; using GfxProduct = UnknownProduct; }; template <> uint32_t ProductHelperHw::getCacheLineSize() const { return 0x40; } template <> bool ProductHelperHw::is48bResourceNeededForRayTracing() const { return true; } } // namespace NEO #include "shared/source/os_interface/product_helper.inl" template class NEO::ProductHelperHw; template struct NEO::L1CachePolicyHelper;