mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
Fix resource destruction scheme on device closure.
- Call waitForTaskCountAndCleanAllocationList with latest flushed task count to reflect what was actually sent to HW. - refactor cleanAllocationList to waitForTaskCountAndCleanAllocationList Change-Id: I5301185c5fce212e39eb017b952b43c279559cf4
This commit is contained in:
committed by
sys_ocldev
parent
42798fcae0
commit
af77720f9c
@@ -114,6 +114,8 @@ class WddmCommandStreamWithMockGdiFixture : public WddmFixture {
|
||||
mm->device = device;
|
||||
|
||||
tagAllocation = mm->allocateGraphicsMemory(1024, 4096);
|
||||
auto tagBuffer = (uint32_t *)tagAllocation->getUnderlyingBuffer();
|
||||
tagBuffer[0] = initialHardwareTag;
|
||||
}
|
||||
|
||||
void TearDown() {
|
||||
@@ -339,7 +341,7 @@ TEST_F(WddmCommandStreamTest, killAllTemporaryAllocation) {
|
||||
ASSERT_NE(nullptr, graphicsAllocation);
|
||||
|
||||
graphicsAllocation->taskCount = 1;
|
||||
csr->cleanAllocationList(-1, TEMPORARY_ALLOCATION);
|
||||
csr->waitForTaskCountAndCleanAllocationList(-1, TEMPORARY_ALLOCATION);
|
||||
//no memory leaks reported makes this test pass.
|
||||
}
|
||||
|
||||
@@ -356,7 +358,7 @@ TEST_F(WddmCommandStreamTest, killCompletedAllocations) {
|
||||
graphicsAllocation->taskCount = 1;
|
||||
graphicsAllocation2->taskCount = 100;
|
||||
|
||||
csr->cleanAllocationList(1, TEMPORARY_ALLOCATION);
|
||||
csr->waitForTaskCountAndCleanAllocationList(1, TEMPORARY_ALLOCATION);
|
||||
//graphicsAllocation2 still lives
|
||||
EXPECT_EQ(host_ptr2, graphicsAllocation2->getUnderlyingBuffer());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user