summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src/kmp_stats_timing.h
diff options
context:
space:
mode:
Diffstat (limited to 'openmp/runtime/src/kmp_stats_timing.h')
-rw-r--r--openmp/runtime/src/kmp_stats_timing.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/openmp/runtime/src/kmp_stats_timing.h b/openmp/runtime/src/kmp_stats_timing.h
index 2bdfdeadfd0..83fb85bea32 100644
--- a/openmp/runtime/src/kmp_stats_timing.h
+++ b/openmp/runtime/src/kmp_stats_timing.h
@@ -32,7 +32,9 @@ class tsc_tick_count {
explicit tsc_interval_t(int64_t _value) : value(_value) {}
public:
tsc_interval_t() : value(0) {}; // Construct 0 time duration
+#if KMP_HAVE_TICK_TIME
double seconds() const; // Return the length of a time interval in seconds
+#endif
double ticks() const { return double(value); }
int64_t getValue() const { return value; }
@@ -51,7 +53,9 @@ class tsc_tick_count {
tsc_tick_count earlier(tsc_tick_count const other) const {
return my_count < other.my_count ? (*this) : other;
}
+#if KMP_HAVE_TICK_TIME
static double tick_time(); // returns seconds per cycle (period) of clock
+#endif
static tsc_tick_count now() { return tsc_tick_count(); } // returns the rdtsc register value
friend tsc_tick_count::tsc_interval_t operator-(const tsc_tick_count t1, const tsc_tick_count t0);
};
@@ -61,10 +65,12 @@ inline tsc_tick_count::tsc_interval_t operator-(const tsc_tick_count t1, const t
return tsc_tick_count::tsc_interval_t( t1.my_count-t0.my_count );
}
+#if KMP_HAVE_TICK_TIME
inline double tsc_tick_count::tsc_interval_t::seconds() const
{
return value*tick_time();
}
+#endif
extern std::string formatSI(double interval, int width, char unit);
OpenPOWER on IntegriCloud