Commit 5c3423a6 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixed TNL_ASSERT to work with CUDA 7.5 and older.

parent 3b85a05d
Loading
Loading
Loading
Loading
+32 −18
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
   }

#else // __CUDA_ARCH__
#if ( __CUDA_API_VERSION >= 8000 )
   #define TNL_ASSERT( ___tnl__assert_condition, ___tnl__assert_command )                                  \
      if( ! ( ___tnl__assert_condition ) )                                                                 \
      {                                                                                                    \
@@ -48,6 +49,19 @@
           ___tnl__assert_command;                                                                         \
           throw EXIT_FAILURE;                                                                             \
      }
#else //  ( __CUDA_API_VERSION >= 8000 )
   #define TNL_ASSERT( ___tnl__assert_condition, ___tnl__assert_command )                                  \
      if( ! ( ___tnl__assert_condition ) )                                                                 \
      {                                                                                                    \
      std::cerr << "Assertion '" << __STRING( ___tnl__assert_condition ) << "' failed !!!" << std::endl    \
                << "File: " << __FILE__ << std::endl                                                       \
                << "Function: (not known in CUDA 7.5 or older)" << std::endl                               \
                << "Line: " << __LINE__ << std::endl                                                       \
                << "Diagnostics: ";                                                                        \
           ___tnl__assert_command;                                                                         \
           throw EXIT_FAILURE;                                                                             \
      }
#endif //  ( __CUDA_API_VERSION >= 8000 )             
#endif // __CUDA_ARCH__

#else /* #ifndef NDEBUG */