SWDEV-487649 - SWDEV-487639 - SWDEV-487636 - Fix memory leaks in catch tests
Change-Id: I7943ecffec6d470789aabde07e6c52d6b871cc13
[ROCm/hip-tests commit: 9cf127697e]
이 커밋은 다음에 포함됨:
@@ -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.
|
||||
* @}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ int hipMallocfunc() {
|
||||
int *Ad;
|
||||
hipMalloc((void**)&Ad, 1024);
|
||||
printf("hipMalloc PASSED!\n");
|
||||
hipFree(Ad);
|
||||
return 1;
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
|
||||
새 이슈에서 참조
사용자 차단