]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix issue when adol-c is enabled 14643/head
authorBruno Turcksin <bruno.turcksin@gmail.com>
Thu, 5 Jan 2023 16:59:39 +0000 (11:59 -0500)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Thu, 5 Jan 2023 16:59:39 +0000 (11:59 -0500)
include/deal.II/lac/vector_operations_internal.h
source/lac/cuda_sparse_matrix.cc

index e109f20f2cfd8780fa72cb78cf9f0adfa4b7fc69..b86b64ba868afcb6f935b4166a4effffbc180a19 100644 (file)
@@ -2530,7 +2530,7 @@ namespace internal
             exec, 0, size),
           KOKKOS_LAMBDA(size_type i, Number & update) {
 #if KOKKOS_VERSION < 30400
-            update += abs(data.values(i));
+            update += std::abs(data.values(i));
 #elif KOKKOS_VERSION < 30700
             update += Kokkos::Experimental::fabs(data.values(i));
 #else
@@ -2560,7 +2560,7 @@ namespace internal
             exec, 0, size),
           KOKKOS_LAMBDA(size_type i, Number & update) {
 #if KOKKOS_VERSION < 30400
-            update += pow(fabs(data.values(i)), exp);
+            update += std::pow(fabs(data.values(i)), exp);
 #elif KOKKOS_VERSION < 30700
             update += Kokkos::Experimental::pow(
               Kokkos::Experimental::fabs(data.values(i)), exp);
index 9917ae8fb032cc662139584fbe2a75a34148269d..5909297bf11136f68d657bde9d14c2a9c437f218 100644 (file)
@@ -255,7 +255,7 @@ namespace CUDAWrappers
       if (row < n_rows)
         {
           for (int j = row_ptr_dev[row]; j < row_ptr_dev[row + 1]; ++j)
-            atomicAdd(&sums[column_index_dev[j]], abs(val_dev[j]));
+            atomicAdd(&sums[column_index_dev[j]], std::abs(val_dev[j]));
         }
     }
 
@@ -276,7 +276,7 @@ namespace CUDAWrappers
         {
           sums[row] = (Number)0.;
           for (int j = row_ptr_dev[row]; j < row_ptr_dev[row + 1]; ++j)
-            sums[row] += abs(val_dev[j]);
+            sums[row] += std::abs(val_dev[j]);
         }
     }
   } // namespace internal

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.