From 8a7fab0e7dd3818f28783cb32a4d1d25781d31c9 Mon Sep 17 00:00:00 2001 From: Bruno Turcksin Date: Fri, 22 Nov 2024 16:02:06 -0500 Subject: [PATCH] Workaround rocm 5.7 compiler bug in debug mode --- source/grid/grid_out.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/grid/grid_out.cc b/source/grid/grid_out.cc index 421013ae02..3e5d34603e 100644 --- a/source/grid/grid_out.cc +++ b/source/grid/grid_out.cc @@ -2139,7 +2139,13 @@ GridOut::write_svg(const Triangulation<2, 2> &tria, std::ostream &out) const double h; if (n != 1) - h = .6 - (index / (n - 1.)) * .6; + { + // The assert is a workaround a compiler bug in ROCm 5.7 which + // evaluated index/(n-1) when n == 1 in debug mode. When adding + // the assert the ratio is not evaluated. + Assert((n - 1.) != 0., ExcInvalidState()); + h = .6 - (index / (n - 1.)) * .6; + } else h = .6; -- 2.39.5