feature: add support for release helper 30.0/30.1

Related-To: NEO-12803

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2024-11-13 08:02:07 +00:00
committed by Compute-Runtime-Automation
parent 9c110b7c81
commit 608c1d30c5
16 changed files with 8518 additions and 2 deletions

View File

@@ -549,6 +549,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, OverrideHostAllocationMemPolicyMode, -1, "Overri
DECLARE_DEBUG_VARIABLE(int32_t, EnableFtrTile64Optimization, 0, "Control feature Tile64 Optimization flag passed to gmmlib. -1: pass as-is, 0: disable flag(default due to NEO-10623), 1: enable flag");
DECLARE_DEBUG_VARIABLE(int32_t, ForceTheMaximumNumberOfOutstandingRayqueriesPerSs, -1, "Set the maximum number of outstanding RayQueries per SS, -1: default, 0: 128, 1: 256, 2: 512, 3: 1024")
DECLARE_DEBUG_VARIABLE(int32_t, ForceDispatchTimeoutCounter, -1, "Set timeout for Synchronous Ray Tracing, -1: default, 0: 64, 1: 128, 2: 192, 3: 256, 4: 512, 5: 1024, 6: 2048, 7: 4096")
DECLARE_DEBUG_VARIABLE(int32_t, Enable10ThreadsPerEu, -1, "Enable 10 threads per EU HSD-18022695913, -1: default, 0: disabled, 1: enabled")
/* IMPLICIT SCALING */
DECLARE_DEBUG_VARIABLE(int32_t, EnableWalkerPartition, -1, "-1: default, 0: disable, 1: enable, Enables Walker Partitioning via WPARID.")

File diff suppressed because it is too large Load Diff

View File

@@ -24,11 +24,18 @@ set(NEO_CORE_RELEASE_HELPER
${CMAKE_CURRENT_SOURCE_DIR}/release_helper_1274.cpp
${CMAKE_CURRENT_SOURCE_DIR}/release_helper_2001.cpp
${CMAKE_CURRENT_SOURCE_DIR}/release_helper_2004.cpp
${CMAKE_CURRENT_SOURCE_DIR}/release_helper_3000.cpp
${CMAKE_CURRENT_SOURCE_DIR}/release_helper_3001.cpp
${CMAKE_CURRENT_SOURCE_DIR}/release_helper_common_xe2_hpg.inl
${CMAKE_CURRENT_SOURCE_DIR}/release_helper_common_xe3_and_later.inl
${CMAKE_CURRENT_SOURCE_DIR}/release_helper_common_xe3_lpg.inl
)
set_property(GLOBAL APPEND PROPERTY NEO_CORE_ENABLE_RELEASE_HELPER ${CMAKE_CURRENT_SOURCE_DIR}/enable_release_helper_xe.cpp)
set_property(GLOBAL APPEND PROPERTY NEO_CORE_ENABLE_RELEASE_HELPER ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}enable_release_helper_xe2.cpp)
set_property(GLOBAL APPEND PROPERTY NEO_CORE_ENABLE_RELEASE_HELPER
${CMAKE_CURRENT_SOURCE_DIR}/enable_release_helper_xe.cpp
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}enable_release_helper_xe2.cpp
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}enable_release_helper_xe3.cpp
)
set_property(GLOBAL APPEND PROPERTY NEO_CORE_RELEASE_HELPER ${NEO_CORE_RELEASE_HELPER})
add_subdirectories()

View File

@@ -20,6 +20,8 @@ enum class ReleaseType {
release1274,
release2001,
release2004,
release3000,
release3001,
};
} // namespace NEO

View File

