From: Daniel Arndt Date: Tue, 26 Feb 2019 10:58:15 +0000 (+0100) Subject: Have another namespace inclosing the workaround X-Git-Tag: v9.1.0-rc1~317^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=915f1a2149255096acb297e705e32d2499b017c7;p=dealii.git Have another namespace inclosing the workaround --- diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index 7b0531ff93..97fa8d608e 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -925,43 +925,38 @@ 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) + namespace ComplexWorkaround { - tensor *= s; - } + template + inline DEAL_II_CUDA_HOST_DEV void + multiply_assign_scalar(Number &val, const OtherNumber &s) + { + val *= 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); - } +#ifdef __CUDA_ARCH__ + template + inline 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); + } +#endif + } // namespace ComplexWorkaround } // 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> & -Tensor<0, dim, Number>::operator*=(const OtherNumber &s) -{ - value *= s; + internal::ComplexWorkaround::multiply_assign_scalar(value, s); return *this; } -#endif