From c0c96924538d9e6ba90ac36c766ff29af39303f8 Mon Sep 17 00:00:00 2001 From: Bruno Turcksin Date: Thu, 5 Jan 2023 11:59:39 -0500 Subject: [PATCH] Fix issue when adol-c is enabled --- include/deal.II/lac/vector_operations_internal.h | 4 ++-- source/lac/cuda_sparse_matrix.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 -- 2.39.5