SWDEV-487649 - SWDEV-487639 - SWDEV-487636 - Fix memory leaks in catch tests

Change-Id: I7943ecffec6d470789aabde07e6c52d6b871cc13


[ROCm/hip-tests commit: 9cf127697e]
이 커밋은 다음에 포함됨:
Satyanvesh Dittakavi
2024-10-01 15:59:05 +00:00
부모 ffc418c7fd
커밋 30d579a81b
3개의 변경된 파일19개의 추가작업 그리고 3개의 파일을 삭제
+8
파일 보기
@@ -104,6 +104,8 @@ TEST_CASE("Unit_hipDeviceSynchronize_Positive_Nullstream") {
b_context.unblock_stream();
HIP_CHECK(hipDeviceSynchronize());
REQUIRE(1 << 30 == A_h[0] - 1);
HIP_CHECK(hipHostFree(A_h));
HIP_CHECK(hipFree(A_d));
}
/**
@@ -157,8 +159,14 @@ TEST_CASE("Unit_hipDeviceSynchronize_Functional") {
}
HIP_CHECK(hipDeviceSynchronize());
REQUIRE(NUM_ITERS == A[NUM_STREAMS - 1][0] - 1);
for (int i = 0; i < NUM_STREAMS; i++) {
HIP_CHECK(hipHostFree(A[i]));
HIP_CHECK(hipFree(Ad[i]));
HIP_CHECK(hipStreamDestroy(stream[i]));
}
}
/**
* End doxygen group DeviceTest.
* @}
+10 -3
파일 보기
@@ -26,10 +26,17 @@ int MallocFunc() {
hipError_t err;
err = hipMalloc(reinterpret_cast<void**>(&Ad), 1024);
if (err == hipSuccess) {
std::cout <<"PASSED!" <<std::endl;
return 1;
std::cout <<"hipMalloc PASSED!" <<std::endl;
err = hipFree(Ad);
if (err == hipSuccess) {
std::cout <<"hipFree PASSED!" <<std::endl;
return 1;
} else {
std::cout <<"hipFree FAILED!" <<std::endl;
return 0;
}
} else {
std::cout <<"FAILED!" <<std::endl;
std::cout <<"hipMalloc FAILED!" <<std::endl;
return 0;
}
}
+1
파일 보기
@@ -28,6 +28,7 @@ int hipMallocfunc() {
int *Ad;
hipMalloc((void**)&Ad, 1024);
printf("hipMalloc PASSED!\n");
hipFree(Ad);
return 1;
}
#ifdef __cplusplus