From 4dc24498af2ac6e98fbb13050950d371b5e8aee9 Mon Sep 17 00:00:00 2001 From: Siu Chi Chan Date: Wed, 18 Oct 2017 16:26:13 -0400 Subject: [PATCH] hipDeviceReset(): make sure to reinitialize the printf buffer in hcc RT [ROCm/hip commit: ccef1cbd6eda9380748dce7e23924ebb12d2643c] --- projects/hip/src/hip_hcc.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/hip/src/hip_hcc.cpp b/projects/hip/src/hip_hcc.cpp index 2c98ac804f..2d67c31fe7 100644 --- a/projects/hip/src/hip_hcc.cpp +++ b/projects/hip/src/hip_hcc.cpp @@ -614,6 +614,11 @@ void ihipDevice_t::locked_reset() _state = 0; am_memtracker_reset(_acc); + //FIXME - Calling am_memtracker_reset is really bad since it destroyed all buffers allocated by the HCC runtime as well + //such as the printf buffer. Re-initialze the printf buffer as a workaround for now. +#if (__hcc_workweek__ >= 17423) + Kalmar::getContext()->initPrintfBuffer(); +#endif }; #define ErrorCheck(x) error_check(x, __LINE__, __FILE__)