-#ifdef __CUDA_ARCH__
namespace internal
{
- template <typename Number, typename OtherNumber>
- DEAL_II_CUDA_HOST_DEV void
- multiply_assign_scalar(Number &tensor, const OtherNumber &s)
+ namespace ComplexWorkaround
{
- tensor *= s;
- }
+ template <typename Number, typename OtherNumber>
+ inline DEAL_II_CUDA_HOST_DEV void
+ multiply_assign_scalar(Number &val, const OtherNumber &s)
+ {
+ val *= s;
+ }
- template <typename Number, typename OtherNumber>
- DEAL_II_CUDA_HOST_DEV void
- multiply_assign_scalar(std::complex<Number> &, const OtherNumber &)
- {
- printf("This function is not implemented for std::complex<Number>!\n");
- assert(false);
- }
+#ifdef __CUDA_ARCH__
+ template <typename Number, typename OtherNumber>
+ inline DEAL_II_CUDA_HOST_DEV void
+ multiply_assign_scalar(std::complex<Number> &, const OtherNumber &)
+ {
+ printf("This function is not implemented for std::complex<Number>!\n");
+ assert(false);
+ }
+#endif
+ } // namespace ComplexWorkaround
} // namespace internal
+
template <int dim, typename Number>
template <typename OtherNumber>
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 <int dim, typename Number>
-template <typename OtherNumber>
-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