mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
test: improve tests for getProductMaxPreferredSlmSize for releases 12.70 / 12.71
Related-To: NEO-7786 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
e007968db9
commit
6d020ceb97
@@ -38,21 +38,20 @@ TEST(ReleaseHelperTest, givenReleaseHelper1270ThenMaxPreferredSlmSizeIsLimitedBy
|
||||
ipVersion.revision = revision;
|
||||
auto releaseHelper = ReleaseHelper::create(ipVersion);
|
||||
ASSERT_NE(nullptr, releaseHelper);
|
||||
|
||||
using PREFERRED_SLM_ALLOCATION_SIZE = typename XeHpgCoreFamily::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE;
|
||||
auto maxValue = static_cast<int>(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K);
|
||||
for (auto &preferredSlmSize : {PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_0K,
|
||||
PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_16K,
|
||||
PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_32K,
|
||||
PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_64K,
|
||||
PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K}) {
|
||||
|
||||
for (auto i = 0; i < maxValue; i++) {
|
||||
auto preferredEnumValue = i;
|
||||
auto expectedEnumValue = i;
|
||||
EXPECT_EQ(expectedEnumValue, releaseHelper->getProductMaxPreferredSlmSize(preferredEnumValue));
|
||||
}
|
||||
|
||||
for (auto i = maxValue + 1; i < maxValue + 10; i++) {
|
||||
auto preferredEnumValue = i;
|
||||
auto expectedEnumValue = maxValue;
|
||||
EXPECT_EQ(expectedEnumValue, releaseHelper->getProductMaxPreferredSlmSize(preferredEnumValue));
|
||||
auto maxPreferredSlmValue = releaseHelper->getProductMaxPreferredSlmSize(preferredSlmSize);
|
||||
EXPECT_EQ(maxPreferredSlmValue, preferredSlmSize);
|
||||
}
|
||||
auto preferredSlmSize96k = PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K;
|
||||
auto preferredSlmSize128k = PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K;
|
||||
auto maxPreferredSlmValue = releaseHelper->getProductMaxPreferredSlmSize(preferredSlmSize128k);
|
||||
EXPECT_EQ(maxPreferredSlmValue, preferredSlmSize96k);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,19 +40,19 @@ TEST(ReleaseHelperTest, givenReleaseHelper1271ThenMaxPreferredSlmSizeIsLimitedBy
|
||||
ASSERT_NE(nullptr, releaseHelper);
|
||||
|
||||
using PREFERRED_SLM_ALLOCATION_SIZE = typename XeHpgCoreFamily::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE;
|
||||
auto maxValue = static_cast<int>(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K);
|
||||
for (auto &preferredSlmSize : {PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_0K,
|
||||
PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_16K,
|
||||
PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_32K,
|
||||
PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_64K,
|
||||
PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K}) {
|
||||
|
||||
for (auto i = 0; i < maxValue; i++) {
|
||||
auto preferredEnumValue = i;
|
||||
auto expectedEnumValue = i;
|
||||
EXPECT_EQ(expectedEnumValue, releaseHelper->getProductMaxPreferredSlmSize(preferredEnumValue));
|
||||
}
|
||||
|
||||
for (auto i = maxValue + 1; i < maxValue + 10; i++) {
|
||||
auto preferredEnumValue = i;
|
||||
auto expectedEnumValue = maxValue;
|
||||
EXPECT_EQ(expectedEnumValue, releaseHelper->getProductMaxPreferredSlmSize(preferredEnumValue));
|
||||
auto maxPreferredSlmValue = releaseHelper->getProductMaxPreferredSlmSize(preferredSlmSize);
|
||||
EXPECT_EQ(maxPreferredSlmValue, preferredSlmSize);
|
||||
}
|
||||
auto preferredSlmSize96k = PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K;
|
||||
auto preferredSlmSize128k = PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K;
|
||||
auto maxPreferredSlmValue = releaseHelper->getProductMaxPreferredSlmSize(preferredSlmSize128k);
|
||||
EXPECT_EQ(maxPreferredSlmValue, preferredSlmSize96k);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user