From de5f99b55df50dfa4564bbd420512174f496b8ea Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Tue, 19 Jul 2022 20:09:18 +0530 Subject: [PATCH] SWDEV-345323 - Free H & D memory and destroy stream. (#2809) Change-Id: I552ac0ad1002fce13767c405558d5d655c7b5c7c [ROCm/hip-tests commit: e514aff37d10ab07c11b692a3d5bc558ad6f8904] --- .../stream/hipStreamCreateWithPriority.cc | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/projects/hip-tests/catch/unit/stream/hipStreamCreateWithPriority.cc b/projects/hip-tests/catch/unit/stream/hipStreamCreateWithPriority.cc index fadc2966a8..300d78ac3c 100644 --- a/projects/hip-tests/catch/unit/stream/hipStreamCreateWithPriority.cc +++ b/projects/hip-tests/catch/unit/stream/hipStreamCreateWithPriority.cc @@ -481,6 +481,16 @@ bool validateStreamPrioritiesWithEvents() { OP(high) #undef OP + // destroy stream + #define OP(x) \ + if (enable_priority_##x) { \ + HIP_CHECK(hipStreamDestroy(stream_##x)); \ + } + OP(low) + OP(normal) + OP(high) + #undef OP + // validate that stream priorities are working as expected #define OP(x, y) \ if (enable_priority_##x && enable_priority_##y) { \ @@ -495,6 +505,17 @@ bool validateStreamPrioritiesWithEvents() { OP(low, high) #undef OP + // free host & device memory + #define OP(x) \ + free(src_h_##x); \ + free(dst_h_##x); \ + hipFree(src_d_##x); \ + hipFree(dst_d_##x); + OP(low) + OP(normal) + OP(high) + #undef OP + return true; }