SWDEV-485763 - Fix memory leaks in various unit tests
Fix memory leaks by adding missing destroy calls for events, streams, and graphs at the end of tests. Ensure that every test case executes destroy calls, regardless of whether it passes or fails. Change-Id: I814e35c528d90ed2abb34d77377f1a7fd3f1f11c
Dieser Commit ist enthalten in:
@@ -119,6 +119,9 @@ static void LaunchKrnl2(int* Hmm, size_t NumElms, int InitVal, int HmmMem) {
|
||||
INFO("Data Mismatch observed at line: " << __LINE__);
|
||||
REQUIRE(false);
|
||||
}
|
||||
|
||||
HIP_CHECK(hipFree(ptr));
|
||||
HIP_CHECK(hipStreamDestroy(strm));
|
||||
}
|
||||
|
||||
static void LaunchKrnl3(int* Dptr, size_t NumElms, int InitVal) {
|
||||
@@ -143,6 +146,9 @@ static void LaunchKrnl3(int* Dptr, size_t NumElms, int InitVal) {
|
||||
INFO("Data Mismatch observed at line: " << __LINE__);
|
||||
REQUIRE(false);
|
||||
}
|
||||
|
||||
HIP_CHECK(hipFree(Hmm));
|
||||
HIP_CHECK(hipStreamDestroy(strm));
|
||||
}
|
||||
|
||||
|
||||
@@ -180,6 +186,9 @@ static void LaunchKrnl5(int* Hmm1, size_t NumElms, int InitVal, int KerneltoLaun
|
||||
INFO("Data Mismatch observed at line: " << __LINE__);
|
||||
REQUIRE(false);
|
||||
}
|
||||
|
||||
HIP_CHECK(hipFree(Hmm2));
|
||||
HIP_CHECK(hipStreamDestroy(strm));
|
||||
}
|
||||
|
||||
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren