feature: allow freeing memory in aubstream

Related-To: NEO-2707

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2023-10-11 11:25:01 +00:00
committed by Compute-Runtime-Automation
parent 261b8c7877
commit 5d572b9c8f
16 changed files with 49 additions and 20 deletions

View File

@@ -320,7 +320,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, Gen12AubScratchSpaceForSpillFillTest, givenSurfaceS
event);
ASSERT_EQ(CL_SUCCESS, retVal);
pCmdQ->finish();
pCmdQ->flush();
expectMemory<FamilyType>(outBuffer, expectedMemory, expectedMemorySize);
}

View File

@@ -20,6 +20,7 @@ struct AUBCopyImage
public ::testing::WithParamInterface<std::tuple<uint32_t, uint32_t>>,
public ::testing::Test {
void SetUp() override {
DebugManager.flags.EnableFreeMemory.set(false);
ImageAubFixture::setUp(enableBlitter);
}
@@ -160,7 +161,7 @@ struct AUBCopyImage
delete[] dstOutMemory;
}
DebugManagerStateRestore restorer;
std::unique_ptr<Image> srcImage;
std::unique_ptr<Image> dstImage;
};

View File

@@ -34,6 +34,7 @@ struct AUBReadImage
public ::testing::WithParamInterface<std::tuple<uint32_t /*cl_channel_type*/, uint32_t /*cl_channel_order*/, ReadImageParams>>,
public ::testing::Test {
void SetUp() override {
DebugManager.flags.EnableFreeMemory.set(false);
ImageAubFixture::setUp(enableBlitter);
}
@@ -285,7 +286,7 @@ struct AUBReadImage
alignedFree(dstMemoryAligned);
alignedFree(srcMemoryAligned);
}
DebugManagerStateRestore restorer;
std::unique_ptr<Image> srcImage;
};

View File

@@ -96,6 +96,7 @@ HWTEST_P(AUBWriteBuffer, WhenWritingBufferThenExpectationsAreMet) {
size_t sizeRemaining = sizeUserMemory - sizeWritten - offset;
AUBCommandStreamFixture::expectMemory<FamilyType>(pDestMemory, zeroMemory, sizeRemaining);
}
delete dstBuffer;
delete[] srcMemory;
delete[] destMemory;

View File

@@ -33,6 +33,7 @@ struct AUBWriteImage
public ::testing::WithParamInterface<std::tuple<uint32_t /*cl_channel_type*/, uint32_t /*cl_channel_order*/, WriteImageParams>>,
public ::testing::Test {
void SetUp() override {
DebugManager.flags.EnableFreeMemory.set(false);
ImageAubFixture::setUp(enableBlitter);
}
@@ -283,7 +284,7 @@ struct AUBWriteImage
alignedFree(srcMemoryAligned);
}
DebugManagerStateRestore restorer;
std::unique_ptr<Image> dstImage;
};

View File

@@ -81,6 +81,8 @@ HWTEST_F(AUBcommandstreamTests, WhenFlushingTwiceThenCompletes) {
BatchBuffer batchBuffer = BatchBufferHelper::createDefaultBatchBuffer(pCS->getGraphicsAllocation(), pCS, pCS->getUsed());
ResidencyContainer allocationsForResidency;
pCommandStreamReceiver->setLatestSentTaskCount(pCommandStreamReceiver->peekTaskCount() + 1);
pCommandStreamReceiver->flush(batchBuffer, allocationsForResidency);
BatchBuffer batchBuffer2 = BatchBufferHelper::createDefaultBatchBuffer(pCS->getGraphicsAllocation(), pCS, pCS->getUsed());
pCommandStreamReceiver->flush(batchBuffer2, allocationsForResidency);

View File

@@ -51,6 +51,7 @@ struct CopyEngineXeHPAndLater : public MulticontextAubFixture, public ::testing:
DebugManager.flags.RenderCompressedBuffersEnabled.set(true);
DebugManager.flags.RenderCompressedImagesEnabled.set(true);
DebugManager.flags.EnableFreeMemory.set(false);
MulticontextAubFixture::setUp(numTiles, EnabledCommandStreamers::Single, true);

View File

@@ -18,12 +18,14 @@ class AUBRunKernelIntegrateTest : public RunKernelFixture<AUBRunKernelFixtureFac
protected:
void SetUp() override {
DebugManager.flags.EnableFreeMemory.set(false);
ParentClass::setUp();
}
void TearDown() override {
ParentClass::tearDown();
}
DebugManagerStateRestore restorer;
};
SKLTEST_F(AUBRunKernelIntegrateTest, GivenOoqExecutionThenExpectationsMet) {

View File

@@ -19,6 +19,7 @@ class UnifiedMemoryCopyAubTest : public UnifiedMemoryAubFixture,
std::vector<char> srcValues, dstValues;
void SetUp() override {
DebugManager.flags.EnableFreeMemory.set(false);
UnifiedMemoryAubFixture::setUp();
srcMemoryType = std::get<0>(GetParam());
@@ -39,6 +40,7 @@ class UnifiedMemoryCopyAubTest : public UnifiedMemoryAubFixture,
this->freeUSM(dstPtr, dstMemoryType);
UnifiedMemoryAubFixture::tearDown();
}
DebugManagerStateRestore restorer;
};
HWTEST_P(UnifiedMemoryCopyAubTest, givenTwoUnifiedMemoryAllocsWhenCopyingOneToAnotherThenValuesMatch) {