mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Move L0HwHelper ownership to RootDeviceEnvironment 3/n
Related-To: NEO-6853 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com> Use RootDeviceEnvironment getHelper<L0CoreHelper> for - getAttentionBitmaskForSingleThreads - getThreadsFromAttentionBitmask
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
0e47bcde1d
commit
88ed486f6b
@ -217,7 +217,7 @@ HWTEST_F(L0HwHelperTest, givenSingleThreadsWhenGettingBitmaskThenCorrectBitsAreS
|
|||||||
|
|
||||||
HWTEST_F(L0HwHelperTest, givenBitmaskWithAttentionBitsForSingleThreadWhenGettingThreadsThenSingleCorrectThreadReturned) {
|
HWTEST_F(L0HwHelperTest, givenBitmaskWithAttentionBitsForSingleThreadWhenGettingThreadsThenSingleCorrectThreadReturned) {
|
||||||
auto hwInfo = *NEO::defaultHwInfo.get();
|
auto hwInfo = *NEO::defaultHwInfo.get();
|
||||||
auto &l0HwHelper = L0::L0HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &l0CoreHelper = getHelper<L0CoreHelper>();
|
||||||
|
|
||||||
std::unique_ptr<uint8_t[]> bitmask;
|
std::unique_ptr<uint8_t[]> bitmask;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
@ -229,9 +229,9 @@ HWTEST_F(L0HwHelperTest, givenBitmaskWithAttentionBitsForSingleThreadWhenGetting
|
|||||||
std::vector<EuThread::ThreadId> threadsWithAtt;
|
std::vector<EuThread::ThreadId> threadsWithAtt;
|
||||||
threadsWithAtt.push_back({0, 0, subsliceID, 0, threadID});
|
threadsWithAtt.push_back({0, 0, subsliceID, 0, threadID});
|
||||||
|
|
||||||
l0HwHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
l0CoreHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
||||||
|
|
||||||
auto threads = l0HwHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), size);
|
auto threads = l0CoreHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), size);
|
||||||
|
|
||||||
ASSERT_EQ(1u, threads.size());
|
ASSERT_EQ(1u, threads.size());
|
||||||
EXPECT_EQ(0u, threads[0].slice);
|
EXPECT_EQ(0u, threads[0].slice);
|
||||||
@ -241,7 +241,7 @@ HWTEST_F(L0HwHelperTest, givenBitmaskWithAttentionBitsForSingleThreadWhenGetting
|
|||||||
|
|
||||||
EXPECT_EQ(0u, threads[0].tileIndex);
|
EXPECT_EQ(0u, threads[0].tileIndex);
|
||||||
|
|
||||||
threads = l0HwHelper.getThreadsFromAttentionBitmask(hwInfo, 1, bitmask.get(), size);
|
threads = l0CoreHelper.getThreadsFromAttentionBitmask(hwInfo, 1, bitmask.get(), size);
|
||||||
|
|
||||||
ASSERT_EQ(1u, threads.size());
|
ASSERT_EQ(1u, threads.size());
|
||||||
EXPECT_EQ(0u, threads[0].slice);
|
EXPECT_EQ(0u, threads[0].slice);
|
||||||
@ -254,7 +254,7 @@ HWTEST_F(L0HwHelperTest, givenBitmaskWithAttentionBitsForSingleThreadWhenGetting
|
|||||||
|
|
||||||
HWTEST_F(L0HwHelperTest, givenBitmaskWithAttentionBitsForAllSubslicesWhenGettingThreadsThenCorrectThreadsAreReturned) {
|
HWTEST_F(L0HwHelperTest, givenBitmaskWithAttentionBitsForAllSubslicesWhenGettingThreadsThenCorrectThreadsAreReturned) {
|
||||||
auto hwInfo = *NEO::defaultHwInfo.get();
|
auto hwInfo = *NEO::defaultHwInfo.get();
|
||||||
auto &l0HwHelper = L0::L0HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &l0CoreHelper = getHelper<L0CoreHelper>();
|
||||||
|
|
||||||
std::unique_ptr<uint8_t[]> bitmask;
|
std::unique_ptr<uint8_t[]> bitmask;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
@ -267,9 +267,9 @@ HWTEST_F(L0HwHelperTest, givenBitmaskWithAttentionBitsForAllSubslicesWhenGetting
|
|||||||
threadsWithAtt.push_back({0, 0, subsliceID, 0, threadID});
|
threadsWithAtt.push_back({0, 0, subsliceID, 0, threadID});
|
||||||
}
|
}
|
||||||
|
|
||||||
l0HwHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
l0CoreHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
||||||
|
|
||||||
auto threads = l0HwHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), size);
|
auto threads = l0CoreHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), size);
|
||||||
|
|
||||||
ASSERT_EQ(subslicesPerSlice, threads.size());
|
ASSERT_EQ(subslicesPerSlice, threads.size());
|
||||||
|
|
||||||
@ -285,7 +285,7 @@ HWTEST_F(L0HwHelperTest, givenBitmaskWithAttentionBitsForAllSubslicesWhenGetting
|
|||||||
|
|
||||||
HWTEST_F(L0HwHelperTest, givenBitmaskWithAttentionBitsForAllEUsWhenGettingThreadsThenCorrectThreadsAreReturned) {
|
HWTEST_F(L0HwHelperTest, givenBitmaskWithAttentionBitsForAllEUsWhenGettingThreadsThenCorrectThreadsAreReturned) {
|
||||||
auto hwInfo = *NEO::defaultHwInfo.get();
|
auto hwInfo = *NEO::defaultHwInfo.get();
|
||||||
auto &l0HwHelper = L0::L0HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &l0CoreHelper = getHelper<L0CoreHelper>();
|
||||||
|
|
||||||
std::unique_ptr<uint8_t[]> bitmask;
|
std::unique_ptr<uint8_t[]> bitmask;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
@ -298,8 +298,8 @@ HWTEST_F(L0HwHelperTest, givenBitmaskWithAttentionBitsForAllEUsWhenGettingThread
|
|||||||
threadsWithAtt.push_back({0, 0, 0, euId, threadID});
|
threadsWithAtt.push_back({0, 0, 0, euId, threadID});
|
||||||
}
|
}
|
||||||
|
|
||||||
l0HwHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
l0CoreHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
||||||
auto threads = l0HwHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), size);
|
auto threads = l0CoreHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), size);
|
||||||
|
|
||||||
ASSERT_EQ(numEUsPerSS, threads.size());
|
ASSERT_EQ(numEUsPerSS, threads.size());
|
||||||
|
|
||||||
@ -315,10 +315,10 @@ HWTEST_F(L0HwHelperTest, givenBitmaskWithAttentionBitsForAllEUsWhenGettingThread
|
|||||||
|
|
||||||
HWTEST_F(L0HwHelperTest, givenEu0To1Threads0To3BitmaskWhenGettingThreadsThenCorrectThreadsAreReturned) {
|
HWTEST_F(L0HwHelperTest, givenEu0To1Threads0To3BitmaskWhenGettingThreadsThenCorrectThreadsAreReturned) {
|
||||||
auto hwInfo = *NEO::defaultHwInfo.get();
|
auto hwInfo = *NEO::defaultHwInfo.get();
|
||||||
auto &l0HwHelper = L0::L0HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &l0CoreHelper = getHelper<L0CoreHelper>();
|
||||||
|
|
||||||
uint8_t data[2] = {0x0f, 0x0f};
|
uint8_t data[2] = {0x0f, 0x0f};
|
||||||
auto threads = l0HwHelper.getThreadsFromAttentionBitmask(hwInfo, 0, data, sizeof(data));
|
auto threads = l0CoreHelper.getThreadsFromAttentionBitmask(hwInfo, 0, data, sizeof(data));
|
||||||
|
|
||||||
ASSERT_EQ(8u, threads.size());
|
ASSERT_EQ(8u, threads.size());
|
||||||
|
|
||||||
@ -344,7 +344,7 @@ HWTEST_F(L0HwHelperTest, givenEu0To1Threads0To3BitmaskWhenGettingThreadsThenCorr
|
|||||||
|
|
||||||
HWTEST_F(L0HwHelperTest, givenBitmaskWithAttentionBitsForHalfOfThreadsWhenGettingThreadsThenCorrectThreadsAreReturned) {
|
HWTEST_F(L0HwHelperTest, givenBitmaskWithAttentionBitsForHalfOfThreadsWhenGettingThreadsThenCorrectThreadsAreReturned) {
|
||||||
auto hwInfo = *NEO::defaultHwInfo.get();
|
auto hwInfo = *NEO::defaultHwInfo.get();
|
||||||
auto &l0HwHelper = L0::L0HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &l0CoreHelper = getHelper<L0CoreHelper>();
|
||||||
|
|
||||||
std::unique_ptr<uint8_t[]> bitmask;
|
std::unique_ptr<uint8_t[]> bitmask;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
@ -358,11 +358,11 @@ HWTEST_F(L0HwHelperTest, givenBitmaskWithAttentionBitsForHalfOfThreadsWhenGettin
|
|||||||
threadsWithAtt.push_back({0, 0, subsliceID, 0, threadID});
|
threadsWithAtt.push_back({0, 0, subsliceID, 0, threadID});
|
||||||
}
|
}
|
||||||
|
|
||||||
l0HwHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
l0CoreHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
||||||
|
|
||||||
auto bitmaskSizePerSingleSubslice = size / hwInfo.gtSystemInfo.MaxSlicesSupported / subslicesPerSlice;
|
auto bitmaskSizePerSingleSubslice = size / hwInfo.gtSystemInfo.MaxSlicesSupported / subslicesPerSlice;
|
||||||
|
|
||||||
auto threads = l0HwHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), bitmaskSizePerSingleSubslice * numOfActiveSubslices);
|
auto threads = l0CoreHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), bitmaskSizePerSingleSubslice * numOfActiveSubslices);
|
||||||
|
|
||||||
ASSERT_EQ(numOfActiveSubslices, threads.size());
|
ASSERT_EQ(numOfActiveSubslices, threads.size());
|
||||||
|
|
||||||
@ -377,11 +377,11 @@ HWTEST_F(L0HwHelperTest, givenBitmaskWithAttentionBitsForHalfOfThreadsWhenGettin
|
|||||||
}
|
}
|
||||||
|
|
||||||
using PlatformsWithFusedEus = IsWithinGfxCore<IGFX_GEN12LP_CORE, IGFX_XE_HPG_CORE>;
|
using PlatformsWithFusedEus = IsWithinGfxCore<IGFX_GEN12LP_CORE, IGFX_XE_HPG_CORE>;
|
||||||
using L0HwHelperFusedEuTest = ::testing::Test;
|
using L0HwHelperFusedEuTest = L0HwHelperTest;
|
||||||
|
|
||||||
HWTEST2_F(L0HwHelperTest, givenBitmaskWithAttentionBitsWith8EUSSWhenGettingThreadsThenSingleCorrectThreadReturned, PlatformsWithFusedEus) {
|
HWTEST2_F(L0HwHelperTest, givenBitmaskWithAttentionBitsWith8EUSSWhenGettingThreadsThenSingleCorrectThreadReturned, PlatformsWithFusedEus) {
|
||||||
auto hwInfo = *NEO::defaultHwInfo.get();
|
auto hwInfo = *NEO::defaultHwInfo.get();
|
||||||
auto &l0HwHelper = L0::L0HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &l0CoreHelper = getHelper<L0CoreHelper>();
|
||||||
hwInfo.gtSystemInfo.MaxEuPerSubSlice = 8;
|
hwInfo.gtSystemInfo.MaxEuPerSubSlice = 8;
|
||||||
hwInfo.gtSystemInfo.MaxSubSlicesSupported = 64;
|
hwInfo.gtSystemInfo.MaxSubSlicesSupported = 64;
|
||||||
hwInfo.gtSystemInfo.MaxDualSubSlicesSupported = 32;
|
hwInfo.gtSystemInfo.MaxDualSubSlicesSupported = 32;
|
||||||
@ -394,9 +394,9 @@ HWTEST2_F(L0HwHelperTest, givenBitmaskWithAttentionBitsWith8EUSSWhenGettingThrea
|
|||||||
std::vector<EuThread::ThreadId> threadsWithAtt;
|
std::vector<EuThread::ThreadId> threadsWithAtt;
|
||||||
threadsWithAtt.push_back({0, 0, subsliceID, 0, 0});
|
threadsWithAtt.push_back({0, 0, subsliceID, 0, 0});
|
||||||
|
|
||||||
l0HwHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
l0CoreHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
||||||
|
|
||||||
auto threads = l0HwHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), size);
|
auto threads = l0CoreHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), size);
|
||||||
|
|
||||||
ASSERT_EQ(2u, threads.size());
|
ASSERT_EQ(2u, threads.size());
|
||||||
|
|
||||||
@ -416,7 +416,7 @@ HWTEST2_F(L0HwHelperTest, givenBitmaskWithAttentionBitsWith8EUSSWhenGettingThrea
|
|||||||
|
|
||||||
HWTEST2_F(L0HwHelperFusedEuTest, givenDynamicallyPopulatesSliceInfoGreaterThanMaxSlicesSupportedThenBitmasksAreCorrect, PlatformsWithFusedEus) {
|
HWTEST2_F(L0HwHelperFusedEuTest, givenDynamicallyPopulatesSliceInfoGreaterThanMaxSlicesSupportedThenBitmasksAreCorrect, PlatformsWithFusedEus) {
|
||||||
auto hwInfo = *NEO::defaultHwInfo.get();
|
auto hwInfo = *NEO::defaultHwInfo.get();
|
||||||
auto &l0HwHelper = L0::L0HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &l0CoreHelper = getHelper<L0CoreHelper>();
|
||||||
if (hwInfo.gtSystemInfo.MaxEuPerSubSlice <= 8) {
|
if (hwInfo.gtSystemInfo.MaxEuPerSubSlice <= 8) {
|
||||||
GTEST_SKIP();
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
@ -435,7 +435,7 @@ HWTEST2_F(L0HwHelperFusedEuTest, givenDynamicallyPopulatesSliceInfoGreaterThanMa
|
|||||||
std::vector<EuThread::ThreadId> threadsWithAtt;
|
std::vector<EuThread::ThreadId> threadsWithAtt;
|
||||||
threadsWithAtt.push_back({0, 2, 0, 0, 0});
|
threadsWithAtt.push_back({0, 2, 0, 0, 0});
|
||||||
threadsWithAtt.push_back({0, 3, 0, 0, 0});
|
threadsWithAtt.push_back({0, 3, 0, 0, 0});
|
||||||
l0HwHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
l0CoreHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
||||||
const uint32_t numSubslicesPerSlice = hwInfo.gtSystemInfo.MaxSubSlicesSupported / hwInfo.gtSystemInfo.MaxSlicesSupported;
|
const uint32_t numSubslicesPerSlice = hwInfo.gtSystemInfo.MaxSubSlicesSupported / hwInfo.gtSystemInfo.MaxSlicesSupported;
|
||||||
const uint32_t numEuPerSubslice = std::min(hwInfo.gtSystemInfo.MaxEuPerSubSlice, 8u);
|
const uint32_t numEuPerSubslice = std::min(hwInfo.gtSystemInfo.MaxEuPerSubSlice, 8u);
|
||||||
const uint32_t numThreadsPerEu = (hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount);
|
const uint32_t numThreadsPerEu = (hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount);
|
||||||
@ -443,7 +443,7 @@ HWTEST2_F(L0HwHelperFusedEuTest, givenDynamicallyPopulatesSliceInfoGreaterThanMa
|
|||||||
auto expectedSize = 4 * numSubslicesPerSlice * numEuPerSubslice * bytesPerEu;
|
auto expectedSize = 4 * numSubslicesPerSlice * numEuPerSubslice * bytesPerEu;
|
||||||
EXPECT_EQ(size, expectedSize);
|
EXPECT_EQ(size, expectedSize);
|
||||||
|
|
||||||
auto threads = l0HwHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), size);
|
auto threads = l0CoreHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), size);
|
||||||
ASSERT_EQ(threads.size(), 4u);
|
ASSERT_EQ(threads.size(), 4u);
|
||||||
EXPECT_EQ(threads[0], threadsWithAtt[0]);
|
EXPECT_EQ(threads[0], threadsWithAtt[0]);
|
||||||
EXPECT_EQ(threads[2], threadsWithAtt[1]);
|
EXPECT_EQ(threads[2], threadsWithAtt[1]);
|
||||||
@ -455,7 +455,7 @@ HWTEST2_F(L0HwHelperFusedEuTest, givenBitmaskWithAttentionBitsForSingleThreadWhe
|
|||||||
GTEST_SKIP();
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto &l0HwHelper = L0::L0HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &l0CoreHelper = getHelper<L0CoreHelper>();
|
||||||
|
|
||||||
std::unique_ptr<uint8_t[]> bitmask;
|
std::unique_ptr<uint8_t[]> bitmask;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
@ -467,9 +467,9 @@ HWTEST2_F(L0HwHelperFusedEuTest, givenBitmaskWithAttentionBitsForSingleThreadWhe
|
|||||||
std::vector<EuThread::ThreadId> threadsWithAtt;
|
std::vector<EuThread::ThreadId> threadsWithAtt;
|
||||||
threadsWithAtt.push_back({0, 0, subsliceID, 0, threadID});
|
threadsWithAtt.push_back({0, 0, subsliceID, 0, threadID});
|
||||||
|
|
||||||
l0HwHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
l0CoreHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
||||||
|
|
||||||
auto threads = l0HwHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), size);
|
auto threads = l0CoreHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), size);
|
||||||
|
|
||||||
ASSERT_EQ(2u, threads.size());
|
ASSERT_EQ(2u, threads.size());
|
||||||
|
|
||||||
@ -492,7 +492,7 @@ HWTEST2_F(L0HwHelperFusedEuTest, givenBitmaskWithAttentionBitsForAllSubslicesWhe
|
|||||||
GTEST_SKIP();
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto &l0HwHelper = L0::L0HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &l0CoreHelper = getHelper<L0CoreHelper>();
|
||||||
|
|
||||||
std::unique_ptr<uint8_t[]> bitmask;
|
std::unique_ptr<uint8_t[]> bitmask;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
@ -505,9 +505,9 @@ HWTEST2_F(L0HwHelperFusedEuTest, givenBitmaskWithAttentionBitsForAllSubslicesWhe
|
|||||||
threadsWithAtt.push_back({0, 0, subsliceID, 0, threadID});
|
threadsWithAtt.push_back({0, 0, subsliceID, 0, threadID});
|
||||||
}
|
}
|
||||||
|
|
||||||
l0HwHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
l0CoreHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
||||||
|
|
||||||
auto threads = l0HwHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), size);
|
auto threads = l0CoreHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), size);
|
||||||
|
|
||||||
ASSERT_EQ(2 * subslicesPerSlice, threads.size());
|
ASSERT_EQ(2 * subslicesPerSlice, threads.size());
|
||||||
|
|
||||||
@ -531,7 +531,7 @@ HWTEST2_F(L0HwHelperFusedEuTest, givenBitmaskWithAttentionBitsForAllEUsWhenGetti
|
|||||||
GTEST_SKIP();
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto &l0HwHelper = L0::L0HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &l0CoreHelper = getHelper<L0CoreHelper>();
|
||||||
|
|
||||||
std::unique_ptr<uint8_t[]> bitmask;
|
std::unique_ptr<uint8_t[]> bitmask;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
@ -544,8 +544,8 @@ HWTEST2_F(L0HwHelperFusedEuTest, givenBitmaskWithAttentionBitsForAllEUsWhenGetti
|
|||||||
threadsWithAtt.push_back({0, 0, 0, euId, threadID});
|
threadsWithAtt.push_back({0, 0, 0, euId, threadID});
|
||||||
}
|
}
|
||||||
|
|
||||||
l0HwHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
l0CoreHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
||||||
auto threads = l0HwHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), size);
|
auto threads = l0CoreHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), size);
|
||||||
|
|
||||||
ASSERT_EQ(maxEUsInAtt, threads.size());
|
ASSERT_EQ(maxEUsInAtt, threads.size());
|
||||||
|
|
||||||
@ -565,10 +565,10 @@ HWTEST2_F(L0HwHelperFusedEuTest, givenEu0To1Threads0To3BitmaskWhenGettingThreads
|
|||||||
GTEST_SKIP();
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto &l0HwHelper = L0::L0HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &l0CoreHelper = getHelper<L0CoreHelper>();
|
||||||
|
|
||||||
uint8_t data[2] = {0x0f, 0x0f};
|
uint8_t data[2] = {0x0f, 0x0f};
|
||||||
auto threads = l0HwHelper.getThreadsFromAttentionBitmask(hwInfo, 0, data, sizeof(data));
|
auto threads = l0CoreHelper.getThreadsFromAttentionBitmask(hwInfo, 0, data, sizeof(data));
|
||||||
|
|
||||||
ASSERT_EQ(16u, threads.size());
|
ASSERT_EQ(16u, threads.size());
|
||||||
|
|
||||||
@ -589,10 +589,10 @@ HWTEST2_F(L0HwHelperFusedEuTest, givenEu8To9Threads0To3BitmaskWhenGettingThreads
|
|||||||
GTEST_SKIP();
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto &l0HwHelper = L0::L0HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &l0CoreHelper = getHelper<L0CoreHelper>();
|
||||||
|
|
||||||
uint8_t data[] = {0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f};
|
uint8_t data[] = {0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f};
|
||||||
auto threads = l0HwHelper.getThreadsFromAttentionBitmask(hwInfo, 0, data, sizeof(data));
|
auto threads = l0CoreHelper.getThreadsFromAttentionBitmask(hwInfo, 0, data, sizeof(data));
|
||||||
|
|
||||||
ASSERT_EQ(16u, threads.size());
|
ASSERT_EQ(16u, threads.size());
|
||||||
|
|
||||||
@ -614,7 +614,7 @@ HWTEST2_F(L0HwHelperFusedEuTest, givenBitmaskWithAttentionBitsForHalfOfThreadsWh
|
|||||||
GTEST_SKIP();
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto &l0HwHelper = L0::L0HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &l0CoreHelper = getHelper<L0CoreHelper>();
|
||||||
|
|
||||||
std::unique_ptr<uint8_t[]> bitmask;
|
std::unique_ptr<uint8_t[]> bitmask;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
@ -628,11 +628,11 @@ HWTEST2_F(L0HwHelperFusedEuTest, givenBitmaskWithAttentionBitsForHalfOfThreadsWh
|
|||||||
threadsWithAtt.push_back({0, 0, subsliceID, 0, threadID});
|
threadsWithAtt.push_back({0, 0, subsliceID, 0, threadID});
|
||||||
}
|
}
|
||||||
|
|
||||||
l0HwHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
l0CoreHelper.getAttentionBitmaskForSingleThreads(threadsWithAtt, hwInfo, bitmask, size);
|
||||||
|
|
||||||
auto bitmaskSizePerSingleSubslice = size / hwInfo.gtSystemInfo.MaxSlicesSupported / subslicesPerSlice;
|
auto bitmaskSizePerSingleSubslice = size / hwInfo.gtSystemInfo.MaxSlicesSupported / subslicesPerSlice;
|
||||||
|
|
||||||
auto threads = l0HwHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), bitmaskSizePerSingleSubslice * numOfActiveSubslices);
|
auto threads = l0CoreHelper.getThreadsFromAttentionBitmask(hwInfo, 0, bitmask.get(), bitmaskSizePerSingleSubslice * numOfActiveSubslices);
|
||||||
|
|
||||||
ASSERT_EQ(2 * numOfActiveSubslices, threads.size());
|
ASSERT_EQ(2 * numOfActiveSubslices, threads.size());
|
||||||
|
|
||||||
|
@ -233,11 +233,11 @@ ze_result_t DebugSessionWindows::handleEuAttentionBitsEvent(DBGUMD_READ_EVENT_EU
|
|||||||
euAttentionBitsParams.BitMaskSizeInBytes, &euAttentionBitsParams.BitmaskArrayPtr);
|
euAttentionBitsParams.BitMaskSizeInBytes, &euAttentionBitsParams.BitmaskArrayPtr);
|
||||||
|
|
||||||
auto hwInfo = connectedDevice->getHwInfo();
|
auto hwInfo = connectedDevice->getHwInfo();
|
||||||
auto &l0HwHelper = L0HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &l0CoreHelper = connectedDevice->getNEODevice()->getRootDeviceEnvironment().getHelper<L0CoreHelper>();
|
||||||
|
|
||||||
auto threadsWithAttention = l0HwHelper.getThreadsFromAttentionBitmask(hwInfo, 0u,
|
auto threadsWithAttention = l0CoreHelper.getThreadsFromAttentionBitmask(hwInfo, 0u,
|
||||||
reinterpret_cast<uint8_t *>(&euAttentionBitsParams.BitmaskArrayPtr),
|
reinterpret_cast<uint8_t *>(&euAttentionBitsParams.BitmaskArrayPtr),
|
||||||
euAttentionBitsParams.BitMaskSizeInBytes);
|
euAttentionBitsParams.BitMaskSizeInBytes);
|
||||||
|
|
||||||
printBitmask(reinterpret_cast<uint8_t *>(&euAttentionBitsParams.BitmaskArrayPtr), euAttentionBitsParams.BitMaskSizeInBytes);
|
printBitmask(reinterpret_cast<uint8_t *>(&euAttentionBitsParams.BitmaskArrayPtr), euAttentionBitsParams.BitMaskSizeInBytes);
|
||||||
|
|
||||||
@ -548,10 +548,10 @@ ze_result_t DebugSessionWindows::acknowledgeEvent(const zet_debug_event_t *event
|
|||||||
|
|
||||||
ze_result_t DebugSessionWindows::resumeImp(const std::vector<EuThread::ThreadId> &threads, uint32_t deviceIndex) {
|
ze_result_t DebugSessionWindows::resumeImp(const std::vector<EuThread::ThreadId> &threads, uint32_t deviceIndex) {
|
||||||
auto hwInfo = connectedDevice->getHwInfo();
|
auto hwInfo = connectedDevice->getHwInfo();
|
||||||
auto &l0HwHelper = L0HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &l0CoreHelper = connectedDevice->getNEODevice()->getRootDeviceEnvironment().getHelper<L0CoreHelper>();
|
||||||
std::unique_ptr<uint8_t[]> bitmask;
|
std::unique_ptr<uint8_t[]> bitmask;
|
||||||
size_t bitmaskSize = 0;
|
size_t bitmaskSize = 0;
|
||||||
l0HwHelper.getAttentionBitmaskForSingleThreads(threads, hwInfo, bitmask, bitmaskSize);
|
l0CoreHelper.getAttentionBitmaskForSingleThreads(threads, hwInfo, bitmask, bitmaskSize);
|
||||||
printBitmask(bitmask.get(), bitmaskSize);
|
printBitmask(bitmask.get(), bitmaskSize);
|
||||||
|
|
||||||
KM_ESCAPE_INFO escapeInfo = {0};
|
KM_ESCAPE_INFO escapeInfo = {0};
|
||||||
|
@ -156,7 +156,7 @@ TEST_F(DebugApiWindowsAttentionTest, GivenEuAttentionEventForThreadsWhenHandling
|
|||||||
std::unique_ptr<uint8_t[]> bitmask;
|
std::unique_ptr<uint8_t[]> bitmask;
|
||||||
size_t bitmaskSize = 0;
|
size_t bitmaskSize = 0;
|
||||||
auto &hwInfo = neoDevice->getHardwareInfo();
|
auto &hwInfo = neoDevice->getHardwareInfo();
|
||||||
auto &l0HwHelper = L0HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &l0CoreHelper = neoDevice->getRootDeviceEnvironment().getHelper<L0CoreHelper>();
|
||||||
|
|
||||||
std::vector<EuThread::ThreadId> threads{
|
std::vector<EuThread::ThreadId> threads{
|
||||||
{0, 0, 0, 0, 0},
|
{0, 0, 0, 0, 0},
|
||||||
@ -173,7 +173,7 @@ TEST_F(DebugApiWindowsAttentionTest, GivenEuAttentionEventForThreadsWhenHandling
|
|||||||
}
|
}
|
||||||
sessionMock->allContexts.insert(0x12345);
|
sessionMock->allContexts.insert(0x12345);
|
||||||
|
|
||||||
l0HwHelper.getAttentionBitmaskForSingleThreads(threads, hwInfo, bitmask, bitmaskSize);
|
l0CoreHelper.getAttentionBitmaskForSingleThreads(threads, hwInfo, bitmask, bitmaskSize);
|
||||||
mockWddm->numEvents = 1;
|
mockWddm->numEvents = 1;
|
||||||
mockWddm->eventQueue[0].readEventType = DBGUMD_READ_EVENT_EU_ATTN_BIT_SET;
|
mockWddm->eventQueue[0].readEventType = DBGUMD_READ_EVENT_EU_ATTN_BIT_SET;
|
||||||
copyBitmaskToEventParams(&mockWddm->eventQueue[0].eventParamsBuffer.eventParamsBuffer, bitmask, bitmaskSize);
|
copyBitmaskToEventParams(&mockWddm->eventQueue[0].eventParamsBuffer.eventParamsBuffer, bitmask, bitmaskSize);
|
||||||
@ -193,7 +193,7 @@ TEST_F(DebugApiWindowsAttentionTest, GivenNoContextWhenHandlingAttentionEventThe
|
|||||||
std::unique_ptr<uint8_t[]> bitmask;
|
std::unique_ptr<uint8_t[]> bitmask;
|
||||||
size_t bitmaskSize = 0;
|
size_t bitmaskSize = 0;
|
||||||
auto &hwInfo = neoDevice->getHardwareInfo();
|
auto &hwInfo = neoDevice->getHardwareInfo();
|
||||||
auto &l0HwHelper = L0HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &l0CoreHelper = neoDevice->getRootDeviceEnvironment().getHelper<L0CoreHelper>();
|
||||||
|
|
||||||
std::vector<EuThread::ThreadId> threads{
|
std::vector<EuThread::ThreadId> threads{
|
||||||
{0, 0, 0, 0, 0},
|
{0, 0, 0, 0, 0},
|
||||||
@ -209,7 +209,7 @@ TEST_F(DebugApiWindowsAttentionTest, GivenNoContextWhenHandlingAttentionEventThe
|
|||||||
sessionMock->stoppedThreads[thread.packed] = 1;
|
sessionMock->stoppedThreads[thread.packed] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
l0HwHelper.getAttentionBitmaskForSingleThreads(threads, hwInfo, bitmask, bitmaskSize);
|
l0CoreHelper.getAttentionBitmaskForSingleThreads(threads, hwInfo, bitmask, bitmaskSize);
|
||||||
mockWddm->numEvents = 1;
|
mockWddm->numEvents = 1;
|
||||||
mockWddm->eventQueue[0].readEventType = DBGUMD_READ_EVENT_EU_ATTN_BIT_SET;
|
mockWddm->eventQueue[0].readEventType = DBGUMD_READ_EVENT_EU_ATTN_BIT_SET;
|
||||||
copyBitmaskToEventParams(&mockWddm->eventQueue[0].eventParamsBuffer.eventParamsBuffer, bitmask, bitmaskSize);
|
copyBitmaskToEventParams(&mockWddm->eventQueue[0].eventParamsBuffer.eventParamsBuffer, bitmask, bitmaskSize);
|
||||||
@ -251,7 +251,7 @@ TEST_F(DebugApiWindowsAttentionTest, GivenInterruptedThreadsWhenOnlySomeThreadsR
|
|||||||
std::unique_ptr<uint8_t[]> bitmask;
|
std::unique_ptr<uint8_t[]> bitmask;
|
||||||
size_t bitmaskSize = 0;
|
size_t bitmaskSize = 0;
|
||||||
auto &hwInfo = neoDevice->getHardwareInfo();
|
auto &hwInfo = neoDevice->getHardwareInfo();
|
||||||
auto &l0HwHelper = L0HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &l0CoreHelper = neoDevice->getRootDeviceEnvironment().getHelper<L0CoreHelper>();
|
||||||
|
|
||||||
std::vector<EuThread::ThreadId> threads{
|
std::vector<EuThread::ThreadId> threads{
|
||||||
{0, 0, 0, 0, 0}};
|
{0, 0, 0, 0, 0}};
|
||||||
@ -260,7 +260,7 @@ TEST_F(DebugApiWindowsAttentionTest, GivenInterruptedThreadsWhenOnlySomeThreadsR
|
|||||||
sessionMock->stoppedThreads[threads[0].packed] = 1;
|
sessionMock->stoppedThreads[threads[0].packed] = 1;
|
||||||
sessionMock->allContexts.insert(0x12345);
|
sessionMock->allContexts.insert(0x12345);
|
||||||
|
|
||||||
l0HwHelper.getAttentionBitmaskForSingleThreads(threads, hwInfo, bitmask, bitmaskSize);
|
l0CoreHelper.getAttentionBitmaskForSingleThreads(threads, hwInfo, bitmask, bitmaskSize);
|
||||||
ze_device_thread_t thread = {0, 0, 0, UINT32_MAX};
|
ze_device_thread_t thread = {0, 0, 0, UINT32_MAX};
|
||||||
ze_device_thread_t thread2 = {0, 0, 1, UINT32_MAX};
|
ze_device_thread_t thread2 = {0, 0, 1, UINT32_MAX};
|
||||||
sessionMock->pendingInterrupts.push_back(std::pair<ze_device_thread_t, bool>(thread, false));
|
sessionMock->pendingInterrupts.push_back(std::pair<ze_device_thread_t, bool>(thread, false));
|
||||||
|
Reference in New Issue
Block a user