ULT renaming: Preemption tests

Related-To: NEO-2236

Signed-off-by: Adam Cetnerowski <adam.cetnerowski@intel.com>
This commit is contained in:
Adam Cetnerowski 2020-12-21 17:48:37 +01:00 committed by Compute-Runtime-Automation
parent 60cb486086
commit 1748d9751d
1 changed files with 24 additions and 24 deletions

View File

@ -32,7 +32,7 @@ class MidThreadPreemptionTests : public DevicePreemptionTests {
}
};
TEST_F(ThreadGroupPreemptionTests, disallowByKMD) {
TEST_F(ThreadGroupPreemptionTests, GivenDisallowedByKmdThenThreadGroupPreemptionIsDisabled) {
PreemptionFlags flags = {};
waTable->waDisablePerCtxtPreemptionGranularityControl = 1;
PreemptionHelper::setPreemptionLevelFlags(flags, device->getDevice(), kernel.get());
@ -40,7 +40,7 @@ TEST_F(ThreadGroupPreemptionTests, disallowByKMD) {
EXPECT_EQ(PreemptionMode::MidBatch, PreemptionHelper::taskPreemptionMode(device->getPreemptionMode(), flags));
}
TEST_F(ThreadGroupPreemptionTests, disallowByDevice) {
TEST_F(ThreadGroupPreemptionTests, GivenDisallowByDeviceThenThreadGroupPreemptionIsDisabled) {
PreemptionFlags flags = {};
device->setPreemptionMode(PreemptionMode::MidThread);
PreemptionHelper::setPreemptionLevelFlags(flags, device->getDevice(), kernel.get());
@ -48,7 +48,7 @@ TEST_F(ThreadGroupPreemptionTests, disallowByDevice) {
EXPECT_EQ(PreemptionMode::MidThread, PreemptionHelper::taskPreemptionMode(device->getPreemptionMode(), flags));
}
TEST_F(ThreadGroupPreemptionTests, disallowByReadWriteFencesWA) {
TEST_F(ThreadGroupPreemptionTests, GivenDisallowByReadWriteFencesWaThenThreadGroupPreemptionIsDisabled) {
PreemptionFlags flags = {};
kernelInfo->kernelDescriptor.kernelAttributes.flags.usesFencesForReadWriteImages = true;
waTable->waDisableLSQCROPERFforOCL = 1;
@ -57,7 +57,7 @@ TEST_F(ThreadGroupPreemptionTests, disallowByReadWriteFencesWA) {
EXPECT_EQ(PreemptionMode::MidBatch, PreemptionHelper::taskPreemptionMode(device->getPreemptionMode(), flags));
}
TEST_F(ThreadGroupPreemptionTests, disallowBySchedulerKernel) {
TEST_F(ThreadGroupPreemptionTests, GivenDisallowBySchedulerKernelThenThreadGroupPreemptionIsDisabled) {
PreemptionFlags flags = {};
kernel.reset(new MockKernel(program.get(),
MockKernel::toKernelInfoContainer(*kernelInfo, rootDeviceIndex), true));
@ -66,7 +66,7 @@ TEST_F(ThreadGroupPreemptionTests, disallowBySchedulerKernel) {
EXPECT_EQ(PreemptionMode::MidBatch, PreemptionHelper::taskPreemptionMode(device->getPreemptionMode(), flags));
}
TEST_F(ThreadGroupPreemptionTests, disallowByVmeKernel) {
TEST_F(ThreadGroupPreemptionTests, GivenDisallowByVmeKernelThenThreadGroupPreemptionIsDisabled) {
PreemptionFlags flags = {};
kernelInfo->isVmeWorkload = true;
kernel.reset(new MockKernel(program.get(), MockKernel::toKernelInfoContainer(*kernelInfo, rootDeviceIndex)));
@ -75,13 +75,13 @@ TEST_F(ThreadGroupPreemptionTests, disallowByVmeKernel) {
EXPECT_EQ(PreemptionMode::MidBatch, PreemptionHelper::taskPreemptionMode(device->getPreemptionMode(), flags));
}
TEST_F(ThreadGroupPreemptionTests, simpleAllow) {
TEST_F(ThreadGroupPreemptionTests, GivenDefaultThenThreadGroupPreemptionIsEnabled) {
PreemptionFlags flags = {};
EXPECT_TRUE(PreemptionHelper::allowThreadGroupPreemption(flags));
EXPECT_EQ(PreemptionMode::ThreadGroup, PreemptionHelper::taskPreemptionMode(device->getPreemptionMode(), flags));
}
TEST_F(ThreadGroupPreemptionTests, allowDefaultModeForNonKernelRequest) {
TEST_F(ThreadGroupPreemptionTests, GivenDefaultModeForNonKernelRequestThenThreadGroupPreemptionIsEnabled) {
PreemptionFlags flags = {};
PreemptionHelper::setPreemptionLevelFlags(flags, device->getDevice(), nullptr);
EXPECT_EQ(PreemptionMode::ThreadGroup, PreemptionHelper::taskPreemptionMode(device->getPreemptionMode(), flags));
@ -105,33 +105,33 @@ TEST_F(ThreadGroupPreemptionTests, givenKernelWithEnvironmentPatchSetWhenLSQCWaI
EXPECT_EQ(PreemptionMode::ThreadGroup, PreemptionHelper::taskPreemptionMode(device->getPreemptionMode(), flags));
}
TEST_F(ThreadGroupPreemptionTests, allowMidBatch) {
TEST_F(ThreadGroupPreemptionTests, GivenDefaultThenMidBatchPreemptionIsEnabled) {
PreemptionFlags flags = {};
device->setPreemptionMode(PreemptionMode::MidBatch);
PreemptionHelper::setPreemptionLevelFlags(flags, device->getDevice(), nullptr);
EXPECT_EQ(PreemptionMode::MidBatch, PreemptionHelper::taskPreemptionMode(device->getPreemptionMode(), flags));
}
TEST_F(ThreadGroupPreemptionTests, disallowWhenAdjustedDisabled) {
TEST_F(ThreadGroupPreemptionTests, GivenDisabledThenPreemptionIsDisabled) {
PreemptionFlags flags = {};
device->setPreemptionMode(PreemptionMode::Disabled);
PreemptionHelper::setPreemptionLevelFlags(flags, device->getDevice(), nullptr);
EXPECT_EQ(PreemptionMode::Disabled, PreemptionHelper::taskPreemptionMode(device->getPreemptionMode(), flags));
}
TEST_F(ThreadGroupPreemptionTests, returnDefaultDeviceModeForZeroSizedMdi) {
TEST_F(ThreadGroupPreemptionTests, GivenZeroSizedMdiThenThreadGroupPreemptioIsEnabled) {
MultiDispatchInfo multiDispatchInfo;
EXPECT_EQ(PreemptionMode::ThreadGroup, PreemptionHelper::taskPreemptionMode(device->getDevice(), multiDispatchInfo));
}
TEST_F(ThreadGroupPreemptionTests, returnDefaultDeviceModeForValidKernelsInMdi) {
TEST_F(ThreadGroupPreemptionTests, GivenValidKernelsInMdiThenThreadGroupPreemptioIsEnabled) {
MultiDispatchInfo multiDispatchInfo;
multiDispatchInfo.push(*dispatchInfo);
multiDispatchInfo.push(*dispatchInfo);
EXPECT_EQ(PreemptionMode::ThreadGroup, PreemptionHelper::taskPreemptionMode(device->getDevice(), multiDispatchInfo));
}
TEST_F(ThreadGroupPreemptionTests, disallowDefaultDeviceModeForValidKernelsInMdiAndDisabledPremption) {
TEST_F(ThreadGroupPreemptionTests, GivenValidKernelsInMdiAndDisabledPremptionThenPreemptionIsDisabled) {
device->setPreemptionMode(PreemptionMode::Disabled);
MultiDispatchInfo multiDispatchInfo;
multiDispatchInfo.push(*dispatchInfo);
@ -139,7 +139,7 @@ TEST_F(ThreadGroupPreemptionTests, disallowDefaultDeviceModeForValidKernelsInMdi
EXPECT_EQ(PreemptionMode::Disabled, PreemptionHelper::taskPreemptionMode(device->getDevice(), multiDispatchInfo));
}
TEST_F(ThreadGroupPreemptionTests, disallowDefaultDeviceModeWhenAtLeastOneInvalidKernelInMdi) {
TEST_F(ThreadGroupPreemptionTests, GivenAtLeastOneInvalidKernelInMdiThenPreemptionIsDisabled) {
MockKernel schedulerKernel(program.get(), MockKernel::toKernelInfoContainer(*kernelInfo, rootDeviceIndex), true);
DispatchInfo schedulerDispatchInfo(device.get(), &schedulerKernel, 1, Vec3<size_t>(1, 1, 1), Vec3<size_t>(1, 1, 1), Vec3<size_t>(0, 0, 0));
@ -155,7 +155,7 @@ TEST_F(ThreadGroupPreemptionTests, disallowDefaultDeviceModeWhenAtLeastOneInvali
EXPECT_EQ(PreemptionMode::MidBatch, PreemptionHelper::taskPreemptionMode(device->getDevice(), multiDispatchInfo));
}
TEST_F(MidThreadPreemptionTests, allowMidThreadPreemption) {
TEST_F(MidThreadPreemptionTests, GivenMidThreadPreemptionThenMidThreadPreemptionIsEnabled) {
PreemptionFlags flags = {};
device->setPreemptionMode(PreemptionMode::MidThread);
kernelInfo->kernelDescriptor.kernelAttributes.flags.requiresDisabledMidThreadPreemption = false;
@ -163,14 +163,14 @@ TEST_F(MidThreadPreemptionTests, allowMidThreadPreemption) {
EXPECT_TRUE(PreemptionHelper::allowMidThreadPreemption(flags));
}
TEST_F(MidThreadPreemptionTests, allowMidThreadPreemptionNullKernel) {
TEST_F(MidThreadPreemptionTests, GivenNullKernelThenMidThreadPreemptionIsEnabled) {
PreemptionFlags flags = {};
device->setPreemptionMode(PreemptionMode::MidThread);
PreemptionHelper::setPreemptionLevelFlags(flags, device->getDevice(), nullptr);
EXPECT_TRUE(PreemptionHelper::allowMidThreadPreemption(flags));
}
TEST_F(MidThreadPreemptionTests, allowMidThreadPreemptionDeviceSupportPreemptionOnVmeKernel) {
TEST_F(MidThreadPreemptionTests, GivenMidThreadPreemptionDeviceSupportPreemptionOnVmeKernelThenMidThreadPreemptionIsEnabled) {
PreemptionFlags flags = {};
device->setPreemptionMode(PreemptionMode::MidThread);
device->sharedDeviceInfo.vmeAvcSupportsPreemption = true;
@ -180,7 +180,7 @@ TEST_F(MidThreadPreemptionTests, allowMidThreadPreemptionDeviceSupportPreemption
EXPECT_TRUE(PreemptionHelper::allowMidThreadPreemption(flags));
}
TEST_F(MidThreadPreemptionTests, disallowMidThreadPreemptionByDevice) {
TEST_F(MidThreadPreemptionTests, GivenDisallowMidThreadPreemptionByDeviceThenMidThreadPreemptionIsEnabled) {
PreemptionFlags flags = {};
device->setPreemptionMode(PreemptionMode::ThreadGroup);
kernelInfo->kernelDescriptor.kernelAttributes.flags.requiresDisabledMidThreadPreemption = false;
@ -189,7 +189,7 @@ TEST_F(MidThreadPreemptionTests, disallowMidThreadPreemptionByDevice) {
EXPECT_EQ(PreemptionMode::ThreadGroup, PreemptionHelper::taskPreemptionMode(device->getPreemptionMode(), flags));
}
TEST_F(MidThreadPreemptionTests, disallowMidThreadPreemptionByKernel) {
TEST_F(MidThreadPreemptionTests, GivenDisallowMidThreadPreemptionByKernelThenMidThreadPreemptionIsEnabled) {
PreemptionFlags flags = {};
device->setPreemptionMode(PreemptionMode::MidThread);
kernelInfo->kernelDescriptor.kernelAttributes.flags.requiresDisabledMidThreadPreemption = true;
@ -197,7 +197,7 @@ TEST_F(MidThreadPreemptionTests, disallowMidThreadPreemptionByKernel) {
EXPECT_FALSE(PreemptionHelper::allowMidThreadPreemption(flags));
}
TEST_F(MidThreadPreemptionTests, disallowMidThreadPreemptionByVmeKernel) {
TEST_F(MidThreadPreemptionTests, GivenDisallowMidThreadPreemptionByVmeKernelThenMidThreadPreemptionIsEnabled) {
PreemptionFlags flags = {};
device->setPreemptionMode(PreemptionMode::MidThread);
device->sharedDeviceInfo.vmeAvcSupportsPreemption = false;
@ -207,7 +207,7 @@ TEST_F(MidThreadPreemptionTests, disallowMidThreadPreemptionByVmeKernel) {
EXPECT_FALSE(PreemptionHelper::allowMidThreadPreemption(flags));
}
TEST_F(MidThreadPreemptionTests, taskPreemptionDisallowMidThreadByDevice) {
TEST_F(MidThreadPreemptionTests, GivenTaskPreemptionDisallowMidThreadByDeviceThenThreadGroupPreemptionIsEnabled) {
PreemptionFlags flags = {};
kernelInfo->kernelDescriptor.kernelAttributes.flags.requiresDisabledMidThreadPreemption = false;
device->setPreemptionMode(PreemptionMode::ThreadGroup);
@ -216,7 +216,7 @@ TEST_F(MidThreadPreemptionTests, taskPreemptionDisallowMidThreadByDevice) {
EXPECT_EQ(PreemptionMode::ThreadGroup, outMode);
}
TEST_F(MidThreadPreemptionTests, taskPreemptionDisallowMidThreadByKernel) {
TEST_F(MidThreadPreemptionTests, GivenTaskPreemptionDisallowMidThreadByKernelThenThreadGroupPreemptionIsEnabled) {
PreemptionFlags flags = {};
kernelInfo->kernelDescriptor.kernelAttributes.flags.requiresDisabledMidThreadPreemption = true;
device->setPreemptionMode(PreemptionMode::MidThread);
@ -225,7 +225,7 @@ TEST_F(MidThreadPreemptionTests, taskPreemptionDisallowMidThreadByKernel) {
EXPECT_EQ(PreemptionMode::ThreadGroup, outMode);
}
TEST_F(MidThreadPreemptionTests, taskPreemptionDisallowMidThreadByVmeKernel) {
TEST_F(MidThreadPreemptionTests, GivenTaskPreemptionDisallowMidThreadByVmeKernelThenThreadGroupPreemptionIsEnabled) {
PreemptionFlags flags = {};
kernelInfo->isVmeWorkload = true;
device->sharedDeviceInfo.vmeAvcSupportsPreemption = false;
@ -237,7 +237,7 @@ TEST_F(MidThreadPreemptionTests, taskPreemptionDisallowMidThreadByVmeKernel) {
EXPECT_EQ(PreemptionMode::MidBatch, outMode);
}
TEST_F(MidThreadPreemptionTests, taskPreemptionAllow) {
TEST_F(MidThreadPreemptionTests, GivenDeviceSupportsMidThreadPreemptionThenMidThreadPreemptionIsEnabled) {
PreemptionFlags flags = {};
kernelInfo->kernelDescriptor.kernelAttributes.flags.requiresDisabledMidThreadPreemption = false;
device->setPreemptionMode(PreemptionMode::MidThread);
@ -246,7 +246,7 @@ TEST_F(MidThreadPreemptionTests, taskPreemptionAllow) {
EXPECT_EQ(PreemptionMode::MidThread, outMode);
}
TEST_F(MidThreadPreemptionTests, taskPreemptionAllowDeviceSupportsPreemptionOnVmeKernel) {
TEST_F(MidThreadPreemptionTests, GivenTaskPreemptionAllowDeviceSupportsPreemptionOnVmeKernelThenMidThreadPreemptionIsEnabled) {
PreemptionFlags flags = {};
kernelInfo->kernelDescriptor.kernelAttributes.flags.requiresDisabledMidThreadPreemption = false;
kernelInfo->isVmeWorkload = true;