mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Adjust maxWorkGroupSize value
Related-To: NEO-7357 Signed-off-by: Rafal Maziejuk <rafal.maziejuk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
91c4e33aee
commit
f7685a93e4
@@ -15,8 +15,11 @@
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
#include "test_traits_common.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
struct MockStateComputeModeProperties : public StateComputeModeProperties {
|
||||
@@ -39,6 +42,8 @@ struct MockStateBaseAddressProperties : public StateBaseAddressProperties {
|
||||
using StateBaseAddressProperties::stateBaseAddressPropertiesSupport;
|
||||
};
|
||||
|
||||
using StreamPropertiesTests = ::testing::Test;
|
||||
|
||||
TEST(StreamPropertiesTests, whenPropertyValueIsChangedThenProperStateIsSet) {
|
||||
NEO::StreamProperty streamProperty;
|
||||
|
||||
@@ -106,7 +111,7 @@ TEST(StreamPropertiesTests, whenSettingCooperativeKernelPropertiesThenCorrectVal
|
||||
}
|
||||
}
|
||||
|
||||
TEST(StreamPropertiesTests, whenSettingStateComputeModePropertiesThenCorrectValuesAreSet) {
|
||||
HWTEST2_F(StreamPropertiesTests, whenSettingStateComputeModePropertiesThenCorrectValuesAreSet, IsAtLeastGen12lp) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.ForceGrfNumProgrammingWithScm.set(1);
|
||||
DebugManager.flags.ForceThreadArbitrationPolicyProgrammingWithScm.set(1);
|
||||
@@ -129,7 +134,11 @@ TEST(StreamPropertiesTests, whenSettingStateComputeModePropertiesThenCorrectValu
|
||||
for (auto largeGrf : ::testing::Bool()) {
|
||||
for (auto threadArbitrationPolicy : threadArbitrationPolicyValues) {
|
||||
properties.stateComputeMode.setPropertiesAll(requiresCoherency, largeGrf ? 256 : 128, threadArbitrationPolicy, preemptionMode, rootDeviceEnvironment);
|
||||
EXPECT_EQ(largeGrf, properties.stateComputeMode.largeGrfMode.value);
|
||||
if constexpr (TestTraits<gfxCoreFamily>::largeGrfModeInStateComputeModeSupported) {
|
||||
EXPECT_EQ(largeGrf, properties.stateComputeMode.largeGrfMode.value);
|
||||
} else {
|
||||
EXPECT_EQ(-1, properties.stateComputeMode.largeGrfMode.value);
|
||||
}
|
||||
if (scmPropertiesSupport.coherencyRequired) {
|
||||
EXPECT_EQ(requiresCoherency, properties.stateComputeMode.isCoherencyRequired.value);
|
||||
} else {
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#include "shared/test/unit_test/fixtures/command_container_fixture.h"
|
||||
#include "shared/test/unit_test/mocks/mock_dispatch_kernel_encoder_interface.h"
|
||||
|
||||
#include "test_traits_common.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
using namespace NEO;
|
||||
@@ -517,7 +519,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchModeD
|
||||
}
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenDispatchInterfaceWhenNumRequiredGrfIsNotDefaultThenStateComputeModeCommandAdded) {
|
||||
HWTEST2_F(CommandEncodeStatesTest, givenDispatchInterfaceWhenNumRequiredGrfIsNotDefaultThenStateComputeModeCommandAdded, IsAtLeastGen12lp) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.ForceGrfNumProgrammingWithScm.set(1);
|
||||
|
||||
@@ -528,7 +530,11 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenDispatchInterfaceWhen
|
||||
EXPECT_FALSE(streamProperties.stateComputeMode.isDirty());
|
||||
|
||||
streamProperties.stateComputeMode.setPropertiesAll(false, 256, 0u, PreemptionMode::Disabled, rootDeviceEnvironment);
|
||||
EXPECT_TRUE(streamProperties.stateComputeMode.isDirty());
|
||||
if constexpr (TestTraits<gfxCoreFamily>::largeGrfModeInStateComputeModeSupported) {
|
||||
EXPECT_TRUE(streamProperties.stateComputeMode.isDirty());
|
||||
} else {
|
||||
EXPECT_FALSE(streamProperties.stateComputeMode.isDirty());
|
||||
}
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenInlineDataRequiredWhenEncodingWalkerThenEmitInlineParameterIsSet) {
|
||||
|
||||
@@ -927,10 +927,15 @@ HWCMDTEST_F(IGFX_GEN8_CORE, GfxCoreHelperTest, givenDefaultGfxCoreHelperHwWhenIs
|
||||
}
|
||||
|
||||
HWTEST_F(GfxCoreHelperTest, givenDefaultGfxCoreHelperHwWhenMinimalSIMDSizeIsQueriedThen8IsReturned) {
|
||||
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
const auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
EXPECT_EQ(8u, gfxCoreHelper.getMinimalSIMDSize());
|
||||
}
|
||||
|
||||
HWTEST_F(GfxCoreHelperTest, givenDefaultGfxCoreHelperHwWhenMinimalGrfSizeIsQueriedThen128IsReturned) {
|
||||
const auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
EXPECT_EQ(128u, gfxCoreHelper.getMinimalGrfSize());
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN8_CORE, GfxCoreHelperTest, WhenIsFusedEuDispatchEnabledIsCalledThenFalseIsReturned) {
|
||||
if (hardwareInfo.platform.eRenderCoreFamily == IGFX_GEN12LP_CORE) {
|
||||
GTEST_SKIP();
|
||||
@@ -1458,6 +1463,23 @@ HWTEST_F(GfxCoreHelperTest, whenIsDynamicallyPopulatedisTrueThengetHighestEnable
|
||||
EXPECT_EQ(maxSlice, 7u);
|
||||
}
|
||||
|
||||
HWTEST_F(GfxCoreHelperTest, givenNumGrfAndSimdSizeWhenAdjustingMaxWorkGroupSizeThenAlwaysReturnDeviceDefault) {
|
||||
const auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
constexpr auto defaultMaxGroupSize = 1024u;
|
||||
|
||||
uint32_t simdSize = 16u;
|
||||
uint32_t numGrfRequired = GrfConfig::LargeGrfNumber;
|
||||
EXPECT_EQ(defaultMaxGroupSize, gfxCoreHelper.adjustMaxWorkGroupSize(numGrfRequired, simdSize, defaultMaxGroupSize));
|
||||
|
||||
simdSize = 32u;
|
||||
numGrfRequired = GrfConfig::LargeGrfNumber;
|
||||
EXPECT_EQ(defaultMaxGroupSize, gfxCoreHelper.adjustMaxWorkGroupSize(numGrfRequired, simdSize, defaultMaxGroupSize));
|
||||
|
||||
simdSize = 16u;
|
||||
numGrfRequired = GrfConfig::DefaultGrfNumber;
|
||||
EXPECT_EQ(defaultMaxGroupSize, gfxCoreHelper.adjustMaxWorkGroupSize(numGrfRequired, simdSize, defaultMaxGroupSize));
|
||||
}
|
||||
|
||||
HWTEST_F(ProductHelperCommonTest, givenPatIndexAndAllocationTypeWhenCallOverridePatIndexThenSameIndexIsReturned) {
|
||||
auto &gfxCoreHelper = getHelper<ProductHelper>();
|
||||
uint64_t patIndex = 1u;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "test_traits_common.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
@@ -503,7 +504,7 @@ HWTEST_F(ProductHelperTest, givenSamplerStateWhenAdjustSamplerStateThenNothingIs
|
||||
EXPECT_EQ(0, memcmp(&initialState, &state, sizeof(SAMPLER_STATE)));
|
||||
}
|
||||
|
||||
HWTEST_F(ProductHelperTest, WhenFillingScmPropertiesSupportThenExpectUseCorrectGetters) {
|
||||
HWTEST2_F(ProductHelperTest, WhenFillingScmPropertiesSupportThenExpectUseCorrectGetters, IsAtLeastGen12lp) {
|
||||
StateComputeModePropertiesSupport scmPropertiesSupport = {};
|
||||
|
||||
productHelper->fillScmPropertiesSupportStructure(scmPropertiesSupport);
|
||||
@@ -512,8 +513,10 @@ HWTEST_F(ProductHelperTest, WhenFillingScmPropertiesSupportThenExpectUseCorrectG
|
||||
EXPECT_EQ(productHelper->getScmPropertyCoherencyRequiredSupport(), scmPropertiesSupport.coherencyRequired);
|
||||
EXPECT_EQ(productHelper->getScmPropertyZPassAsyncComputeThreadLimitSupport(), scmPropertiesSupport.zPassAsyncComputeThreadLimit);
|
||||
EXPECT_EQ(productHelper->getScmPropertyPixelAsyncComputeThreadLimitSupport(), scmPropertiesSupport.pixelAsyncComputeThreadLimit);
|
||||
EXPECT_EQ(productHelper->isGrfNumReportedWithScm(), scmPropertiesSupport.largeGrfMode);
|
||||
EXPECT_EQ(productHelper->getScmPropertyDevicePreemptionModeSupport(), scmPropertiesSupport.devicePreemptionMode);
|
||||
if constexpr (TestTraits<gfxCoreFamily>::largeGrfModeInStateComputeModeSupported) {
|
||||
EXPECT_EQ(productHelper->isGrfNumReportedWithScm(), scmPropertiesSupport.largeGrfMode);
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST_F(ProductHelperTest, WhenFillingFrontEndPropertiesSupportThenExpectUseCorrectGetters) {
|
||||
|
||||
Reference in New Issue
Block a user