@@ -36,18 +36,22 @@ PVCTEST_F(PVCDebugSession, givenPVCRevId3WhenGettingPerThreadScratchOffsetThenPe
3636 EuThread::ThreadId thread0Eu0 = {0 , 0 , 0 , 0 , 0 };
3737 EuThread::ThreadId thread0Eu1 = {0 , 0 , 0 , 1 , 0 };
3838 EuThread::ThreadId thread2Subslice1 = {0 , 0 , 1 , 0 , 2 };
39+ EuThread::ThreadId thread2EuLastSubslice1 = {0 , 0 , 1 , hwInfo.gtSystemInfo .MaxEuPerSubSlice - 1 , 2 };
3940
4041 const uint32_t ptss = 128 ;
41- const uint32_t adjustedPtss = hwInfoConfig.getThreadEuRatioForScratch (hwInfo) / numThreadsPerEu * ptss ;
42+ const uint32_t ratio = hwInfoConfig.getThreadEuRatioForScratch (hwInfo) / numThreadsPerEu;
4243
4344 EXPECT_EQ (2u , hwInfoConfig.getThreadEuRatioForScratch (hwInfo) / numThreadsPerEu);
4445
4546 auto offset = debugSession->getPerThreadScratchOffset (ptss, thread0Eu0);
4647 EXPECT_EQ (0u , offset);
4748
4849 offset = debugSession->getPerThreadScratchOffset (ptss, thread0Eu1);
49- EXPECT_EQ (adjustedPtss * numThreadsPerEu, offset);
50+ EXPECT_EQ (ptss * numThreadsPerEu * ratio , offset);
5051
5152 offset = debugSession->getPerThreadScratchOffset (ptss, thread2Subslice1);
52- EXPECT_EQ (2 * adjustedPtss + adjustedPtss * hwInfo.gtSystemInfo .MaxEuPerSubSlice * numThreadsPerEu, offset);
53+ EXPECT_EQ ((thread2Subslice1.subslice * hwInfo.gtSystemInfo .MaxEuPerSubSlice * numThreadsPerEu * ratio + thread2Subslice1.thread ) * ptss, offset);
54+
55+ offset = debugSession->getPerThreadScratchOffset (ptss, thread2EuLastSubslice1);
56+ EXPECT_EQ (((thread2EuLastSubslice1.subslice * hwInfo.gtSystemInfo .MaxEuPerSubSlice + thread2EuLastSubslice1.eu ) * numThreadsPerEu * ratio + thread2EuLastSubslice1.thread ) * ptss, offset);
5357}
0 commit comments