From: Bruno Turcksin Date: Fri, 22 Nov 2024 21:02:06 +0000 (-0500) Subject: Workaround rocm 5.7 compiler bug in debug mode X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a7fab0e7dd3818f28783cb32a4d1d25781d31c9;p=dealii.git Workaround rocm 5.7 compiler bug in debug mode --- 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;