]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Allow Asserts for functions running on host 6350/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 26 Apr 2018 21:45:12 +0000 (23:45 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 27 Apr 2018 12:09:37 +0000 (14:09 +0200)
cmake/configure/configure_1_cuda.cmake
include/deal.II/base/tensor.h

index 7b9f2e19062e50f09a4ed33a3724626660b6de03..f1fbe8fd5eb72804e84d70a000e81215964b3225 100644 (file)
@@ -95,6 +95,8 @@ MACRO(FEATURE_CUDA_FIND_EXTERNAL var)
         )
       SET(${var} FALSE)
     ENDIF()
+
+    ADD_FLAGS(DEAL_II_CUDA_FLAGS_DEBUG "-G")
   ENDIF()
 ENDMACRO()
 
index 7ad948b63b846b6241d97a2fb10b2a54e0d83de0..f87caf7618f4321d154ea2e6d3b4b4b2e0f60a06 100644 (file)
@@ -780,7 +780,7 @@ inline
 DEAL_II_CUDA_HOST_DEV Tensor<0,dim,Number>::operator Number &()
 {
   // We cannot use Assert inside a CUDA kernel
-#ifndef DEAL_II_WITH_CUDA
+#ifndef __CUDA_ARCH__
   Assert(dim != 0, ExcMessage("Cannot access an object of type Tensor<0,0,Number>"));
 #endif
   return value;
@@ -792,7 +792,7 @@ inline
 DEAL_II_CUDA_HOST_DEV Tensor<0,dim,Number>::operator const Number &() const
 {
   // We cannot use Assert inside a CUDA kernel
-#ifndef DEAL_II_WITH_CUDA
+#ifndef __CUDA_ARCH__
   Assert(dim != 0, ExcMessage("Cannot access an object of type Tensor<0,0,Number>"));
 #endif
   return value;
@@ -910,7 +910,7 @@ typename Tensor<0,dim,Number>::real_type
 DEAL_II_CUDA_HOST_DEV Tensor<0,dim,Number>::norm_square () const
 {
   // We cannot use Assert inside a CUDA kernel
-#ifndef DEAL_II_WITH_CUDA
+#ifndef __CUDA_ARCH__
   Assert(dim != 0, ExcMessage("Cannot access an object of type Tensor<0,0,Number>"));
 #endif
   return numbers::NumberTraits<Number>::abs_square (value);
@@ -1015,7 +1015,7 @@ namespace internal
                std::integral_constant<int, dim>)
     {
       // We cannot use Assert in a CUDA kernel
-#ifndef DEAL_II_WITH_CUDA
+#ifndef __CUDA_ARCH__
       Assert (i<dim, ExcIndexRange(i, 0, dim));
 #endif
       return values[i];
@@ -1030,7 +1030,7 @@ namespace internal
                std::integral_constant<int, 0>)
     {
       // We cannot use Assert in a CUDA kernel
-#ifndef DEAL_II_WITH_CUDA
+#ifndef __CUDA_ARCH__
       Assert(false, ExcMessage("Cannot access elements of an object of type Tensor<rank,0,Number>."));
 #endif
       static ArrayElementType t;

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.