packages/CudaUtils/cuda_utils/Event.cc
//===========================================================================//
// HOST SPECIALIZATION
//===========================================================================//
/*!
 * \brief Record an event
 */
HOST SPECIALIZATION
\brief Record an event
HOST SPECIALIZATION \ brief Record an event
void Event<Host>::record()
{
#if defined(HAVE_SYS_TIMES_H)
    tms tms_now;
    d_event_time = profugus::wall_clock_time(tms_now);
#elif defined(HAVE_WINDOWS_H)
    long long ll_freq, ll_now;
    QueryPerformanceFrequency(reinterpret_cast<LARGE_INTEGER*>(&ll_freq));
    QueryPerformanceCounter(reinterpret_cast<LARGE_INTEGER*>(&ll_now));
    CHECK(ll_freq > 0);
    d_event_time = static_cast<double>(ll_now) / ll_freq;
#else
    INSIST(false, "Timing is not available on this platform.");
#endif
    ENSURE(d_event_time > 0.);
}
void Event < Host > :: record ( ) { #if defined ( HAVE_SYS_TIMES_H ) tms tms_now ; d_event_time = profugus :: wall_clock_time ( tms_now ) ; #elif defined ( HAVE_WINDOWS_H ) long long ll_freq , ll_now ; QueryPerformanceFrequency ( reinterpret_cast < LARGE_INTEGER * > ( & ll_freq ) ) ; QueryPerformanceCounter ( reinterpret_cast < LARGE_INTEGER * > ( & ll_now ) ) ; CHECK ( ll_freq > 0 ) ; d_event_time = static_cast < double > ( ll_now ) / ll_freq ; #else INSIST ( false , " " ) ; #endif ENSURE ( d_event_time > 0. ) ; }
HOST SPECIALIZATION
 \brief Record an event
HOST SPECIALIZATION \ brief Record an event
// Note: These definitions and their headers should have been propagated // through Timer.hh // Timer frequency and current time