From a3b6ab46ede81f47f2d153c9f4a30740dc47d021 Mon Sep 17 00:00:00 2001 From: Andrea Valassi Date: Wed, 18 Sep 2024 09:17:54 +0200 Subject: [PATCH] [clang] in gg_tt.mad and CODEGEN EventStatistics.h, work around FPE crash #1005 on clang16 by disabling optimizations for operator+= This extends to any clang the previous workaround for #1003 which had been defined only for HIP clang --- .../madgraph/iolibs/template_files/gpu/EventStatistics.h | 5 +++-- epochX/cudacpp/gg_tt.mad/SubProcesses/EventStatistics.h | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/madgraph/iolibs/template_files/gpu/EventStatistics.h b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/madgraph/iolibs/template_files/gpu/EventStatistics.h index 58fa8fc273..0857275ae4 100644 --- a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/madgraph/iolibs/template_files/gpu/EventStatistics.h +++ b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/madgraph/iolibs/template_files/gpu/EventStatistics.h @@ -106,8 +106,9 @@ namespace mg5amcCpu , sqsWGdiff( 0 ) , tag( "" ) {} // Combine two EventStatistics -#if __HIP_CLANG_ONLY__ - // Disable optimizations for this function in HIPCC (work around FPE crash #1003) +#ifdef __clang__ + // Disable optimizations for this function in HIP (work around FPE crash #1003: originally using #if __HIP_CLANG_ONLY__) + // Disable optimizations for this function in clang tout court (work around FPE crash #1005: now using #ifdef __clang__) // See https://clang.llvm.org/docs/LanguageExtensions.html#extensions-for-selectively-disabling-optimization __attribute__( ( optnone ) ) #endif diff --git a/epochX/cudacpp/gg_tt.mad/SubProcesses/EventStatistics.h b/epochX/cudacpp/gg_tt.mad/SubProcesses/EventStatistics.h index 58fa8fc273..0857275ae4 100644 --- a/epochX/cudacpp/gg_tt.mad/SubProcesses/EventStatistics.h +++ b/epochX/cudacpp/gg_tt.mad/SubProcesses/EventStatistics.h @@ -106,8 +106,9 @@ namespace mg5amcCpu , sqsWGdiff( 0 ) , tag( "" ) {} // Combine two EventStatistics -#if __HIP_CLANG_ONLY__ - // Disable optimizations for this function in HIPCC (work around FPE crash #1003) +#ifdef __clang__ + // Disable optimizations for this function in HIP (work around FPE crash #1003: originally using #if __HIP_CLANG_ONLY__) + // Disable optimizations for this function in clang tout court (work around FPE crash #1005: now using #ifdef __clang__) // See https://clang.llvm.org/docs/LanguageExtensions.html#extensions-for-selectively-disabling-optimization __attribute__( ( optnone ) ) #endif