From 5ccf3d4d9b9a24bbbd1ee02e2a8d5def44eb5466 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/clr commit: a1956f64e62dcfdc0e09d286b7f6da1d744254d1] --- projects/clr/hipamd/src/hip_hcc.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/clr/hipamd/src/hip_hcc.cpp b/projects/clr/hipamd/src/hip_hcc.cpp index 2c98ac804f..2d67c31fe7 100644 --- a/projects/clr/hipamd/src/hip_hcc.cpp +++ b/projects/clr/hipamd/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__)