Commit 7aa09ad1 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Adding banchmark for CUDA lp norm.

parent 59b3959e
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -144,6 +144,31 @@ int main( int argc, char* argv[] )
#endif    
#endif

   cout << "Benchmarking L2 norm on CPU: ";
   timer.reset();
   timer.start();
   for( int i = 0; i < loops; i++ )
     resultHost = hostVector.lpNorm( 2.0 );
   timer.stop();
   bandwidth = 2 * datasetSize / timer.getTime();
   cout << bandwidth << " GB/sec." << endl;
    
   cout << "Benchmarking L2 norm on GPU: " << endl;
   timer.reset();
   timer.start();
   for( int i = 0; i < loops; i++ )
      resultDevice = deviceVector.lpNorm( 2.0 );
   cout << "Time: " << timer.getTime() << endl;
   timer.stop();
   bandwidth = 2 * datasetSize / timer.getTime();
   cout << "Time: " << timer.getTime() << " bandwidth: " << bandwidth << " GB/sec." << endl;
   if( resultHost != resultDevice )
   {
      cerr << "Error. " << resultHost << " != " << resultDevice << endl;
      //return EXIT_FAILURE;
   }

   
   cout << "Benchmarking prefix-sum on CPU ..." << endl;
   timer.reset();
   timer.start();