From: Daniel Arndt Date: Sat, 23 Feb 2019 23:50:41 +0000 (+0100) Subject: Work around nvcc_wrapper std::complex problem X-Git-Tag: v9.1.0-rc1~317^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34ea16872f1aac75e54ad630c9d70554bab77c42;p=dealii.git Work around nvcc_wrapper std::complex problem --- 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