Commit 55003e09 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Benchmarks: simplified initialization of timers, removed obsolete TODO notes

parent 586dae19
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -62,13 +62,8 @@ benchmarkCuda( const int & loops,
               CheckFunction check = trueFunc,
               ResetFunction reset = voidFunc )
{
    // timers are constructed zero-initialized and stopped
    tnlTimerRT timerHost, timerCuda, timerCudaSync;
    timerHost.reset();
    timerHost.stop();
    timerCuda.reset();
    timerCuda.stop();
    timerCudaSync.reset();
    timerCudaSync.stop();

    for(int i = 0; i < loops; ++i) {
        timerHost.start();
+0 −15
Original line number Diff line number Diff line
@@ -28,26 +28,11 @@

using namespace tnl::benchmarks;

#ifdef HAVE_CUBLAS
//#include <cublas.h>
#endif    

// silly alias to match the number of template parameters with other formats
template< typename Real, typename Device, typename Index >
using SlicedEllpackMatrix = tnlSlicedEllpackMatrix< Real, Device, Index >;



// TODO:
// check operations with the timer:
//   - reset() clears the timer and starts it again
//   - getTime() stops the timer and starts it again !!!
//   - data members are not zero-initialized - reset has to be called manually, but it immediately starts the timer
// FIXME:
// - scalarProduct is not const method
// - cudaThreadSynchronize() should be called from all CUDA methods


template< typename Matrix >
int setHostTestMatrix( Matrix& matrix,
                       const int elementsPerRow )
+4 −0
Original line number Diff line number Diff line
@@ -4,6 +4,10 @@

#include <core/vectors/tnlVector.h>

#ifdef HAVE_CUBLAS
//#include <cublas.h>
#endif

namespace tnl
{
namespace benchmarks