@@ -36,18 +36,22 @@ PVCTEST_F(PVCDebugSession, givenPVCRevId3WhenGettingPerThreadScratchOffsetThenPe
36
36
EuThread::ThreadId thread0Eu0 = {0 , 0 , 0 , 0 , 0 };
37
37
EuThread::ThreadId thread0Eu1 = {0 , 0 , 0 , 1 , 0 };
38
38
EuThread::ThreadId thread2Subslice1 = {0 , 0 , 1 , 0 , 2 };
39
+ EuThread::ThreadId thread2EuLastSubslice1 = {0 , 0 , 1 , hwInfo.gtSystemInfo .MaxEuPerSubSlice - 1 , 2 };
39
40
40
41
const uint32_t ptss = 128 ;
41
- const uint32_t adjustedPtss = hwInfoConfig.getThreadEuRatioForScratch (hwInfo) / numThreadsPerEu * ptss ;
42
+ const uint32_t ratio = hwInfoConfig.getThreadEuRatioForScratch (hwInfo) / numThreadsPerEu;
42
43
43
44
EXPECT_EQ (2u , hwInfoConfig.getThreadEuRatioForScratch (hwInfo) / numThreadsPerEu);
44
45
45
46
auto offset = debugSession->getPerThreadScratchOffset (ptss, thread0Eu0);
46
47
EXPECT_EQ (0u , offset);
47
48
48
49
offset = debugSession->getPerThreadScratchOffset (ptss, thread0Eu1);
49
- EXPECT_EQ (adjustedPtss * numThreadsPerEu, offset);
50
+ EXPECT_EQ (ptss * numThreadsPerEu * ratio , offset);
50
51
51
52
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);
53
57
}
0 commit comments