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
[ROCm/hip-tests commit: 9cffda4ebb]
Цей коміт міститься в:
@@ -23,6 +23,7 @@ TEST_CASE("Unit_hipStreamPerThread_EventRecord") {
|
||||
hipEvent_t event;
|
||||
HIP_CHECK(hipEventCreate(&event));
|
||||
HIP_CHECK(hipEventRecord(event, hipStreamPerThread));
|
||||
HIP_CHECK(hipEventDestroy(event));
|
||||
}
|
||||
|
||||
__global__ void update_even_odd(unsigned int N, int* out) {
|
||||
@@ -61,4 +62,9 @@ TEST_CASE("Unit_hipStreamPerThread_EventSynchronize") {
|
||||
REQUIRE(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HIP_CHECK(hipHostFree(A_h));
|
||||
HIP_CHECK(hipFree(A_d));
|
||||
HIP_CHECK(hipEventDestroy(start));
|
||||
HIP_CHECK(hipEventDestroy(end));
|
||||
}
|
||||
|
||||
Посилання в новій задачі
Заблокувати користувача