5#include "thrust/device_vector.h"
7#if (THRUST_DEVICE_SYSTEM!=THRUST_DEVICE_SYSTEM_CUDA)
14 void tic( MPI_Comm comm = MPI_COMM_WORLD ){ MPI_Barrier(comm); start = MPI_Wtime();}
15 void toc( MPI_Comm comm = MPI_COMM_WORLD ){ MPI_Barrier(comm); stop = MPI_Wtime(); }
16 double diff()
const{
return stop - start; }
18 double start = 0., stop = 0.;
21#elif THRUST_DEVICE_SYSTEM==THRUST_DEVICE_SYSTEM_OMP
28 void tic( ){ start = omp_get_wtime();}
29 void toc( ){ stop = omp_get_wtime(); }
30 double diff()
const{
return stop - start; }
32 double start = 0., stop = 0.;
43 inline void tic(
void) { m_start = std::chrono::system_clock::now(); }
44 inline void toc(
void) { m_stop = std::chrono::system_clock::now();}
45 inline double diff(
void) {
46 double difference = std::chrono::duration_cast<std::chrono::nanoseconds>(
47 m_stop - m_start).count();
48 return difference*1e-9;
51 typename std::chrono::system_clock::time_point m_start, m_stop;
63 void tic( MPI_Comm comm = MPI_COMM_WORLD ){
64 cudaDeviceSynchronize();
68 void toc( MPI_Comm comm = MPI_COMM_WORLD ){
69 cudaDeviceSynchronize();
73 double diff()
const{
return stop - start; }
75 double start = 0., stop = 0.;
86 cudaEventCreate( &start);
87 cudaEventCreate( &stop);
89 void tic( cudaStream_t stream = 0){ cudaEventRecord( start, stream);}
90 void toc( cudaStream_t stream = 0){
91 cudaEventRecord( stop, stream);
92 cudaEventSynchronize( stop);
96 cudaEventElapsedTime( &time, start, stop);
100 cudaEvent_t start, stop;
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...
double diff() const
Return time in seconds elapsed between tic and toc.