From ceaed8e097cbba105e23f465c6226ab48e37a3a8 Mon Sep 17 00:00:00 2001 From: Christopher Millette <63608002+cgmillette@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:41:35 -0600 Subject: [PATCH] Fixes small memory leak from missing hipEventDestroy (#1554) --- include/ck/host_utility/kernel_launch.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/ck/host_utility/kernel_launch.hpp b/include/ck/host_utility/kernel_launch.hpp index a616433ac9..962f89e479 100644 --- a/include/ck/host_utility/kernel_launch.hpp +++ b/include/ck/host_utility/kernel_launch.hpp @@ -66,6 +66,9 @@ float launch_and_time_kernel(const StreamConfig& stream_config, hip_check_error(hipEventElapsedTime(&total_time, start, stop)); + hip_check_error(hipEventDestroy(start)); + hip_check_error(hipEventDestroy(stop)); + return total_time / nrepeat; } else @@ -143,6 +146,9 @@ float launch_and_time_kernel_with_preprocess(const StreamConfig& stream_config, hip_check_error(hipEventElapsedTime(&total_time, start, stop)); + hip_check_error(hipEventDestroy(start)); + hip_check_error(hipEventDestroy(stop)); + return total_time / nrepeat; } else