Commit e8c17ae5 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Removed useless HAVE_CUDA guard, Exceptions::CudaSupportMissing is raised from the Reduction class

parent 72238810
Loading
Loading
Loading
Loading
+2 −14
Original line number Diff line number Diff line
@@ -200,15 +200,11 @@ compareMemory( const Element1* destination,
{
   TNL_ASSERT_TRUE( destination, "Attempted to compare data through a nullptr." );
   TNL_ASSERT_TRUE( source, "Attempted to compare data through a nullptr." );
#ifdef HAVE_CUDA   
   //TODO: The parallel reduction on the CUDA device with different element types is needed.
   bool result = false;
   Algorithms::ParallelReductionEqualities< Element1, Element2 > reductionEqualities;
   Reduction< Devices::Cuda >::reduce( reductionEqualities, size, destination, source, result );
   return result;
#else
   throw Exceptions::CudaSupportMissing();
#endif   
}

template< typename Element,
@@ -221,16 +217,12 @@ containsValue( const Element* data,
{
   TNL_ASSERT_TRUE( data, "Attempted to check data through a nullptr." );
   TNL_ASSERT_GE( size, 0, "" );
#ifdef HAVE_CUDA
   if( size == 0 ) return false;
   bool result = false;
   Algorithms::ParallelReductionContainsValue< Element > reductionContainsValue;
   reductionContainsValue.setValue( value );
   Reduction< Devices::Cuda >::reduce( reductionContainsValue, size, data, 0, result );
   return result;
#else
   throw Exceptions::CudaSupportMissing();
#endif
}

template< typename Element,
@@ -243,16 +235,12 @@ containsOnlyValue( const Element* data,
{
   TNL_ASSERT_TRUE( data, "Attempted to check data through a nullptr." );
   TNL_ASSERT_GE( size, 0, "" );
#ifdef HAVE_CUDA
   if( size == 0 ) return false;
   bool result = false;
   Algorithms::ParallelReductionContainsOnlyValue< Element > reductionContainsOnlyValue;
   reductionContainsOnlyValue.setValue( value );
   Reduction< Devices::Cuda >::reduce( reductionContainsOnlyValue, size, data, 0, result );
   return result;
#else
   throw Exceptions::CudaSupportMissing();
#endif
}