From: Bruno Turcksin Date: Thu, 5 Jan 2023 16:59:39 +0000 (-0500) Subject: Fix issue when adol-c is enabled X-Git-Tag: v9.5.0-rc1~679^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0c96924538d9e6ba90ac36c766ff29af39303f8;p=dealii.git Fix issue when adol-c is enabled --- diff --git a/include/deal.II/lac/vector_operations_internal.h b/include/deal.II/lac/vector_operations_internal.h index e109f20f2c..b86b64ba86 100644 --- a/include/deal.II/lac/vector_operations_internal.h +++ b/include/deal.II/lac/vector_operations_internal.h @@ -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); diff --git a/source/lac/cuda_sparse_matrix.cc b/source/lac/cuda_sparse_matrix.cc index 9917ae8fb0..5909297bf1 100644 --- a/source/lac/cuda_sparse_matrix.cc +++ b/source/lac/cuda_sparse_matrix.cc @@ -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