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

Optimized error checking in tnl-cuda-benchmarks

parent a19fd6cf
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -196,10 +196,13 @@ int main( int argc, char* argv[] )
   cout << "bandwidth: " << bandwidth << " GB/sec, time: " << timer.getTime() << " sec." << endl;
   cout << "CPU/GPU speedup: " << timeHost / timeDevice << endl;

   HostVector auxHostVector;
   auxHostVector.setLike( deviceVector );
   auxHostVector = deviceVector;
   for( int i = 0; i < size; i++ )
      if( hostVector.getElement( i ) != deviceVector.getElement( i ) )
      if( hostVector.getElement( i ) != auxHostVector.getElement( i ) )
      {
         cerr << "Error in prefix sum at position " << i << ":  " << hostVector.getElement( i ) << " != " << deviceVector.getElement( i ) << endl;
         cerr << "Error in prefix sum at position " << i << ":  " << hostVector.getElement( i ) << " != " << auxHostVector.getElement( i ) << endl;
      }

   return EXIT_SUCCESS;