@@ -32,23 +32,23 @@ class MidThreadPreemptionTests : public DevicePreemptionTests {
3232 }
3333};
3434
35- TEST_F (ThreadGroupPreemptionTests, disallowByKMD ) {
35+ TEST_F (ThreadGroupPreemptionTests, GivenDisallowedByKmdThenThreadGroupPreemptionIsDisabled ) {
3636 PreemptionFlags flags = {};
3737 waTable->waDisablePerCtxtPreemptionGranularityControl = 1 ;
3838 PreemptionHelper::setPreemptionLevelFlags (flags, device->getDevice (), kernel.get ());
3939 EXPECT_FALSE (PreemptionHelper::allowThreadGroupPreemption (flags));
4040 EXPECT_EQ (PreemptionMode::MidBatch, PreemptionHelper::taskPreemptionMode (device->getPreemptionMode (), flags));
4141}
4242
43- TEST_F (ThreadGroupPreemptionTests, disallowByDevice ) {
43+ TEST_F (ThreadGroupPreemptionTests, GivenDisallowByDeviceThenThreadGroupPreemptionIsDisabled ) {
4444 PreemptionFlags flags = {};
4545 device->setPreemptionMode (PreemptionMode::MidThread);
4646 PreemptionHelper::setPreemptionLevelFlags (flags, device->getDevice (), kernel.get ());
4747 EXPECT_TRUE (PreemptionHelper::allowThreadGroupPreemption (flags));
4848 EXPECT_EQ (PreemptionMode::MidThread, PreemptionHelper::taskPreemptionMode (device->getPreemptionMode (), flags));
4949}
5050
51- TEST_F (ThreadGroupPreemptionTests, disallowByReadWriteFencesWA ) {
51+ TEST_F (ThreadGroupPreemptionTests, GivenDisallowByReadWriteFencesWaThenThreadGroupPreemptionIsDisabled ) {
5252 PreemptionFlags flags = {};
5353 kernelInfo->kernelDescriptor .kernelAttributes .flags .usesFencesForReadWriteImages = true ;
5454 waTable->waDisableLSQCROPERFforOCL = 1 ;
@@ -57,7 +57,7 @@ TEST_F(ThreadGroupPreemptionTests, disallowByReadWriteFencesWA) {
5757 EXPECT_EQ (PreemptionMode::MidBatch, PreemptionHelper::taskPreemptionMode (device->getPreemptionMode (), flags));
5858}
5959
60- TEST_F (ThreadGroupPreemptionTests, disallowBySchedulerKernel ) {
60+ TEST_F (ThreadGroupPreemptionTests, GivenDisallowBySchedulerKernelThenThreadGroupPreemptionIsDisabled ) {
6161 PreemptionFlags flags = {};
6262 kernel.reset (new MockKernel (program.get (),
6363 MockKernel::toKernelInfoContainer (*kernelInfo, rootDeviceIndex), true ));
@@ -66,7 +66,7 @@ TEST_F(ThreadGroupPreemptionTests, disallowBySchedulerKernel) {
6666 EXPECT_EQ (PreemptionMode::MidBatch, PreemptionHelper::taskPreemptionMode (device->getPreemptionMode (), flags));
6767}
6868
69- TEST_F (ThreadGroupPreemptionTests, disallowByVmeKernel ) {
69+ TEST_F (ThreadGroupPreemptionTests, GivenDisallowByVmeKernelThenThreadGroupPreemptionIsDisabled ) {
7070 PreemptionFlags flags = {};
7171 kernelInfo->isVmeWorkload = true ;
7272 kernel.reset (new MockKernel (program.get (), MockKernel::toKernelInfoContainer (*kernelInfo, rootDeviceIndex)));
@@ -75,13 +75,13 @@ TEST_F(ThreadGroupPreemptionTests, disallowByVmeKernel) {
7575 EXPECT_EQ (PreemptionMode::MidBatch, PreemptionHelper::taskPreemptionMode (device->getPreemptionMode (), flags));
7676}
7777
78- TEST_F (ThreadGroupPreemptionTests, simpleAllow ) {
78+ TEST_F (ThreadGroupPreemptionTests, GivenDefaultThenThreadGroupPreemptionIsEnabled ) {
7979 PreemptionFlags flags = {};
8080 EXPECT_TRUE (PreemptionHelper::allowThreadGroupPreemption (flags));
8181 EXPECT_EQ (PreemptionMode::ThreadGroup, PreemptionHelper::taskPreemptionMode (device->getPreemptionMode (), flags));
8282}
8383
84- TEST_F (ThreadGroupPreemptionTests, allowDefaultModeForNonKernelRequest ) {
84+ TEST_F (ThreadGroupPreemptionTests, GivenDefaultModeForNonKernelRequestThenThreadGroupPreemptionIsEnabled ) {
8585 PreemptionFlags flags = {};
8686 PreemptionHelper::setPreemptionLevelFlags (flags, device->getDevice (), nullptr );
8787 EXPECT_EQ (PreemptionMode::ThreadGroup, PreemptionHelper::taskPreemptionMode (device->getPreemptionMode (), flags));
@@ -105,41 +105,41 @@ TEST_F(ThreadGroupPreemptionTests, givenKernelWithEnvironmentPatchSetWhenLSQCWaI
105105 EXPECT_EQ (PreemptionMode::ThreadGroup, PreemptionHelper::taskPreemptionMode (device->getPreemptionMode (), flags));
106106}
107107
108- TEST_F (ThreadGroupPreemptionTests, allowMidBatch ) {
108+ TEST_F (ThreadGroupPreemptionTests, GivenDefaultThenMidBatchPreemptionIsEnabled ) {
109109 PreemptionFlags flags = {};
110110 device->setPreemptionMode (PreemptionMode::MidBatch);
111111 PreemptionHelper::setPreemptionLevelFlags (flags, device->getDevice (), nullptr );
112112 EXPECT_EQ (PreemptionMode::MidBatch, PreemptionHelper::taskPreemptionMode (device->getPreemptionMode (), flags));
113113}
114114
115- TEST_F (ThreadGroupPreemptionTests, disallowWhenAdjustedDisabled ) {
115+ TEST_F (ThreadGroupPreemptionTests, GivenDisabledThenPreemptionIsDisabled ) {
116116 PreemptionFlags flags = {};
117117 device->setPreemptionMode (PreemptionMode::Disabled);
118118 PreemptionHelper::setPreemptionLevelFlags (flags, device->getDevice (), nullptr );
119119 EXPECT_EQ (PreemptionMode::Disabled, PreemptionHelper::taskPreemptionMode (device->getPreemptionMode (), flags));
120120}
121121
122- TEST_F (ThreadGroupPreemptionTests, returnDefaultDeviceModeForZeroSizedMdi ) {
122+ TEST_F (ThreadGroupPreemptionTests, GivenZeroSizedMdiThenThreadGroupPreemptioIsEnabled ) {
123123 MultiDispatchInfo multiDispatchInfo;
124124 EXPECT_EQ (PreemptionMode::ThreadGroup, PreemptionHelper::taskPreemptionMode (device->getDevice (), multiDispatchInfo));
125125}
126126
127- TEST_F (ThreadGroupPreemptionTests, returnDefaultDeviceModeForValidKernelsInMdi ) {
127+ TEST_F (ThreadGroupPreemptionTests, GivenValidKernelsInMdiThenThreadGroupPreemptioIsEnabled ) {
128128 MultiDispatchInfo multiDispatchInfo;
129129 multiDispatchInfo.push (*dispatchInfo);
130130 multiDispatchInfo.push (*dispatchInfo);
131131 EXPECT_EQ (PreemptionMode::ThreadGroup, PreemptionHelper::taskPreemptionMode (device->getDevice (), multiDispatchInfo));
132132}
133133
134- TEST_F (ThreadGroupPreemptionTests, disallowDefaultDeviceModeForValidKernelsInMdiAndDisabledPremption ) {
134+ TEST_F (ThreadGroupPreemptionTests, GivenValidKernelsInMdiAndDisabledPremptionThenPreemptionIsDisabled ) {
135135 device->setPreemptionMode (PreemptionMode::Disabled);
136136 MultiDispatchInfo multiDispatchInfo;
137137 multiDispatchInfo.push (*dispatchInfo);
138138 multiDispatchInfo.push (*dispatchInfo);
139139 EXPECT_EQ (PreemptionMode::Disabled, PreemptionHelper::taskPreemptionMode (device->getDevice (), multiDispatchInfo));
140140}
141141
142- TEST_F (ThreadGroupPreemptionTests, disallowDefaultDeviceModeWhenAtLeastOneInvalidKernelInMdi ) {
142+ TEST_F (ThreadGroupPreemptionTests, GivenAtLeastOneInvalidKernelInMdiThenPreemptionIsDisabled ) {
143143 MockKernel schedulerKernel (program.get (), MockKernel::toKernelInfoContainer (*kernelInfo, rootDeviceIndex), true );
144144 DispatchInfo schedulerDispatchInfo (device.get (), &schedulerKernel, 1 , Vec3<size_t >(1 , 1 , 1 ), Vec3<size_t >(1 , 1 , 1 ), Vec3<size_t >(0 , 0 , 0 ));
145145
@@ -155,22 +155,22 @@ TEST_F(ThreadGroupPreemptionTests, disallowDefaultDeviceModeWhenAtLeastOneInvali
155155 EXPECT_EQ (PreemptionMode::MidBatch, PreemptionHelper::taskPreemptionMode (device->getDevice (), multiDispatchInfo));
156156}
157157
158- TEST_F (MidThreadPreemptionTests, allowMidThreadPreemption ) {
158+ TEST_F (MidThreadPreemptionTests, GivenMidThreadPreemptionThenMidThreadPreemptionIsEnabled ) {
159159 PreemptionFlags flags = {};
160160 device->setPreemptionMode (PreemptionMode::MidThread);
161161 kernelInfo->kernelDescriptor .kernelAttributes .flags .requiresDisabledMidThreadPreemption = false ;
162162 PreemptionHelper::setPreemptionLevelFlags (flags, device->getDevice (), kernel.get ());
163163 EXPECT_TRUE (PreemptionHelper::allowMidThreadPreemption (flags));
164164}
165165
166- TEST_F (MidThreadPreemptionTests, allowMidThreadPreemptionNullKernel ) {
166+ TEST_F (MidThreadPreemptionTests, GivenNullKernelThenMidThreadPreemptionIsEnabled ) {
167167 PreemptionFlags flags = {};
168168 device->setPreemptionMode (PreemptionMode::MidThread);
169169 PreemptionHelper::setPreemptionLevelFlags (flags, device->getDevice (), nullptr );
170170 EXPECT_TRUE (PreemptionHelper::allowMidThreadPreemption (flags));
171171}
172172
173- TEST_F (MidThreadPreemptionTests, allowMidThreadPreemptionDeviceSupportPreemptionOnVmeKernel ) {
173+ TEST_F (MidThreadPreemptionTests, GivenMidThreadPreemptionDeviceSupportPreemptionOnVmeKernelThenMidThreadPreemptionIsEnabled ) {
174174 PreemptionFlags flags = {};
175175 device->setPreemptionMode (PreemptionMode::MidThread);
176176 device->sharedDeviceInfo .vmeAvcSupportsPreemption = true ;
@@ -180,7 +180,7 @@ TEST_F(MidThreadPreemptionTests, allowMidThreadPreemptionDeviceSupportPreemption
180180 EXPECT_TRUE (PreemptionHelper::allowMidThreadPreemption (flags));
181181}
182182
183- TEST_F (MidThreadPreemptionTests, disallowMidThreadPreemptionByDevice ) {
183+ TEST_F (MidThreadPreemptionTests, GivenDisallowMidThreadPreemptionByDeviceThenMidThreadPreemptionIsEnabled ) {
184184 PreemptionFlags flags = {};
185185 device->setPreemptionMode (PreemptionMode::ThreadGroup);
186186 kernelInfo->kernelDescriptor .kernelAttributes .flags .requiresDisabledMidThreadPreemption = false ;
@@ -189,15 +189,15 @@ TEST_F(MidThreadPreemptionTests, disallowMidThreadPreemptionByDevice) {
189189 EXPECT_EQ (PreemptionMode::ThreadGroup, PreemptionHelper::taskPreemptionMode (device->getPreemptionMode (), flags));
190190}
191191
192- TEST_F (MidThreadPreemptionTests, disallowMidThreadPreemptionByKernel ) {
192+ TEST_F (MidThreadPreemptionTests, GivenDisallowMidThreadPreemptionByKernelThenMidThreadPreemptionIsEnabled ) {
193193 PreemptionFlags flags = {};
194194 device->setPreemptionMode (PreemptionMode::MidThread);
195195 kernelInfo->kernelDescriptor .kernelAttributes .flags .requiresDisabledMidThreadPreemption = true ;
196196 PreemptionHelper::setPreemptionLevelFlags (flags, device->getDevice (), kernel.get ());
197197 EXPECT_FALSE (PreemptionHelper::allowMidThreadPreemption (flags));
198198}
199199
200- TEST_F (MidThreadPreemptionTests, disallowMidThreadPreemptionByVmeKernel ) {
200+ TEST_F (MidThreadPreemptionTests, GivenDisallowMidThreadPreemptionByVmeKernelThenMidThreadPreemptionIsEnabled ) {
201201 PreemptionFlags flags = {};
202202 device->setPreemptionMode (PreemptionMode::MidThread);
203203 device->sharedDeviceInfo .vmeAvcSupportsPreemption = false ;
@@ -207,7 +207,7 @@ TEST_F(MidThreadPreemptionTests, disallowMidThreadPreemptionByVmeKernel) {
207207 EXPECT_FALSE (PreemptionHelper::allowMidThreadPreemption (flags));
208208}
209209
210- TEST_F (MidThreadPreemptionTests, taskPreemptionDisallowMidThreadByDevice ) {
210+ TEST_F (MidThreadPreemptionTests, GivenTaskPreemptionDisallowMidThreadByDeviceThenThreadGroupPreemptionIsEnabled ) {
211211 PreemptionFlags flags = {};
212212 kernelInfo->kernelDescriptor .kernelAttributes .flags .requiresDisabledMidThreadPreemption = false ;
213213 device->setPreemptionMode (PreemptionMode::ThreadGroup);
@@ -216,7 +216,7 @@ TEST_F(MidThreadPreemptionTests, taskPreemptionDisallowMidThreadByDevice) {
216216 EXPECT_EQ (PreemptionMode::ThreadGroup, outMode);
217217}
218218
219- TEST_F (MidThreadPreemptionTests, taskPreemptionDisallowMidThreadByKernel ) {
219+ TEST_F (MidThreadPreemptionTests, GivenTaskPreemptionDisallowMidThreadByKernelThenThreadGroupPreemptionIsEnabled ) {
220220 PreemptionFlags flags = {};
221221 kernelInfo->kernelDescriptor .kernelAttributes .flags .requiresDisabledMidThreadPreemption = true ;
222222 device->setPreemptionMode (PreemptionMode::MidThread);
@@ -225,7 +225,7 @@ TEST_F(MidThreadPreemptionTests, taskPreemptionDisallowMidThreadByKernel) {
225225 EXPECT_EQ (PreemptionMode::ThreadGroup, outMode);
226226}
227227
228- TEST_F (MidThreadPreemptionTests, taskPreemptionDisallowMidThreadByVmeKernel ) {
228+ TEST_F (MidThreadPreemptionTests, GivenTaskPreemptionDisallowMidThreadByVmeKernelThenThreadGroupPreemptionIsEnabled ) {
229229 PreemptionFlags flags = {};
230230 kernelInfo->isVmeWorkload = true ;
231231 device->sharedDeviceInfo .vmeAvcSupportsPreemption = false ;
@@ -237,7 +237,7 @@ TEST_F(MidThreadPreemptionTests, taskPreemptionDisallowMidThreadByVmeKernel) {
237237 EXPECT_EQ (PreemptionMode::MidBatch, outMode);
238238}
239239
240- TEST_F (MidThreadPreemptionTests, taskPreemptionAllow ) {
240+ TEST_F (MidThreadPreemptionTests, GivenDeviceSupportsMidThreadPreemptionThenMidThreadPreemptionIsEnabled ) {
241241 PreemptionFlags flags = {};
242242 kernelInfo->kernelDescriptor .kernelAttributes .flags .requiresDisabledMidThreadPreemption = false ;
243243 device->setPreemptionMode (PreemptionMode::MidThread);
@@ -246,7 +246,7 @@ TEST_F(MidThreadPreemptionTests, taskPreemptionAllow) {
246246 EXPECT_EQ (PreemptionMode::MidThread, outMode);
247247}
248248
249- TEST_F (MidThreadPreemptionTests, taskPreemptionAllowDeviceSupportsPreemptionOnVmeKernel ) {
249+ TEST_F (MidThreadPreemptionTests, GivenTaskPreemptionAllowDeviceSupportsPreemptionOnVmeKernelThenMidThreadPreemptionIsEnabled ) {
250250 PreemptionFlags flags = {};
251251 kernelInfo->kernelDescriptor .kernelAttributes .flags .requiresDisabledMidThreadPreemption = false ;
252252 kernelInfo->isVmeWorkload = true ;
0 commit comments