SWDEV-549700 - Add missing destroy calls (#755)

Šī revīzija ir iekļauta:
vstojilj
2025-09-04 17:21:32 +02:00
revīziju iesūtīja GitHub
vecāks 04c6cfec8c
revīzija 12ad8421bb
12 mainīti faili ar 39 papildinājumiem un 0 dzēšanām
@@ -550,6 +550,7 @@ static void runFloatTest() {
// Cleanup memory
free(hOData);
free(hIActiveLanes);
HIP_CHECK(hipFree(dOData));
HIP_CHECK(hipFree(dIActiveLanes));
}
@@ -768,8 +769,11 @@ static void runDivFloatTest() {
// Cleanup memory
free(hOData);
free(hIDivValues);
free(hIActiveLanes);
HIP_CHECK(hipFree(dOData));
HIP_CHECK(hipFree(dIActiveLanes));
HIP_CHECK(hipFree(dIDivValues));
}
/*
@@ -79,6 +79,8 @@ TEST_CASE("Unit_AnyAll_CompileTest") {
HIP_CHECK(hipFree(device_any));
HIP_CHECK(hipFree(device_all));
free(host_any);
free(host_all);
REQUIRE(anycount == 0);
REQUIRE(allcount == 1);
}
@@ -82,5 +82,6 @@ TEST_CASE("Unit_ballot") {
}
HIP_CHECK(hipFree(device_ballot));
free(host_ballot);
REQUIRE(divergent_count == 1);
}
@@ -307,6 +307,9 @@ TEST_CASE("Unit_bf16_basic") {
INFO("Index: " << i << " input: " << in[i] << " output: " << res[i]);
REQUIRE(res[i] == 1);
}
HIP_CHECK(hipFree(d_in));
HIP_CHECK(hipFree(d_res));
}
SECTION("MathOp Compare") {
@@ -454,6 +457,7 @@ TEST_CASE("Unit_bf16_basic") {
HIP_CHECK(hipFree(d_in1))
HIP_CHECK(hipFree(d_in2));
HIP_CHECK(hipFree(d_out));
}
SECTION("abs") {
@@ -835,6 +835,7 @@ template <typename T> static bool TestMemoryAcrossMulKernelsUsingGraph(int test_
}
HIP_CHECK(hipStreamDestroy(streamForGraph));
HIP_CHECK(hipGraphExecDestroy(graphExec));
HIP_CHECK(hipGraphDestroy(graph));
HIP_CHECK(hipFree(outputVec_d));
free(outputVec_h);
return bPassed;
@@ -142,6 +142,8 @@ TEMPLATE_TEST_CASE("Unit_fp8_ocp_compare_host_device", "", float, double) {
<< " - gpu_result: " << result[i]);
CHECK(cpu_result[i] == result[i]);
}
HIP_CHECK(hipFree(d_numbers));
}
__FP8_DEVICE__ void e4m3_fp8x2_ocp_device(float2* val) {
@@ -234,6 +236,8 @@ TEST_CASE("Unit_fp8x2_ocp_compare_host_device") {
for (size_t i = 0; i < result.size(); i++) {
CHECK(cpu_result[i] == result[i]);
}
HIP_CHECK(hipFree(d_numbers));
}
TEST_CASE("Unit_fp8x2_ocp_split_compare") {
@@ -290,6 +294,8 @@ TEST_CASE("Unit_fp8x2_ocp_split_compare") {
<< " y: " << result[i].y);
CHECK(cpu_result[i] == result[i]);
}
HIP_CHECK(hipFree(d_numbers));
}
__FP8_DEVICE__ void e4m3_fp8x4_ocp_device(float4* val) {
@@ -388,6 +394,8 @@ TEST_CASE("Unit_fp8x4_ocp_split_compare") {
<< " w: " << result[i].w);
CHECK(cpu_result[i] == result[i]);
}
HIP_CHECK(hipFree(d_numbers));
}
__FP8_DEVICE__ bool e4m3_bool_ocp_device(float val) {
@@ -204,5 +204,10 @@ TEST_CASE("Unit_funnelshift") {
free(host_r_output);
free(host_rc_output);
free(golden_l);
free(golden_lc);
free(golden_r);
free(golden_rc);
REQUIRE(errors == 0);
}
@@ -55,6 +55,9 @@ TEST_CASE("Unit_ToAndFroMemCpyToDevice") {
for (int i = LEN - 16; i < LEN; i++) {
REQUIRE(0x01010101 == B[i]);
}
HIP_CHECK(hipFree(Ad));
HIP_CHECK(hipFree(Bd));
delete[] A;
delete[] B;
}
@@ -48,4 +48,7 @@ TEST_CASE("Unit_hipTestClock") {
for (unsigned i = 0; i < LEN; i++) {
assert(0 != A[i]);
}
HIP_CHECK(hipFree(Ad));
delete[] A;
}
@@ -93,6 +93,8 @@ void runTestFMA() {
for (unsigned i = 0; i < LEN; i++) {
REQUIRE(A[i] == true);
}
HIP_CHECK(hipFree(Ad));
}
__global__ void kernelTestHalfFMA(bool* Ad) {
@@ -166,6 +168,8 @@ void runTestHalfFMA() {
for (unsigned i = 0; i < LEN; i++) {
REQUIRE(A[i] == true);
}
HIP_CHECK(hipFree(Ad));
}
TEST_CASE("Unit_hipTestFMA") {
@@ -391,6 +391,8 @@ TEST_CASE("Unit_TestDevice_DoublePrecisionMathFunc") {
REQUIRE(srcPtr[0] == true);
HIP_CHECK(hipFree(devicePtr));
HIP_CHECK(hipFree(Afd));
HIP_CHECK(hipFree(Ad));
delete srcPtr;
delete[] Af;
delete[] A;
@@ -49,5 +49,7 @@ TEST_CASE("Unit_hipTest_DeviceNewOperator") {
for (unsigned i = 0; i < LEN; i++) {
REQUIRE(i == A[i]);
}
HIP_CHECK(hipFree(Ad));
delete[] A;
}