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