From 34ea16872f1aac75e54ad630c9d70554bab77c42 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sun, 24 Feb 2019 00:50:41 +0100 Subject: [PATCH] Work around nvcc_wrapper std::complex problem --- include/deal.II/base/tensor.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index b299ed09a7..7b0531ff93 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -924,6 +924,35 @@ Tensor<0, dim, Number>::operator-=(const Tensor<0, dim, OtherNumber> &p) } + +#ifdef __CUDA_ARCH__ +namespace internal +{ + template + DEAL_II_CUDA_HOST_DEV void + multiply_assign_scalar(Number &tensor, const OtherNumber &s) + { + tensor *= s; + } + + template + DEAL_II_CUDA_HOST_DEV void + multiply_assign_scalar(std::complex &, const OtherNumber &) + { + printf("This function is not implemented for std::complex!\n"); + assert(false); + } +} // namespace internal + +template +template +inline DEAL_II_CUDA_HOST_DEV Tensor<0, dim, Number> & +Tensor<0, dim, Number>::operator*=(const OtherNumber &s) +{ + internal::multiply_assign_scalar(value, s); + return *this; +} +#else template template inline DEAL_II_CUDA_HOST_DEV Tensor<0, dim, Number> & @@ -932,6 +961,8 @@ Tensor<0, dim, Number>::operator*=(const OtherNumber &s) value *= s; return *this; } +#endif + template -- 2.39.5