|
5 | 5 | * |
6 | 6 | */ |
7 | 7 |
|
| 8 | +#include "shared/source/helpers/aligned_memory.h" |
8 | 9 | #include "shared/source/helpers/ptr_math.h" |
9 | 10 | #include "shared/test/common/helpers/debug_manager_state_restore.h" |
10 | 11 | #include "shared/test/common/helpers/default_hw_info.h" |
@@ -373,9 +374,44 @@ HWTEST_F(L0HwHelperTest, givenBitmaskWithAttentionBitsForHalfOfThreadsWhenGettin |
373 | 374 | } |
374 | 375 | } |
375 | 376 |
|
376 | | -using PlatformsWithFusedEus = IsWithinGfxCore<IGFX_GEN12LP_CORE, IGFX_XE_HP_CORE>; |
| 377 | +using PlatformsWithFusedEus = IsWithinGfxCore<IGFX_GEN12LP_CORE, IGFX_XE_HPG_CORE>; |
377 | 378 | using L0HwHelperFusedEuTest = ::testing::Test; |
378 | 379 |
|
| 380 | +HWTEST2_F(L0HwHelperFusedEuTest, givenDynamicallyPopulatesSliceInfoGreaterThanMaxSlicesSupportedThenBitmasksAreCorrect, PlatformsWithFusedEus) { |
| 381 | + auto hwInfo = *NEO::defaultHwInfo.get(); |
| 382 | + auto &l0HwHelper = L0::L0HwHelper::get(hwInfo.platform.eRenderCoreFamily); |
| 383 | + if (hwInfo.gtSystemInfo.MaxEuPerSubSlice <= 8) { |
| 384 | + GTEST_SKIP(); |
| 385 | + } |
| 386 | + |
| 387 | + std::unique_ptr<uint8_t[]> bitmask; |
| 388 | + size_t size = 0; |
| 389 | + |
| 390 | + hwInfo.gtSystemInfo.IsDynamicallyPopulated = true; |
| 391 | + hwInfo.gtSystemInfo.MaxSlicesSupported = 2; |
| 392 | + for (int i = 0; i < GT_MAX_SLICE; i++) { |
| 393 | + hwInfo.gtSystemInfo.SliceInfo[i].Enabled = false; |
| 394 | + } |
| 395 | + hwInfo.gtSystemInfo.SliceInfo[2].Enabled = true; |
| 396 | + hwInfo.gtSystemInfo.SliceInfo[3].Enabled = true; |
| 397 | + |
| 398 | + std::vector<EuThread::ThreadId> threadsWithAtt; |
| 399 | + threadsWithAtt.push_back({0, 2, 0, 0, 0}); |
| 400 | + threadsWithAtt.push_back({0, 3, 0, 0, 0}); |
| 401 | + l0HwHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size); |
| 402 | + const uint32_t numSubslicesPerSlice = hwInfo.gtSystemInfo.MaxSubSlicesSupported / hwInfo.gtSystemInfo.MaxSlicesSupported; |
| 403 | + const uint32_t numEuPerSubslice = std::min(hwInfo.gtSystemInfo.MaxEuPerSubSlice, 8u); |
| 404 | + const uint32_t numThreadsPerEu = (hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount); |
| 405 | + const uint32_t bytesPerEu = alignUp(numThreadsPerEu, 8) / 8; |
| 406 | + auto expected_size = 4 * numSubslicesPerSlice * numEuPerSubslice * bytesPerEu; |
| 407 | + EXPECT_EQ(size, expected_size); |
| 408 | + |
| 409 | + auto threads = l0HwHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), size); |
| 410 | + ASSERT_EQ(threads.size(), 4u); |
| 411 | + EXPECT_EQ(threads[0], threadsWithAtt[0]); |
| 412 | + EXPECT_EQ(threads[2], threadsWithAtt[1]); |
| 413 | +} |
| 414 | + |
379 | 415 | HWTEST2_F(L0HwHelperFusedEuTest, givenBitmaskWithAttentionBitsForSingleThreadWhenGettingThreadsThenThreadForTwoEUsReturned, PlatformsWithFusedEus) { |
380 | 416 | auto hwInfo = *NEO::defaultHwInfo.get(); |
381 | 417 | if (hwInfo.gtSystemInfo.MaxEuPerSubSlice <= 8) { |
|
0 commit comments