]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Reduce ADOL-C max_tape_index limit when using GCC 6982/head
authorJean-Paul Pelteret <jppelteret@gmail.com>
Fri, 3 May 2019 08:40:06 +0000 (10:40 +0200)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Fri, 3 May 2019 08:40:06 +0000 (10:40 +0200)
include/deal.II/differentiation/ad/ad_drivers.h

index cdde7694598ecf2ee626037f6f5228f817e5e5c1..721e1c0771d13fb928cf7448f75848cfe2d8fecf 100644 (file)
@@ -744,8 +744,17 @@ namespace Differentiation
       // verification that we cannot use or exceed this value. This value is
       // defined as TBUFNUM; see
       // https://gitlab.com/adol-c/adol-c/blob/master/ADOL-C/include/adolc/internal/usrparms.h#L34
+#    ifdef __clang__
       static const typename Types<ADNumberType>::tape_index max_tape_index =
         TBUFNUM;
+#    else
+      // For some reason, the test adolc/helper_tape_index_01 indicates that
+      // ADOL-C does not reliably perform correct computations for the full
+      // range of tape indices when GCC is the compiler. So we limit this number
+      // according to the results of the test.
+      static const typename Types<ADNumberType>::tape_index max_tape_index =
+        TBUFNUM - 2;
+#    endif
     }; // struct Numbers
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.