mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 16:45:25 +08:00
fix: add limitations for setting gmm flag Cacheable
- move isCachingOnCpuAvailable to product helper - isCachingOnCpuAvailable should return false on mtl - if wsl, skip checking method from product helper Related-To: NEO-7194 Signed-off-by: Cencelewska, Katarzyna <katarzyna.cencelewska@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
6f21d133cf
commit
d2436a8231
@@ -5,14 +5,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/gmm_helper/cache_settings_helper.h"
|
||||
#include "shared/source/gmm_helper/gmm.h"
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/test/common/fixtures/mock_execution_environment_gmm_fixture.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/mocks/mock_gmm.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
namespace NEO {
|
||||
using GmmTests = Test<MockExecutionEnvironmentGmmFixture>;
|
||||
@@ -33,13 +33,13 @@ TEST_F(GmmTests, givenResourceUsageTypesCacheableWhenCreateGmmAndFlagEnableCpuCa
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.EnableCpuCacheForResources.set(0);
|
||||
StorageInfo storageInfo{};
|
||||
auto &gfxCoreHelper = getGmmHelper()->getRootDeviceEnvironment().getHelper<GfxCoreHelper>();
|
||||
auto &productHelper = getGmmHelper()->getRootDeviceEnvironment().getHelper<ProductHelper>();
|
||||
for (auto resourceUsageType : {GMM_RESOURCE_USAGE_OCL_IMAGE,
|
||||
GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER,
|
||||
GMM_RESOURCE_USAGE_OCL_BUFFER_CONST,
|
||||
GMM_RESOURCE_USAGE_OCL_BUFFER}) {
|
||||
auto gmm = std::make_unique<Gmm>(getGmmHelper(), nullptr, 0, 0, resourceUsageType, false, storageInfo, false);
|
||||
EXPECT_EQ(gfxCoreHelper.isCachingOnCpuAvailable(), gmm->resourceParams.Flags.Info.Cacheable);
|
||||
EXPECT_EQ(productHelper.isCachingOnCpuAvailable(), gmm->resourceParams.Flags.Info.Cacheable);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,4 +52,19 @@ TEST_F(GmmTests, givenResourceUsageTypesUnCachedWhenGreateGmmThenFlagCachcableIs
|
||||
EXPECT_FALSE(gmm->resourceParams.Flags.Info.Cacheable);
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST_F(GmmTests, givenIsResourceCacheableOnCpuWhenWslFlagThenReturnProperValue) {
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.EnableCpuCacheForResources.set(false);
|
||||
auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getProductHelper();
|
||||
|
||||
GMM_RESOURCE_USAGE_TYPE_ENUM gmmResourceUsageType = GMM_RESOURCE_USAGE_OCL_BUFFER;
|
||||
EXPECT_EQ(!CacheSettingsHelper::isUncachedType(gmmResourceUsageType), CacheSettingsHelper::isResourceCacheableOnCpu(gmmResourceUsageType, productHelper, true));
|
||||
EXPECT_EQ(productHelper.isCachingOnCpuAvailable(), CacheSettingsHelper::isResourceCacheableOnCpu(gmmResourceUsageType, productHelper, false));
|
||||
|
||||
gmmResourceUsageType = GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED;
|
||||
EXPECT_EQ(!CacheSettingsHelper::isUncachedType(gmmResourceUsageType), CacheSettingsHelper::isResourceCacheableOnCpu(gmmResourceUsageType, productHelper, true));
|
||||
EXPECT_EQ(productHelper.isCachingOnCpuAvailable() && !CacheSettingsHelper::isUncachedType(gmmResourceUsageType),
|
||||
CacheSettingsHelper::isResourceCacheableOnCpu(gmmResourceUsageType, productHelper, false));
|
||||
}
|
||||
} // namespace NEO
|
||||
|
||||
@@ -1568,13 +1568,3 @@ HWTEST_F(GfxCoreHelperTest, givenNumGrfAndSimdSizeWhenAdjustingMaxWorkGroupSizeT
|
||||
numGrfRequired = GrfConfig::DefaultGrfNumber;
|
||||
EXPECT_EQ(defaultMaxGroupSize, gfxCoreHelper.adjustMaxWorkGroupSize(numGrfRequired, simdSize, defaultMaxGroupSize));
|
||||
}
|
||||
|
||||
HWTEST2_F(GfxCoreHelperTest, givenAtLeastXeHpWhenCheckIsCachingOnCpuAvailableThenAlwaysFalse, IsAtLeastXeHpCore) {
|
||||
const auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
EXPECT_FALSE(gfxCoreHelper.isCachingOnCpuAvailable());
|
||||
}
|
||||
|
||||
HWTEST2_F(GfxCoreHelperTest, givenAtMostGen12lpWhenCheckIsCachingOnCpuAvailableThenAlwaysTrue, IsAtMostGen12lp) {
|
||||
const auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
EXPECT_TRUE(gfxCoreHelper.isCachingOnCpuAvailable());
|
||||
}
|
||||
|
||||
@@ -760,3 +760,7 @@ HWTEST_F(ProductHelperTest, whenQueryingMaxNumSamplersThenReturnSixteen) {
|
||||
HWTEST_F(ProductHelperTest, whenDisableL3ForDebugCalledThenFalseIsReturned) {
|
||||
EXPECT_FALSE(productHelper->disableL3CacheForDebug(*defaultHwInfo));
|
||||
}
|
||||
|
||||
HWTEST_F(ProductHelperTest, whenCheckIsCachingOnCpuAvailableThenAlwaysTrue) {
|
||||
EXPECT_TRUE(productHelper->isCachingOnCpuAvailable());
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ HWTEST_EXCLUDE_PRODUCT(ComputeModeRequirements, givenComputeModeProgrammingWhenR
|
||||
HWTEST_EXCLUDE_PRODUCT(ComputeModeRequirements, givenComputeModeProgrammingWhenRequiredGRFNumberIsGreaterThan128ThenLargeGRFModeIsProgrammed_ForceNonCoherentSupportedMatcher, IGFX_METEORLAKE);
|
||||
HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfPatIndexProgrammingSupportedThenReturnFalse, IGFX_METEORLAKE);
|
||||
HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenIsAdjustWalkOrderAvailableCallThenFalseReturn, IGFX_METEORLAKE);
|
||||
HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, whenCheckIsCachingOnCpuAvailableThenAlwaysTrue, IGFX_METEORLAKE);
|
||||
HWTEST_EXCLUDE_PRODUCT(ProductHelperCommonTest, givenPatIndexAndAllocationTypeWhenCallOverridePatIndexThenSameIndexIsReturned, IGFX_METEORLAKE);
|
||||
HWTEST_EXCLUDE_PRODUCT(CompilerProductHelperFixture, GivenXeHpAndLaterThenBFloat16ConversionIsSupported_IsAtLeastXeHpCore, IGFX_METEORLAKE);
|
||||
HWTEST_EXCLUDE_PRODUCT(CompilerProductHelperFixture, GivenXeHpAndLaterThenMatrixMultiplyAccumulateIsSupported_IsAtLeastXeHpCore, IGFX_METEORLAKE);
|
||||
|
||||
@@ -311,3 +311,8 @@ MTLTEST_F(ProductHelperTestMtl, givenPatIndexAndAllocationTypeWhenCallOverridePa
|
||||
patIndex = 3u;
|
||||
EXPECT_EQ(patIndex, helper.overridePatIndex(allocationType, patIndex));
|
||||
}
|
||||
|
||||
MTLTEST_F(ProductHelperTestMtl, givenMtlWhenCheckIsCachingOnCpuAvailableThenAlwaysFalse) {
|
||||
const auto &productHelper = getHelper<ProductHelper>();
|
||||
EXPECT_FALSE(productHelper.isCachingOnCpuAvailable());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user