Add preemption WA to make CSR surface uncacheable

Change-Id: Ia468c6f5df16522c3bc9aae22802895f2badc431
This commit is contained in:
Zdanowicz, Zbigniew
2018-01-04 17:48:46 +01:00
committed by sys_ocldev
parent e9fd40db13
commit 21f92d8258
24 changed files with 149 additions and 64 deletions

View File

@@ -63,7 +63,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenItIsCre
HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWhenMakeResidentCalledMultipleTimesAffectsResidencyOnce) {
std::unique_ptr<AUBCommandStreamReceiverHw<FamilyType>> aubCsr(new AUBCommandStreamReceiverHw<FamilyType>(*platformDevices[0]));
std::unique_ptr<MemoryManager> memoryManager(aubCsr->createMemoryManager(false));
auto gfxAllocation = memoryManager->allocateGraphicsMemory(sizeof(uint32_t), sizeof(uint32_t), false);
auto gfxAllocation = memoryManager->allocateGraphicsMemory(sizeof(uint32_t), sizeof(uint32_t), false, false);
// First makeResident marks the allocation resident
aubCsr->makeResident(*gfxAllocation);

View File

@@ -186,6 +186,7 @@ SKLTEST_F(HwInfoConfigTestLinuxSkl, configureHwInfoWaFlags) {
EXPECT_EQ(1u, outHwInfo.pWaTable->waCompressedResourceRequiresConstVA21);
EXPECT_EQ(1u, outHwInfo.pWaTable->waModifyVFEStateAfterGPGPUPreemption);
EXPECT_EQ(1u, outHwInfo.pWaTable->waDisablePerCtxtPreemptionGranularityControl);
EXPECT_EQ(1u, outHwInfo.pWaTable->waCSRUncachable);
ReleaseOutHwInfoStructs();
@@ -195,6 +196,7 @@ SKLTEST_F(HwInfoConfigTestLinuxSkl, configureHwInfoWaFlags) {
EXPECT_EQ(0u, outHwInfo.pWaTable->waCompressedResourceRequiresConstVA21);
EXPECT_EQ(1u, outHwInfo.pWaTable->waModifyVFEStateAfterGPGPUPreemption);
EXPECT_EQ(1u, outHwInfo.pWaTable->waDisablePerCtxtPreemptionGranularityControl);
EXPECT_EQ(1u, outHwInfo.pWaTable->waCSRUncachable);
ReleaseOutHwInfoStructs();
@@ -204,6 +206,17 @@ SKLTEST_F(HwInfoConfigTestLinuxSkl, configureHwInfoWaFlags) {
EXPECT_EQ(0u, outHwInfo.pWaTable->waCompressedResourceRequiresConstVA21);
EXPECT_EQ(0u, outHwInfo.pWaTable->waModifyVFEStateAfterGPGPUPreemption);
EXPECT_EQ(0u, outHwInfo.pWaTable->waDisablePerCtxtPreemptionGranularityControl);
EXPECT_EQ(1u, outHwInfo.pWaTable->waCSRUncachable);
ReleaseOutHwInfoStructs();
drm->StoredDeviceRevID = 6;
ret = hwInfoConfig->configureHwInfo(pInHwInfo, &outHwInfo, osInterface);
EXPECT_EQ(0, ret);
EXPECT_EQ(0u, outHwInfo.pWaTable->waCompressedResourceRequiresConstVA21);
EXPECT_EQ(0u, outHwInfo.pWaTable->waModifyVFEStateAfterGPGPUPreemption);
EXPECT_EQ(0u, outHwInfo.pWaTable->waDisablePerCtxtPreemptionGranularityControl);
EXPECT_EQ(0u, outHwInfo.pWaTable->waCSRUncachable);
}
SKLTEST_F(HwInfoConfigTestLinuxSkl, configureHwInfoEdram) {

View File

@@ -35,13 +35,13 @@ using namespace OCLRT;
class TestedMemoryManager : public OsAgnosticMemoryManager {
public:
GraphicsAllocation *allocateGraphicsMemory(size_t size, size_t alignment, bool forcePin) override {
GraphicsAllocation *allocateGraphicsMemory(size_t size, size_t alignment, bool forcePin, bool uncacheable) override {
EXPECT_NE(0u, expectedSize);
if (expectedSize == size) {
EXPECT_TRUE(forcePin);
allocCount++;
}
return OsAgnosticMemoryManager::allocateGraphicsMemory(size, alignment, forcePin);
return OsAgnosticMemoryManager::allocateGraphicsMemory(size, alignment, forcePin, uncacheable);
};
GraphicsAllocation *allocateGraphicsMemory64kb(size_t size, size_t alignment, bool forcePin) override {
return nullptr;

View File

@@ -43,10 +43,9 @@ class GmmTests : public ::testing::Test {
};
TEST_F(GmmTests, resourceCreation) {
MemoryManager *mm = new OsAgnosticMemoryManager;
std::unique_ptr<MemoryManager> mm(new OsAgnosticMemoryManager);
void *pSysMem = mm->allocateSystemMemory(4096, 4096);
auto gmm = Gmm::create(pSysMem, 4096);
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, 4096, false));
ASSERT_TRUE(gmm->gmmResourceInfo.get() != nullptr);
@@ -54,22 +53,34 @@ TEST_F(GmmTests, resourceCreation) {
EXPECT_EQ(gmm->resourceParams.Flags.Gpu.NoRestriction, 0u);
EXPECT_TRUE(pSysMem == pGmmSysMem);
delete gmm;
mm->freeSystemMemory(pSysMem);
delete mm;
}
TEST_F(GmmTests, resourceCleanupOnDelete) {
MemoryManager *mm = new OsAgnosticMemoryManager;
TEST_F(GmmTests, resourceCreationUncacheable) {
std::unique_ptr<MemoryManager> mm(new OsAgnosticMemoryManager);
void *pSysMem = mm->allocateSystemMemory(4096, 4096);
auto gmm = Gmm::create(pSysMem, 4096);
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, 4096, true));
ASSERT_TRUE(gmm->gmmResourceInfo.get() != nullptr);
void *pGmmSysMem = gmm->gmmResourceInfo->getSystemMemPointer(1);
EXPECT_EQ(gmm->resourceParams.Flags.Gpu.NoRestriction, 0u);
EXPECT_TRUE(pSysMem == pGmmSysMem);
EXPECT_EQ(GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC, gmm->resourceParams.Usage);
mm->freeSystemMemory(pSysMem);
}
TEST_F(GmmTests, resourceCleanupOnDelete) {
std::unique_ptr<MemoryManager> mm(new OsAgnosticMemoryManager);
void *pSysMem = mm->allocateSystemMemory(4096, 4096);
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, 4096, false));
ASSERT_TRUE(gmm->gmmResourceInfo.get() != nullptr);
delete gmm;
mm->freeSystemMemory(pSysMem);
delete mm;
}
TEST_F(GmmTests, GivenBufferSizeLargerThenMaxPitchWhenAskedForGmmCreationThenGMMResourceIsCreatedWithNoRestrictionsFlag) {
@@ -78,7 +89,7 @@ TEST_F(GmmTests, GivenBufferSizeLargerThenMaxPitchWhenAskedForGmmCreationThenGMM
MemoryManager *mm = new OsAgnosticMemoryManager;
void *pSysMem = mm->allocateSystemMemory(4096, 4096);
auto gmmRes = Gmm::create(pSysMem, maxSize);
auto gmmRes = Gmm::create(pSysMem, maxSize, false);
ASSERT_TRUE(gmmRes->gmmResourceInfo.get() != nullptr);
@@ -91,7 +102,7 @@ TEST_F(GmmTests, GivenBufferSizeLargerThenMaxPitchWhenAskedForGmmCreationThenGMM
TEST_F(GmmTests, givenGmmCreatedFromExistingGmmThenHelperDoesNotReleaseParentGmm) {
auto size = 4096u;
void *incomingPtr = (void *)0x1000;
auto gmmRes = Gmm::create(incomingPtr, size);
auto gmmRes = Gmm::create(incomingPtr, size, false);
auto gmmRes2 = Gmm::create(gmmRes->gmmResourceInfo->peekHandle());
//copy is being made

View File

@@ -1089,7 +1089,7 @@ TEST(OsAgnosticMemoryManager, checkAllocationsForOverlappingWithNullCsrInMemoryM
}
TEST_F(MemoryAllocatorTest, GivenSizeWhenGmmIsCreatedThenSuccess) {
Gmm *gmm = Gmm::create(nullptr, 65536);
Gmm *gmm = Gmm::create(nullptr, 65536, false);
EXPECT_NE(nullptr, gmm);
delete gmm;
}

View File

@@ -114,12 +114,12 @@ class FailMemoryManager : public MemoryManager {
}
applyCommonCleanup();
};
GraphicsAllocation *allocateGraphicsMemory(size_t size, size_t alignment, bool forcePin) override {
GraphicsAllocation *allocateGraphicsMemory(size_t size, size_t alignment, bool forcePin, bool uncacheable) override {
if (fail <= 0) {
return nullptr;
}
fail--;
GraphicsAllocation *alloc = agnostic->allocateGraphicsMemory(size, alignment, forcePin);
GraphicsAllocation *alloc = agnostic->allocateGraphicsMemory(size, alignment, forcePin, uncacheable);
allocations.push_back(alloc);
return alloc;
};

View File

@@ -168,7 +168,7 @@ TEST_F(DrmMemoryManagerTest, pinAfterAllocateWhenAskedAndAllowedAndBigAllocation
auto mm = new (std::nothrow) TestedDrmMemoryManager(this->mock, true);
ASSERT_NE(nullptr, mm->getPinBB());
auto alloc = mm->allocateGraphicsMemory(10 * 1014 * 1024, 1024, true);
auto alloc = mm->allocateGraphicsMemory(10 * 1014 * 1024, 1024, true, false);
ASSERT_NE(nullptr, alloc);
EXPECT_NE(nullptr, alloc->getBO());
@@ -184,7 +184,7 @@ TEST_F(DrmMemoryManagerTest, doNotPinAfterAllocateWhenAskedAndAllowedButSmallAll
ASSERT_NE(nullptr, mm->getPinBB());
// one page is too small for early pinning
auto alloc = mm->allocateGraphicsMemory(4 * 1024, 1024, true);
auto alloc = mm->allocateGraphicsMemory(4 * 1024, 1024, true, false);
ASSERT_NE(nullptr, alloc);
EXPECT_NE(nullptr, alloc->getBO());
@@ -199,7 +199,7 @@ TEST_F(DrmMemoryManagerTest, doNotPinAfterAllocateWhenNotAskedButAllowed) {
auto mm = new (std::nothrow) TestedDrmMemoryManager(this->mock, true);
ASSERT_NE(nullptr, mm->getPinBB());
auto alloc = mm->allocateGraphicsMemory(1024, 1024, false);
auto alloc = mm->allocateGraphicsMemory(1024, 1024, false, false);
ASSERT_NE(nullptr, alloc);
EXPECT_NE(nullptr, alloc->getBO());
@@ -214,7 +214,7 @@ TEST_F(DrmMemoryManagerTest, doNotPinAfterAllocateWhenAskedButNotAllowed) {
auto mm = new (std::nothrow) TestedDrmMemoryManager(this->mock, false);
ASSERT_EQ(nullptr, mm->getPinBB());
auto alloc = mm->allocateGraphicsMemory(1024, 1024, true);
auto alloc = mm->allocateGraphicsMemory(1024, 1024, true, false);
ASSERT_NE(nullptr, alloc);
EXPECT_NE(nullptr, alloc->getBO());

View File

@@ -99,7 +99,7 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromSharedHandle
auto size = 4096u;
void *pSysMem = (void *)0x1000;
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, 4096u));
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, 4096u, false));
auto status = setSizesFunction(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
auto *gpuAllocation = mm->createGraphicsAllocationFromSharedHandle(osHandle, false);
@@ -116,7 +116,7 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromNTHandleIsCa
auto size = 4096u;
void *pSysMem = (void *)0x1000;
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, 4096u));
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, 4096u, false));
auto status = setSizesFunction(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
auto *gpuAllocation = mm->createGraphicsAllocationFromNTHandle((void *)1);
@@ -150,7 +150,7 @@ HWTEST_F(WddmMemoryManagerTest, createAllocationFromSharedHandleReturns32BitAllo
auto size = 4096u;
void *pSysMem = (void *)0x1000;
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, 4096u));
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, 4096u, false));
auto status = setSizesFunction(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
mm->setForce32BitAllocations(true);
@@ -173,7 +173,7 @@ HWTEST_F(WddmMemoryManagerTest, createAllocationFromSharedHandleDoesNotReturn32B
auto size = 4096u;
void *pSysMem = (void *)0x1000;
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, 4096u));
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, 4096u, false));
auto status = setSizesFunction(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
mm->setForce32BitAllocations(true);
@@ -196,7 +196,7 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenFreeAllocFromSharedHan
auto size = 4096u;
void *pSysMem = (void *)0x1000;
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, 4096u));
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, 4096u, false));
auto status = setSizesFunction(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
auto gpuAllocation = (WddmAllocation *)mm->createGraphicsAllocationFromSharedHandle(osHandle, false);
@@ -218,7 +218,7 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerSizeZeroWhenCreateFromShar
auto size = 4096u;
void *pSysMem = (void *)0x1000;
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, size));
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, size, false));
auto status = setSizesFunction(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
auto *gpuAllocation = mm->createGraphicsAllocationFromSharedHandle(osHandle, false);
@@ -233,7 +233,7 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromSharedHandle
auto size = 4096u;
void *pSysMem = (void *)0x1000;
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, size));
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, size, false));
auto status = setSizesFunction(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
mockWddm->failOpenSharedHandle = true;
@@ -504,7 +504,7 @@ HWTEST_F(WddmMemoryManagerTest, GivenThreeOsHandlesWhenAskedForDestroyAllocation
storage.fragmentStorageData[0].osHandleStorage->handle = ALLOCATION_HANDLE;
storage.fragmentStorageData[0].freeTheFragment = true;
storage.fragmentStorageData[0].osHandleStorage->gmm = Gmm::create(pSysMem, 4096u);
storage.fragmentStorageData[0].osHandleStorage->gmm = Gmm::create(pSysMem, 4096u, false);
storage.fragmentStorageData[1].osHandleStorage = new OsHandle;
storage.fragmentStorageData[1].osHandleStorage->handle = ALLOCATION_HANDLE;
@@ -515,7 +515,7 @@ HWTEST_F(WddmMemoryManagerTest, GivenThreeOsHandlesWhenAskedForDestroyAllocation
storage.fragmentStorageData[2].osHandleStorage = new OsHandle;
storage.fragmentStorageData[2].osHandleStorage->handle = ALLOCATION_HANDLE;
storage.fragmentStorageData[2].freeTheFragment = true;
storage.fragmentStorageData[2].osHandleStorage->gmm = Gmm::create(pSysMem, 4096u);
storage.fragmentStorageData[2].osHandleStorage->gmm = Gmm::create(pSysMem, 4096u, false);
storage.fragmentStorageData[2].residency = new ResidencyData;
mm->cleanOsHandles(storage);
@@ -1585,7 +1585,7 @@ TEST_F(MockWddmMemoryManagerTest, givenDisabledAsyncDeleterFlagWhenMemoryManager
}
HWTEST_F(MockWddmMemoryManagerTest, givenRenderCompressedAllocationWhenMappedGpuVaThenMapAuxVa) {
std::unique_ptr<Gmm> gmm(Gmm::create((void *)123, 4096u));
std::unique_ptr<Gmm> gmm(Gmm::create((void *)123, 4096u, false));
gmm->isRenderCompressed = true;
D3DGPU_VIRTUAL_ADDRESS gpuVa = 0;
WddmMock wddm;
@@ -1653,7 +1653,7 @@ HWTEST_F(MockWddmMemoryManagerTest, givenNonRenderCompressedAllocationWhenReleas
}
HWTEST_F(MockWddmMemoryManagerTest, givenNonRenderCompressedAllocationWhenMappedGpuVaThenDontMapAuxVa) {
std::unique_ptr<Gmm> gmm(Gmm::create((void *)123, 4096u));
std::unique_ptr<Gmm> gmm(Gmm::create((void *)123, 4096u, false));
gmm->isRenderCompressed = false;
D3DGPU_VIRTUAL_ADDRESS gpuVa = 0;
WddmMock wddm;
@@ -1669,7 +1669,7 @@ HWTEST_F(MockWddmMemoryManagerTest, givenNonRenderCompressedAllocationWhenMapped
}
HWTEST_F(MockWddmMemoryManagerTest, givenFailingAllocationWhenMappedGpuVaThenReturnFalse) {
std::unique_ptr<Gmm> gmm(Gmm::create((void *)123, 4096u));
std::unique_ptr<Gmm> gmm(Gmm::create((void *)123, 4096u, false));
gmm->isRenderCompressed = false;
D3DGPU_VIRTUAL_ADDRESS gpuVa = 0;
WddmMock wddm;
@@ -1688,7 +1688,7 @@ HWTEST_F(MockWddmMemoryManagerTest, givenRenderCompressedFlagSetWhenInternalIsUn
auto mockMngr = new NiceMock<MockGmmPageTableMngr>();
wddm->resetPageTableManager(mockMngr);
auto myGmm = Gmm::create((void *)123, 4096u);
auto myGmm = Gmm::create((void *)123, 4096u, false);
myGmm->isRenderCompressed = false;
myGmm->gmmResourceInfo->getResourceFlags()->Info.RenderCompressed = 1;

View File

@@ -316,7 +316,7 @@ TEST_F(WddmTest, GetCpuGpuTime) {
HWTEST_F(WddmTest, givenSharedHandleWhenCreateGraphicsAllocationFromSharedHandleIsCalledThenGraphicsAllocationWithSharedPropertiesIsCreated) {
void *pSysMem = (void *)0x1000;
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, 4096u));
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, 4096u, false));
auto status = setSizesFunction(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
EXPECT_EQ(0u, status);
@@ -355,7 +355,7 @@ HWTEST_F(WddmTest, givenSharedHandleWhenCreateGraphicsAllocationFromSharedHandle
HWTEST_F(WddmTest, givenSharedHandleWhenCreateGraphicsAllocationFromSharedHandleIsCalledThenMapGpuVaWithCpuPtrDepensOnBitness) {
void *pSysMem = (void *)0x1000;
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, 4096u));
std::unique_ptr<Gmm> gmm(Gmm::create(pSysMem, 4096u, false));
auto status = setSizesFunction(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u);
EXPECT_EQ(0u, status);

View File

@@ -21,11 +21,27 @@
*/
#include "unit_tests/preemption/preemption_tests.h"
#include "runtime/helpers/options.h"
using namespace OCLRT;
typedef DevicePreemptionTests ThreadGroupPreemptionTests;
typedef DevicePreemptionTests MidThreadPreemptionTests;
class ThreadGroupPreemptionTests : public DevicePreemptionTests {
void SetUp() override {
dbgRestore = new DebugManagerStateRestore();
DebugManager.flags.ForcePreemptionMode.set(static_cast<int32_t>(PreemptionMode::ThreadGroup));
preemptionMode = PreemptionMode::ThreadGroup;
DevicePreemptionTests::SetUp();
}
};
class MidThreadPreemptionTests : public DevicePreemptionTests {
void SetUp() override {
dbgRestore = new DebugManagerStateRestore();
DebugManager.flags.ForcePreemptionMode.set(static_cast<int32_t>(PreemptionMode::MidThread));
preemptionMode = PreemptionMode::MidThread;
DevicePreemptionTests::SetUp();
}
};
TEST_F(ThreadGroupPreemptionTests, disallowByKMD) {
waTable->waDisablePerCtxtPreemptionGranularityControl = 1;
@@ -269,3 +285,37 @@ TEST_F(DevicePreemptionTests, setDefaultDisabledPreemptionNoMidBatchSupport) {
TEST(PreemptionTest, defaultMode) {
EXPECT_EQ(0, DebugManager.flags.ForcePreemptionMode.get());
}
HWTEST_F(MidThreadPreemptionTests, createCsrSurfaceNoWa) {
const WorkaroundTable *waTable = platformDevices[0]->pWaTable;
WorkaroundTable tmpWaTable;
tmpWaTable.waCSRUncachable = false;
const_cast<HardwareInfo *>(platformDevices[0])->pWaTable = &tmpWaTable;
std::unique_ptr<MockDevice> mockDevice(Device::create<OCLRT::MockDevice>(platformDevices[0]));
ASSERT_NE(nullptr, mockDevice.get());
auto &csr = mockDevice->getUltCommandStreamReceiver<FamilyType>();
MemoryAllocation *csrSurface = static_cast<MemoryAllocation *>(csr.getPreemptionCsrAllocation());
ASSERT_NE(nullptr, csrSurface);
EXPECT_FALSE(csrSurface->uncacheable);
const_cast<HardwareInfo *>(platformDevices[0])->pWaTable = waTable;
}
HWTEST_F(MidThreadPreemptionTests, createCsrSurfaceWa) {
const WorkaroundTable *waTable = platformDevices[0]->pWaTable;
WorkaroundTable tmpWaTable;
tmpWaTable.waCSRUncachable = true;
const_cast<HardwareInfo *>(platformDevices[0])->pWaTable = &tmpWaTable;
std::unique_ptr<MockDevice> mockDevice(Device::create<OCLRT::MockDevice>(platformDevices[0]));
ASSERT_NE(nullptr, mockDevice.get());
auto &csr = mockDevice->getUltCommandStreamReceiver<FamilyType>();
MemoryAllocation *csrSurface = static_cast<MemoryAllocation *>(csr.getPreemptionCsrAllocation());
ASSERT_NE(nullptr, csrSurface);
EXPECT_TRUE(csrSurface->uncacheable);
const_cast<HardwareInfo *>(platformDevices[0])->pWaTable = waTable;
}

View File

@@ -44,8 +44,6 @@ namespace OCLRT {
class DevicePreemptionTests : public ::testing::Test {
public:
void SetUp() override {
dbgRestore = new DebugManagerStateRestore();
DebugManager.flags.ForcePreemptionMode.set(static_cast<int32_t>(PreemptionMode::ThreadGroup));
const cl_queue_properties properties[3] = {CL_QUEUE_PROPERTIES, 0, 0};
kernelInfo = KernelInfo::create();
device = MockDevice::create<OCLRT::MockDevice>(nullptr, false);
@@ -60,11 +58,12 @@ class DevicePreemptionTests : public ::testing::Test {
ASSERT_NE(nullptr, context);
ASSERT_NE(nullptr, cmdQ);
forceWhitelistedRegs(true);
preemptionMode = PreemptionMode::ThreadGroup;
waTable = const_cast<WorkaroundTable *>(device->getWaTable());
}
void TearDown() override {
delete dbgRestore;
if (dbgRestore) {
delete dbgRestore;
}
delete kernel;
delete kernelInfo;
delete dispatchInfo;
@@ -83,7 +82,7 @@ class DevicePreemptionTests : public ::testing::Test {
MockCommandQueue *cmdQ;
MockDevice *device;
MockContext *context;
DebugManagerStateRestore *dbgRestore;
DebugManagerStateRestore *dbgRestore = nullptr;
WorkaroundTable *waTable = nullptr;
SPatchExecutionEnvironment executionEnvironment;
MockProgram program;