@@ -0,0 +1,22 @@
/*
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/release_helper/release_helper.h"
#include "release_definitions.h"
namespace NEO {
inline constexpr uint32_t maxReleaseXe3 = 2;
inline createReleaseHelperFunctionType releaseHelperFactoryXe3[maxReleaseXe3]{};
EnableReleaseHelperArchitecture<30> enableReleaseHelperArchitecture30(releaseHelperFactoryXe3);
EnableReleaseHelper<ReleaseType::release3000> enablerReleaseHelper3000{releaseHelperFactoryXe3[0]};
EnableReleaseHelper<ReleaseType::release3001> enablerReleaseHelper3001{releaseHelperFactoryXe3[1]};
} // namespace NEO

View File

@@ -0,0 +1,59 @@
/*
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/release_helper/release_helper.h"
#include "shared/source/release_helper/release_helper_base.inl"
#include "platforms.h"
#include "release_definitions.h"
namespace NEO {
constexpr auto release = ReleaseType::release3000;
template <>
bool ReleaseHelperHw<release>::isBFloat16ConversionSupported() const {
return true;
}
template <>
bool ReleaseHelperHw<release>::shouldAdjustDepth() const {
return true;
}
template <>
std::vector<uint32_t> ReleaseHelperHw<release>::getSupportedNumGrfs() const {
return {32u, 64u, 96u, 128u, 160u, 192u, 256u};
}
template <>
uint32_t ReleaseHelperHw<release>::getNumThreadsPerEu() const {
if (debugManager.flags.Enable10ThreadsPerEu.get() == 0) {
return 8u;
}
return 10;
}
template <>
bool ReleaseHelperHw<release>::isLocalOnlyAllowed() const {
return false;
}
template <>
bool ReleaseHelperHw<release>::isDisablingMsaaRequired() const {
return (hardwareIpVersion.value == AOT::PTL_H_A0);
}
template <>
uint32_t ReleaseHelperHw<release>::getStackSizePerRay() const {
return 64u;
}
} // namespace NEO
#include "shared/source/release_helper/release_helper_common_xe3_and_later.inl"
#include "shared/source/release_helper/release_helper_common_xe3_lpg.inl"
template class NEO::ReleaseHelperHw<NEO::release>;

View File

@@ -0,0 +1,53 @@
/*
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/release_helper/release_helper.h"
#include "shared/source/release_helper/release_helper_base.inl"
#include "platforms.h"
#include "release_definitions.h"
namespace NEO {
constexpr auto release = ReleaseType::release3001;
template <>
bool ReleaseHelperHw<release>::isBFloat16ConversionSupported() const {
return true;
}
template <>
bool ReleaseHelperHw<release>::shouldAdjustDepth() const {
return true;
}
template <>
std::vector<uint32_t> ReleaseHelperHw<release>::getSupportedNumGrfs() const {
return {32u, 64u, 96u, 128u, 160u, 192u, 256u};
}
template <>
uint32_t ReleaseHelperHw<release>::getNumThreadsPerEu() const {
if (debugManager.flags.Enable10ThreadsPerEu.get() == 0) {
return 8u;
}
return 10;
}
template <>
bool ReleaseHelperHw<release>::isLocalOnlyAllowed() const {
return false;
}
template <>
bool ReleaseHelperHw<release>::isDisablingMsaaRequired() const {
return (hardwareIpVersion.value == AOT::PTL_U_A0);
}
} // namespace NEO
#include "shared/source/release_helper/release_helper_common_xe3_and_later.inl"
#include "shared/source/release_helper/release_helper_common_xe3_lpg.inl"
template class NEO::ReleaseHelperHw<NEO::release>;

View File

@@ -0,0 +1,25 @@
/*
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/release_helper/release_helper.h"
namespace NEO {
template <>
const ThreadsPerEUConfigs ReleaseHelperHw<release>::getThreadsPerEUConfigs(uint32_t numThreadsPerEu) const {
if (numThreadsPerEu == 8u) {
return {4, 8};
}
return {4, 5, 6, 8, 10};
}
template <>
bool ReleaseHelperHw<release>::isRcsExposureDisabled() const {
return true;
}
} // namespace NEO

View File

@@ -0,0 +1,36 @@
/*
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/helpers/string.h"
#include "shared/source/release_helper/release_helper.h"
#include "shared/source/xe3_core/hw_cmds_base.h"
namespace NEO {
template <>
const std::string ReleaseHelperHw<release>::getDeviceConfigString(uint32_t tileCount, uint32_t sliceCount, uint32_t subSliceCount, uint32_t euPerSubSliceCount) const {
char configString[16] = {0};
auto err = snprintf_s(configString, sizeof(configString), sizeof(configString), "%utx%ux%ux%u", tileCount, sliceCount, subSliceCount, euPerSubSliceCount);
UNRECOVERABLE_IF(err < 0);
return configString;
}
template <>
const SizeToPreferredSlmValueArray &ReleaseHelperHw<release>::getSizeToPreferredSlmValue(bool isHeapless) const {
using PREFERRED_SLM_ALLOCATION_SIZE = typename Xe3CoreFamily::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE;
static const SizeToPreferredSlmValueArray sizeToPreferredSlmValue = {{
{0, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_0K},
{16 * MemoryConstants::kiloByte, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_16K},
{32 * MemoryConstants::kiloByte, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_32K},
{64 * MemoryConstants::kiloByte, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_64K},
{96 * MemoryConstants::kiloByte, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K},
{std::numeric_limits<uint32_t>::max(), PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K},
}};
return sizeToPreferredSlmValue;
}
} // namespace NEO

View File

@@ -0,0 +1,198 @@
/*
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/commands/bxml_generator_glue.h"
#include "shared/source/helpers/debug_helpers.h"
#include <cstdint>
#include <cstring>
#include <igfxfmid.h>
#include <type_traits>
#include <variant>
template <class T>
struct CmdParse;
namespace NEO {
struct Xe3Core {
#include "shared/source/generated/xe3_core/hw_cmds_generated_xe3_core.inl"
static constexpr uint32_t stateComputeModeEnableVariableRegisterSizeAllocationMask = (1u << 10);
static constexpr uint32_t stateComputeModeEuThreadSchedulingModeOverrideMask = (0b11u << 13);
static constexpr uint32_t stateComputeModeLargeGrfModeMask = (1u << 15);
// DW2
static constexpr uint32_t stateComputeModeEnableOutOfBoundariesInTranslationExceptionMask = (1u << 7);
static constexpr uint32_t stateComputeModeMemoryAllocationForScratchAndMidthreadPreemptionBuffersMask = (1u << 11);
static constexpr uint32_t bcsEngineCount = 9u;
static constexpr uint32_t timestampPacketCount = 16u;
static constexpr bool isUsingL3Control = false;
static constexpr bool isUsingMediaSamplerDopClockGate = false;
static constexpr bool supportsSampler = true;
static constexpr bool isUsingGenericMediaStateClear = false;
static constexpr bool isUsingMiMemFence = true;
static constexpr bool isUsingMiSetPredicate = true;
static constexpr bool isUsingMiMathMocs = true;
struct FrontEndStateSupport {
static constexpr bool scratchSize = true;
static constexpr bool privateScratchSize = true;
static constexpr bool computeDispatchAllWalker = false;
static constexpr bool disableEuFusion = false;
static constexpr bool disableOverdispatch = true;
static constexpr bool singleSliceDispatchCcsMode = true;
};
struct StateComputeModeStateSupport {
static constexpr bool threadArbitrationPolicy = true;
static constexpr bool coherencyRequired = true;
static constexpr bool largeGrfMode = true;
static constexpr bool zPassAsyncComputeThreadLimit = false;
static constexpr bool pixelAsyncComputeThreadLimit = false;
static constexpr bool devicePreemptionMode = false;
static constexpr bool allocationForScratchAndMidthreadPreemption = true;
static constexpr bool enableVariableRegisterSizeAllocation = true;
};
struct StateBaseAddressStateSupport {
static constexpr bool bindingTablePoolBaseAddress = true;
};
struct PipelineSelectStateSupport {
static constexpr bool mediaSamplerDopClockGate = false;
static constexpr bool systolicMode = false;
};
struct PreemptionDebugSupport {
static constexpr bool preemptionMode = false;
static constexpr bool stateSip = true;
static constexpr bool csrSurface = true;
};
struct DataPortBindlessSurfaceExtendedMessageDescriptor {
union {
struct {
uint32_t bindlessSurfaceOffset : 25;
uint32_t reserved : 6;
};
uint32_t packed;
};
DataPortBindlessSurfaceExtendedMessageDescriptor() {
packed = 0;
}
void setBindlessSurfaceOffset(uint32_t offsetInBindlessSurfaceHeapInBytes) {
bindlessSurfaceOffset = offsetInBindlessSurfaceHeapInBytes >> 6;
}
uint32_t getBindlessSurfaceOffsetToPatch() {
return bindlessSurfaceOffset << 6;
}
};
static constexpr uint32_t cacheLineSize = 0x100;
static_assert(sizeof(DataPortBindlessSurfaceExtendedMessageDescriptor) == sizeof(DataPortBindlessSurfaceExtendedMessageDescriptor::packed), "");
};
struct Xe3CoreFamily : public Xe3Core {
using Parse = CmdParse<Xe3CoreFamily>;
using GfxFamily = Xe3CoreFamily;
using DefaultWalkerType = COMPUTE_WALKER;
using FrontEndStateCommand = CFE_STATE;
using XY_BLOCK_COPY_BLT = typename GfxFamily::XY_BLOCK_COPY_BLT;
using XY_COPY_BLT = typename GfxFamily::MEM_COPY;
using XY_COLOR_BLT = typename GfxFamily::XY_FAST_COLOR_BLT;
using MI_STORE_REGISTER_MEM_CMD = typename GfxFamily::MI_STORE_REGISTER_MEM;
using TimestampPacketType = uint64_t;
static const COMPUTE_WALKER cmdInitGpgpuWalker;
static const CFE_STATE cmdInitCfeState;
static const INTERFACE_DESCRIPTOR_DATA cmdInitInterfaceDescriptorData;
static const MI_BATCH_BUFFER_END cmdInitBatchBufferEnd;
static const MI_BATCH_BUFFER_START cmdInitBatchBufferStart;
static const PIPE_CONTROL cmdInitPipeControl;
static const STATE_COMPUTE_MODE cmdInitStateComputeMode;
static const _3DSTATE_BINDING_TABLE_POOL_ALLOC cmdInitStateBindingTablePoolAlloc;
static const MI_SEMAPHORE_WAIT cmdInitMiSemaphoreWait;
static const RENDER_SURFACE_STATE cmdInitRenderSurfaceState;
static const POSTSYNC_DATA cmdInitPostSyncData;
static const MI_SET_PREDICATE cmdInitSetPredicate;
static const MI_LOAD_REGISTER_IMM cmdInitLoadRegisterImm;
static const MI_LOAD_REGISTER_REG cmdInitLoadRegisterReg;
static const MI_LOAD_REGISTER_MEM cmdInitLoadRegisterMem;
static const MI_STORE_DATA_IMM cmdInitStoreDataImm;
static const MI_STORE_REGISTER_MEM cmdInitStoreRegisterMem;
static const MI_NOOP cmdInitNoop;
static const MI_REPORT_PERF_COUNT cmdInitReportPerfCount;
static const MI_ATOMIC cmdInitAtomic;
static const PIPELINE_SELECT cmdInitPipelineSelect;
static const MI_ARB_CHECK cmdInitArbCheck;
static const STATE_BASE_ADDRESS cmdInitStateBaseAddress;
static const MEDIA_SURFACE_STATE cmdInitMediaSurfaceState;
static const SAMPLER_STATE cmdInitSamplerState;
static const BINDING_TABLE_STATE cmdInitBindingTableState;
static const MI_USER_INTERRUPT cmdInitUserInterrupt;
static const MI_CONDITIONAL_BATCH_BUFFER_END cmdInitConditionalBatchBufferEnd;
static const MI_FLUSH_DW cmdInitMiFlushDw;
static const XY_BLOCK_COPY_BLT cmdInitXyBlockCopyBlt;
static const MEM_COPY cmdInitXyCopyBlt;
static const XY_FAST_COLOR_BLT cmdInitXyColorBlt;
static const STATE_PREFETCH cmdInitStatePrefetch;
static const _3DSTATE_BTD cmd3dStateBtd;
static const _3DSTATE_BTD_BODY cmd3dStateBtdBody;
static const MI_MEM_FENCE cmdInitMemFence;
static const MEM_SET cmdInitMemSet;
static const STATE_SIP cmdInitStateSip;
static const STATE_CONTEXT_DATA_BASE_ADDRESS cmdInitStateContextDataBaseAddress;
static const STATE_SYSTEM_MEM_FENCE_ADDRESS cmdInitStateSystemMemFenceAddress;
static constexpr bool isQwordInOrderCounter = false;
static constexpr bool walkerPostSyncSupport = true;
static constexpr size_t indirectDataAlignment = COMPUTE_WALKER::INDIRECTDATASTARTADDRESS_ALIGN_SIZE;
static constexpr bool supportsCmdSet(GFXCORE_FAMILY cmdSetBaseFamily) {
return cmdSetBaseFamily == IGFX_XE_HP_CORE;
}
template <typename WalkerType = DefaultWalkerType>
static constexpr size_t getInterfaceDescriptorSize() {
return sizeof(INTERFACE_DESCRIPTOR_DATA);
}
template <typename WalkerType = DefaultWalkerType>
static WalkerType getInitGpuWalker() {
return cmdInitGpgpuWalker;
}
template <typename InterfaceDescriptorType>
static InterfaceDescriptorType getInitInterfaceDescriptor() {
return cmdInitInterfaceDescriptorData;
}
template <typename WalkerType>
static constexpr bool isHeaplessMode() {
return false;
}
template <typename InterfaceDescriptorType>
static constexpr bool isInterfaceDescriptorHeaplessMode() {
return false;
}
using WalkerVariant = std::variant<COMPUTE_WALKER *>;
};
enum class MemoryCompressionState;
template <typename GfxFamily>
void setSbaStatelessCompressionParams(typename GfxFamily::STATE_BASE_ADDRESS *stateBaseAddress,
MemoryCompressionState memoryCompressionState);
template <>
void setSbaStatelessCompressionParams<Xe3CoreFamily>(typename Xe3CoreFamily::STATE_BASE_ADDRESS *stateBaseAddress,
MemoryCompressionState memoryCompressionState);
} // namespace NEO

View File

@@ -644,4 +644,5 @@ DebugUmdInterruptTimeout = -1
DebugUmdMaxReadWriteRetry = -1
DirectSubmissionControllerBcsTimeoutDivisor = -1
ForceZeroCopyForUseHostPtr = 0
Enable10ThreadsPerEu = -1
# Please don't edit below this line

View File

@@ -19,6 +19,8 @@ target_sources(neo_shared_tests PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/release_helper_12_74_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/release_helper_20_01_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/release_helper_20_04_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/release_helper_30_00_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/release_helper_30_01_tests.cpp
)
add_subdirectories()

View File

@@ -0,0 +1,104 @@
/*
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/release_helper/release_helper.h"
#include "shared/test/unit_test/release_helper/release_helper_tests_base.h"
#include "gtest/gtest.h"
struct ReleaseHelper3000Tests : public ReleaseHelperTests<30, 0> {
std::vector<uint32_t> getRevisions() override {
return {0, 4};
}
};
TEST_F(ReleaseHelper3000Tests, whenGettingCapabilitiesThenCorrectPropertiesAreReturned) {
for (auto &revision : getRevisions()) {
ipVersion.revision = revision;
releaseHelper = ReleaseHelper::create(ipVersion);
ASSERT_NE(nullptr, releaseHelper);
EXPECT_FALSE(releaseHelper->isAdjustWalkOrderAvailable());
EXPECT_TRUE(releaseHelper->isMatrixMultiplyAccumulateSupported());
EXPECT_TRUE(releaseHelper->isDotProductAccumulateSystolicSupported());
EXPECT_FALSE(releaseHelper->isPipeControlPriorToNonPipelinedStateCommandsWARequired());
EXPECT_FALSE(releaseHelper->isPipeControlPriorToPipelineSelectWaRequired());
EXPECT_FALSE(releaseHelper->isProgramAllStateComputeCommandFieldsWARequired());
EXPECT_FALSE(releaseHelper->isSplitMatrixMultiplyAccumulateSupported());
EXPECT_TRUE(releaseHelper->isBFloat16ConversionSupported());
EXPECT_TRUE(releaseHelper->isResolvingSubDeviceIDNeeded());
EXPECT_FALSE(releaseHelper->isDirectSubmissionSupported());
EXPECT_TRUE(releaseHelper->isRcsExposureDisabled());
EXPECT_TRUE(releaseHelper->isBindlessAddressingDisabled());
EXPECT_EQ(10u, releaseHelper->getNumThreadsPerEu());
EXPECT_TRUE(releaseHelper->isRayTracingSupported());
EXPECT_EQ(64u, releaseHelper->getStackSizePerRay());
EXPECT_EQ(revision == 0, releaseHelper->isDisablingMsaaRequired());
}
}
TEST_F(ReleaseHelper3000Tests, whenShouldAdjustCalledThenTrueReturned) {
whenShouldAdjustCalledThenTrueReturned();
}
TEST_F(ReleaseHelper3000Tests, whenGettingSupportedNumGrfsThenCorrectValuesAreReturned) {
whenGettingSupportedNumGrfsThenValuesUpTo256Returned();
}
TEST_F(ReleaseHelper3000Tests, whenGettingNumThreadsPerEuThenCorrectValueIsReturnedBasedOnDebugKey) {
whenGettingNumThreadsPerEuThenCorrectValueIsReturnedBasedOnDebugKey();
}
TEST_F(ReleaseHelper3000Tests, whenGettingThreadsPerEuConfigsThenCorrectValueIsReturnedBasedOnNumThreadPerEu) {
whenGettingThreadsPerEuConfigsThenCorrectValueIsReturnedBasedOnNumThreadPerEu();
}
TEST_F(ReleaseHelper3000Tests, whenGettingTotalMemBankSizeThenReturn32GB) {
whenGettingTotalMemBankSizeThenReturn32GB();
}
TEST_F(ReleaseHelper3000Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenReturnNoCapabilities) {
whenGettingAdditionalFp16AtomicCapabilitiesThenReturnNoCapabilities();
}
TEST_F(ReleaseHelper3000Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
}
TEST_F(ReleaseHelper3000Tests, whenIsLocalOnlyAllowedCalledThenFalseReturned) {
whenIsLocalOnlyAllowedCalledThenFalseReturned();
}
TEST_F(ReleaseHelper3000Tests, whenGettingPreferredSlmSizeThenAllEntriesHaveCorrectValues) {
for (auto &revision : getRevisions()) {
ipVersion.revision = revision;
releaseHelper = ReleaseHelper::create(ipVersion);
ASSERT_NE(nullptr, releaseHelper);
constexpr uint32_t kB = 1024;
auto &preferredSlmValueArray = releaseHelper->getSizeToPreferredSlmValue(false);
EXPECT_EQ(0u, preferredSlmValueArray[0].upperLimit);
EXPECT_EQ(0u, preferredSlmValueArray[0].valueToProgram);
EXPECT_EQ(16 * kB, preferredSlmValueArray[1].upperLimit);
EXPECT_EQ(1u, preferredSlmValueArray[1].valueToProgram);
EXPECT_EQ(32 * kB, preferredSlmValueArray[2].upperLimit);
EXPECT_EQ(2u, preferredSlmValueArray[2].valueToProgram);
EXPECT_EQ(64 * kB, preferredSlmValueArray[3].upperLimit);
EXPECT_EQ(3u, preferredSlmValueArray[3].valueToProgram);
EXPECT_EQ(96 * kB, preferredSlmValueArray[4].upperLimit);
EXPECT_EQ(4u, preferredSlmValueArray[4].valueToProgram);
EXPECT_EQ(std::numeric_limits<uint32_t>::max(), preferredSlmValueArray[5].upperLimit);
EXPECT_EQ(5u, preferredSlmValueArray[5].valueToProgram);
}
}

View File

@@ -0,0 +1,104 @@
/*
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/release_helper/release_helper.h"
#include "shared/test/unit_test/release_helper/release_helper_tests_base.h"
#include "gtest/gtest.h"
struct ReleaseHelper3001Tests : public ReleaseHelperTests<30, 1> {
std::vector<uint32_t> getRevisions() override {
return {0, 1};
}
};
TEST_F(ReleaseHelper3001Tests, whenGettingCapabilitiesThenCorrectPropertiesAreReturned) {
for (auto &revision : getRevisions()) {
ipVersion.revision = revision;
releaseHelper = ReleaseHelper::create(ipVersion);
ASSERT_NE(nullptr, releaseHelper);
EXPECT_FALSE(releaseHelper->isAdjustWalkOrderAvailable());
EXPECT_TRUE(releaseHelper->isMatrixMultiplyAccumulateSupported());
EXPECT_TRUE(releaseHelper->isDotProductAccumulateSystolicSupported());
EXPECT_FALSE(releaseHelper->isPipeControlPriorToNonPipelinedStateCommandsWARequired());
EXPECT_FALSE(releaseHelper->isPipeControlPriorToPipelineSelectWaRequired());
EXPECT_FALSE(releaseHelper->isProgramAllStateComputeCommandFieldsWARequired());
EXPECT_FALSE(releaseHelper->isSplitMatrixMultiplyAccumulateSupported());
EXPECT_TRUE(releaseHelper->isBFloat16ConversionSupported());
EXPECT_TRUE(releaseHelper->isResolvingSubDeviceIDNeeded());
EXPECT_FALSE(releaseHelper->isDirectSubmissionSupported());
EXPECT_TRUE(releaseHelper->isRcsExposureDisabled());
EXPECT_TRUE(releaseHelper->isBindlessAddressingDisabled());
EXPECT_EQ(10u, releaseHelper->getNumThreadsPerEu());
EXPECT_TRUE(releaseHelper->isRayTracingSupported());
EXPECT_EQ(0u, releaseHelper->getStackSizePerRay());
EXPECT_EQ(revision == 0, releaseHelper->isDisablingMsaaRequired());
}
}
TEST_F(ReleaseHelper3001Tests, whenShouldAdjustCalledThenTrueReturned) {
whenShouldAdjustCalledThenTrueReturned();
}
TEST_F(ReleaseHelper3001Tests, whenGettingSupportedNumGrfsThenCorrectValuesAreReturned) {
whenGettingSupportedNumGrfsThenValuesUpTo256Returned();
}
TEST_F(ReleaseHelper3001Tests, whenGettingNumThreadsPerEuThenCorrectValueIsReturnedBasedOnDebugKey) {
whenGettingNumThreadsPerEuThenCorrectValueIsReturnedBasedOnDebugKey();
}
TEST_F(ReleaseHelper3001Tests, whenGettingThreadsPerEuConfigsThenCorrectValueIsReturnedBasedOnNumThreadPerEu) {
whenGettingThreadsPerEuConfigsThenCorrectValueIsReturnedBasedOnNumThreadPerEu();
}
TEST_F(ReleaseHelper3001Tests, whenGettingTotalMemBankSizeThenReturn32GB) {
whenGettingTotalMemBankSizeThenReturn32GB();
}
TEST_F(ReleaseHelper3001Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenReturnNoCapabilities) {
whenGettingAdditionalFp16AtomicCapabilitiesThenReturnNoCapabilities();
}
TEST_F(ReleaseHelper3001Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
}
TEST_F(ReleaseHelper3001Tests, whenIsLocalOnlyAllowedCalledThenFalseReturned) {
whenIsLocalOnlyAllowedCalledThenFalseReturned();
}
TEST_F(ReleaseHelper3001Tests, whenGettingPreferredSlmSizeThenAllEntriesHaveCorrectValues) {
for (auto &revision : getRevisions()) {
ipVersion.revision = revision;
releaseHelper = ReleaseHelper::create(ipVersion);
ASSERT_NE(nullptr, releaseHelper);
constexpr uint32_t kB = 1024;
auto &preferredSlmValueArray = releaseHelper->getSizeToPreferredSlmValue(false);
EXPECT_EQ(0u, preferredSlmValueArray[0].upperLimit);
EXPECT_EQ(0u, preferredSlmValueArray[0].valueToProgram);
EXPECT_EQ(16 * kB, preferredSlmValueArray[1].upperLimit);
EXPECT_EQ(1u, preferredSlmValueArray[1].valueToProgram);
EXPECT_EQ(32 * kB, preferredSlmValueArray[2].upperLimit);
EXPECT_EQ(2u, preferredSlmValueArray[2].valueToProgram);
EXPECT_EQ(64 * kB, preferredSlmValueArray[3].upperLimit);
EXPECT_EQ(3u, preferredSlmValueArray[3].valueToProgram);
EXPECT_EQ(96 * kB, preferredSlmValueArray[4].upperLimit);
EXPECT_EQ(4u, preferredSlmValueArray[4].valueToProgram);
EXPECT_EQ(std::numeric_limits<uint32_t>::max(), preferredSlmValueArray[5].upperLimit);
EXPECT_EQ(5u, preferredSlmValueArray[5].valueToProgram);
}
}

View File

@@ -10,6 +10,7 @@
#include "shared/source/helpers/constants.h"
#include "shared/source/memory_manager/allocation_type.h"
#include "shared/source/release_helper/release_helper.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "gtest/gtest.h"
@@ -122,3 +123,51 @@ void ReleaseHelperTestsBase::whenGettingPreferredSlmSizeThenAllEntriesEmpty() {
}
}
}
void ReleaseHelperTestsBase::whenGettingSupportedNumGrfsThenValuesUpTo256Returned() {
std::vector<uint32_t> expectedValues{32u, 64u, 96u, 128u, 160u, 192u, 256u};
for (auto &revision : getRevisions()) {
ipVersion.revision = revision;
releaseHelper = ReleaseHelper::create(ipVersion);
ASSERT_NE(nullptr, releaseHelper);
EXPECT_EQ(expectedValues, releaseHelper->getSupportedNumGrfs());
}
}
void ReleaseHelperTestsBase::whenGettingNumThreadsPerEuThenCorrectValueIsReturnedBasedOnDebugKey() {
DebugManagerStateRestore restorer;
for (auto &revision : getRevisions()) {
ipVersion.revision = revision;
releaseHelper = ReleaseHelper::create(ipVersion);
ASSERT_NE(nullptr, releaseHelper);
debugManager.flags.Enable10ThreadsPerEu.set(0);
EXPECT_EQ(8u, releaseHelper->getNumThreadsPerEu());
debugManager.flags.Enable10ThreadsPerEu.set(1);
EXPECT_EQ(10u, releaseHelper->getNumThreadsPerEu());
}
}
void ReleaseHelperTestsBase::whenGettingThreadsPerEuConfigsThenCorrectValueIsReturnedBasedOnNumThreadPerEu() {
for (auto &revision : getRevisions()) {
ipVersion.revision = revision;
releaseHelper = ReleaseHelper::create(ipVersion);
ASSERT_NE(nullptr, releaseHelper);
{
auto &configs = releaseHelper->getThreadsPerEUConfigs(8);
EXPECT_EQ(2U, configs.size());
EXPECT_EQ(4U, configs[0]);
EXPECT_EQ(8U, configs[1]);
}
{
auto &configs = releaseHelper->getThreadsPerEUConfigs(10);
EXPECT_EQ(5U, configs.size());
EXPECT_EQ(4U, configs[0]);
EXPECT_EQ(5U, configs[1]);
EXPECT_EQ(6U, configs[2]);
EXPECT_EQ(8U, configs[3]);
EXPECT_EQ(10U, configs[4]);
}
}
}

View File

@@ -31,6 +31,9 @@ struct ReleaseHelperTestsBase : public ::testing::Test {
void whenIsLocalOnlyAllowedCalledThenTrueReturned();
void whenIsLocalOnlyAllowedCalledThenFalseReturned();
void whenGettingPreferredSlmSizeThenAllEntriesEmpty();
void whenGettingSupportedNumGrfsThenValuesUpTo256Returned();
void whenGettingNumThreadsPerEuThenCorrectValueIsReturnedBasedOnDebugKey();
void whenGettingThreadsPerEuConfigsThenCorrectValueIsReturnedBasedOnNumThreadPerEu();
virtual std::vector<uint32_t> getRevisions() = 0;
std::unique_ptr<ReleaseHelper> releaseHelper;