Skip to content

Commit

Permalink
Merge pull request #14643 from Rombur/adolc
Browse files Browse the repository at this point in the history
Fix issue when adol-c is enabled
  • Loading branch information
jppelteret committed Jan 5, 2023
2 parents 137f222 + c0c9692 commit 1136eae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/deal.II/lac/vector_operations_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions source/lac/cuda_sparse_matrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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]));
}
}

Expand All @@ -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
Expand Down

0 comments on commit 1136eae

Please sign in to comment.