]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Have another namespace inclosing the workaround 7750/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 26 Feb 2019 10:58:15 +0000 (11:58 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 26 Feb 2019 10:58:15 +0000 (11:58 +0100)
include/deal.II/base/tensor.h

index 7b0531ff931293554b607b5d48b4dd2f7cdbb5f1..97fa8d608e07504629abc4c2a65c0e1a59fee406 100644 (file)
@@ -925,43 +925,38 @@ Tensor<0, dim, Number>::operator-=(const Tensor<0, dim, OtherNumber> &p)
 
 
 
-#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
 
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.