Skip to content

Commit 42140fc

Browse files
valassiQubitol
authored andcommitted
[fix-arm-support] CODEGEN: use higher tolerance for constexpr_tan tests on aarch64 (with DanieleM)
This fixes a hang in the testMisc tests on aarch64 in sqrtNewtonRaphson (madgraph5#1064) (testMisc -> constexpr_tan -> constexpr_tan_quad -> constexpr_cos_quad -> constexpr_sqrt -> sqrtNewtonRaphson) It uses the same workaround previously adopted for avoiding testMisc hangs when running valgrind (madgraph5#906)
1 parent 22b027d commit 42140fc

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/madgraph/iolibs/template_files/gpu

epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/madgraph/iolibs/template_files/gpu/testmisc.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,16 +355,18 @@ TEST( XTESTID( MG_EPOCH_PROCESS_ID ), testmisc )
355355
<< "x=" << x << ", x(0to2Pi)=" << mapIn0to2Pi( x ) << ", istep=" << istep;
356356
EXPECT_NEAR( std::cos( x ), constexpr_cos( x ), std::abs( std::cos( x ) * tolerance ) )
357357
<< "x=" << x << ", x(0to2Pi)=" << mapIn0to2Pi( x ) << ", istep=" << istep;
358+
#ifndef __aarch64__
358359
if( !RUNNING_ON_VALGRIND )
359360
{
360361
EXPECT_NEAR( std::tan( x ), constexpr_tan( x ), std::abs( std::tan( x ) * tolerance ) )
361362
<< "x=" << x << ", x(0to2Pi)=" << mapIn0to2Pi( x ) << ", istep=" << istep;
362363
}
363364
else
365+
#endif
364366
{
365-
// Higher tolerance when running through valgrind #906
367+
// Higher tolerance when running through valgrind #906 (or on aarch64 #1064)
366368
const long double ctanx = constexpr_tan( x );
367-
const long double taninf = 4E14; // declare tan(x) as "infinity if above this threshold
369+
const long double taninf = 4E14; // declare tan(x) as "infinity" if above this threshold
368370
if( ctanx > -taninf && ctanx < taninf )
369371
EXPECT_NEAR( std::tan( x ), ctanx, std::abs( std::tan( x ) * tolerance ) )
370372
<< "x=" << x << ", x(0to2Pi)=" << mapIn0to2Pi( x ) << ", istep=" << istep;

0 commit comments

Comments
 (0)