Commit 2c25f398 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Fixed compareMemory method in ArrayOperations on host

parent 331a1265
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ freeMemory( Element* data )
   delete[] data;
   return true;
}

template< typename Element >
void
ArrayOperations< Devices::Host >::
@@ -95,7 +96,9 @@ copyMemory( DestinationElement* destination,
            const SourceElement* source,
            const Index size )
{
   if( std::is_same< DestinationElement, SourceElement >::value )
   if( std::is_same< DestinationElement, SourceElement >::value &&
       ( std::is_fundamental< DestinationElement >::value ||
         std::is_pointer< DestinationElement >::value ) )
      memcpy( destination, source, size * sizeof( DestinationElement ) );
   else
      for( Index i = 0; i < size; i ++ )
@@ -112,7 +115,9 @@ compareMemory( const DestinationElement* destination,
               const SourceElement* source,
               const Index size )
{
   if( std::is_same< DestinationElement, SourceElement >::value )
   if( std::is_same< DestinationElement, SourceElement >::value &&
       ( std::is_fundamental< DestinationElement >::value ||
         std::is_pointer< DestinationElement >::value ) )
   {
      if( memcmp( destination, source, size * sizeof( DestinationElement ) ) != 0 )
         return false;