Commit 40dacbba authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Removed TimerCPU and TimerRT classes

parent e27569c0
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -33,8 +33,6 @@ set( headers
     String.h
     SystemInfo.h
     Timer.h
     TimerCPU.h
     TimerRT.h
     UniquePointer.h )

set( common_SOURCES 
@@ -44,9 +42,7 @@ set( common_SOURCES
     SmartPointersRegister.cpp
     String.cpp
     SystemInfo.cpp
     Timer.cpp
     TimerCPU.cpp
     TimerRT.cpp )
     Timer.cpp )
     
set( tnl_SOURCES ${tnl_config_SOURCES}
                 ${tnl_containers_SOURCES}
+5 −5
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@
#include <TNL/Containers/Algorithms/tnlCudaReduction.h>

#ifdef CUDA_REDUCTION_PROFILING
#include <TNL/TimerRT.h>
#include <TNL/Timer.h>
#endif

namespace TNL {
@@ -163,7 +163,7 @@ bool reductionOnCudaDevice( Operation& operation,
   }

   #ifdef CUDA_REDUCTION_PROFILING
      TimerRT timer;
      Timer timer;
      timer.reset();
      timer.start();
   #endif
@@ -179,7 +179,7 @@ bool reductionOnCudaDevice( Operation& operation,
                                               deviceAux1 );
   #ifdef CUDA_REDUCTION_PROFILING
      timer.stop();
     std::cout << "   Reduction on GPU to size " << reducedSize << " took " << timer.getTime() << " sec. " << std::endl;
      std::cout << "   Reduction on GPU to size " << reducedSize << " took " << timer.getRealTime() << " sec. " << std::endl;
      timer.reset();
      timer.start();
   #endif
@@ -193,7 +193,7 @@ bool reductionOnCudaDevice( Operation& operation,
 
   #ifdef CUDA_REDUCTION_PROFILING
      timer.stop();
     std::cout << "   Transferring data to CPU took " << timer.getTime() << " sec. " << std::endl;
      std::cout << "   Transferring data to CPU took " << timer.getRealTime() << " sec. " << std::endl;
   #endif

   #ifdef CUDA_REDUCTION_PROFILING
@@ -211,7 +211,7 @@ bool reductionOnCudaDevice( Operation& operation,
 
   #ifdef CUDA_REDUCTION_PROFILING
      timer.stop();
     std::cout << "   Reduction of small data set on CPU took " << timer.getTime() << " sec. " << std::endl;
      std::cout << "   Reduction of small data set on CPU took " << timer.getRealTime() << " sec. " << std::endl;
   #endif
 
   return checkCudaDevice;
+16 −11
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
#include <TNL/List.h>
#include <TNL/String.h>
#include <TNL/Containers/Vector.h>
#include <TNL/TimerRT.h>
#include <TNL/Timer.h>

namespace TNL {
namespace Matrices {   
@@ -87,7 +87,8 @@ bool MatrixReader< Matrix >::verifyMtxFile( std::istream& file,
   String line;
   bool dimensionsLine( false );
   IndexType processedElements( 0 );
   TimerRT timer;
   Timer timer;
   timer.start();
   while( line.getLine( file ) )
   {
      if( line[ 0 ] == '%' ) continue;
@@ -117,10 +118,11 @@ bool MatrixReader< Matrix >::verifyMtxFile( std::istream& file,
   }
   file.clear();
   long int fileSize = file.tellg();
   timer.stop();
   if( verbose )
     std::cout << " Verifying the matrix elements ... " << processedElements << " / " << matrix.getNumberOfMatrixElements()
           << " -> " << timer.getTime()
           << " sec. i.e. " << fileSize / ( timer.getTime() * ( 1 << 20 ))  << "MB/s." << std::endl;
           << " -> " << timer.getRealTime()
           << " sec. i.e. " << fileSize / ( timer.getRealTime() * ( 1 << 20 ))  << "MB/s." << std::endl;
   return true;
}

@@ -136,7 +138,6 @@ bool MatrixReader< Matrix >::findLineByElement( std::istream& file,
   bool symmetricMatrix( false );
   bool dimensionsLine( false );
   lineNumber = 0;
   TimerRT timer;
   while( line.getLine( file ) )
   {
      lineNumber++;
@@ -264,7 +265,8 @@ bool MatrixReader< Matrix >::computeCompressedRowsLengthsFromMtxFile( std::istre
   String line;
   bool dimensionsLine( false );
   IndexType numberOfElements( 0 );
   TimerRT timer;
   Timer timer;
   timer.start();
   while( line.getLine( file ) )
   {
      if( line[ 0 ] == '%' ) continue;
@@ -303,10 +305,11 @@ bool MatrixReader< Matrix >::computeCompressedRowsLengthsFromMtxFile( std::istre
   }
   file.clear();
   long int fileSize = file.tellg();
   timer.stop();
   if( verbose )
     std::cout << " Counting the matrix elements ... " << numberOfElements / 1000
           << " thousands  -> " << timer.getTime()
           << " sec. i.e. " << fileSize / ( timer.getTime() * ( 1 << 20 ))  << "MB/s." << std::endl;
           << " thousands  -> " << timer.getRealTime()
           << " sec. i.e. " << fileSize / ( timer.getRealTime() * ( 1 << 20 ))  << "MB/s." << std::endl;
   return true;
}

@@ -321,7 +324,8 @@ bool MatrixReader< Matrix >::readMatrixElementsFromMtxFile( std::istream& file,
   String line;
   bool dimensionsLine( false );
   IndexType processedElements( 0 );
   TimerRT timer;
   Timer timer;
   timer.start();
   while( line.getLine( file ) )
   {
      if( line[ 0 ] == '%' ) continue;
@@ -346,10 +350,11 @@ bool MatrixReader< Matrix >::readMatrixElementsFromMtxFile( std::istream& file,
   }
   file.clear();
   long int fileSize = file.tellg();
   timer.stop();
   if( verbose )
     std::cout << " Reading the matrix elements ... " << processedElements << " / " << matrix.getNumberOfMatrixElements()
              << " -> " << timer.getTime()
              << " sec. i.e. " << fileSize / ( timer.getTime() * ( 1 << 20 ))  << "MB/s." << std::endl;
              << " -> " << timer.getRealTime()
              << " sec. i.e. " << fileSize / ( timer.getRealTime() * ( 1 << 20 ))  << "MB/s." << std::endl;
   return true;
}

+3 −3
Original line number Diff line number Diff line
@@ -280,13 +280,13 @@ assemblyLinearSystem( const RealType& time,
   /*cout << "Matrix multiplication test ..." << std::endl;
   Vector< RealType, DeviceType, IndexType > y;
   y.setLike( u );
   TimerRT timer;
   Timer timer;
   timer.reset();
   timer.start();
   for( int i = 0; i < 100; i++ )
      matrix.vectorProduct( u, y );
   timer.stop();
  std::cout << "The time is " << timer.getTime();
  std::cout << "The time is " << timer.getRealTime();
  std::cout << "Scalar product test ..." << std::endl;
   timer.reset();
   RealType a;
@@ -294,7 +294,7 @@ assemblyLinearSystem( const RealType& time,
   for( int i = 0; i < 100; i++ )
      a = y.scalarProduct( u );
   timer.stop();
  std::cout << "The time is " << timer.getTime();
  std::cout << "The time is " << timer.getRealTime();
  std::cout << std::endl;
   abort();*/
}
+3 −8
Original line number Diff line number Diff line
@@ -11,8 +11,7 @@
#pragma once

#include <iomanip>
#include <TNL/TimerCPU.h>
#include <TNL/TimerRT.h>
#include <TNL/Timer.h>
#include <TNL/core/tnlFlopsCounter.h>
#include <TNL/Object.h>
#include <TNL/Solvers/IterativeSolverMonitor.h>
@@ -69,9 +68,7 @@ class ExplicitSolver : public IterativeSolver< typename Problem::RealType,
 
   void setVerbose( IndexType v );

   void setTimerCPU( TimerCPU* timer );

   void setTimerRT( TimerRT* timer );
   void setTimer( Timer* timer );

   virtual bool solve( DofVectorPointer& u ) = 0;

@@ -106,9 +103,7 @@ protected:

   IndexType verbosity;

   TimerCPU* cpu_timer;
 
   TimerRT* rt_timer;
   Timer* timer;
 
   bool testingMode;

Loading