26#ifndef CASA_PRECTIMER_H
27#define CASA_PRECTIMER_H
30#include <casacore/casa/aips.h>
34#if defined __ia64__ && defined __INTEL_COMPILER
118 void show (std::ostream& os)
const;
132 unsigned long long getCount()
const;
149#if defined __i386__ && defined __INTEL_COMPILER && defined _OPENMP
151 int count_low, count_high;
154 unsigned long long count;
194#if defined __x86_64__ && defined __INTEL_COMPILER && defined _OPENMP
199 "leaq (%%rax,%%rdx),%%rax\n\t"
207#elif defined __i386__ && defined __INTEL_COMPILER && defined _OPENMP
211 "lock;subl %%eax,%0\n\t"
219#elif (defined __i386__ || defined __x86_64__) && (defined __PATHSCALE__ || (defined __APPLE__ && defined __APPLE_CC__ && __APPLE_CC__ == 5531))
222 asm volatile (
"rdtsc" :
"=a" (eax),
"=d" (edx));
224 u1.
total_time -= ((
unsigned long long) edx << 32) + eax;
225#elif (defined __i386__ || defined __x86_64__) && (defined __GNUC__ || defined __INTEL_COMPILER)
237#elif defined __ia64__ && defined __INTEL_COMPILER
239#elif defined __ia64__ && defined __GNUC__
241 asm volatile (
"mov %0=ar.itc" :
"=r" (
time));
243#elif defined __PPC__ && (defined __GNUC__ || defined __xlC__)
244 int high, low, retry;
257 "=r" (high),
"=r" (low),
"=r" (retry),
268#if defined __x86_64__ && defined __INTEL_COMPILER && defined _OPENMP
273 "leaq (%%rax,%%rdx),%%rax\n\t"
281#elif defined __i386__ && defined __INTEL_COMPILER && defined _OPENMP
285 "lock;addl %%eax, %0\n\t"
286 "lock;adcl %%edx, %1"
293#elif (defined __i386__ || defined __x86_64__) && (defined __PATHSCALE__ || (defined __APPLE__ && defined __APPLE_CC__ && __APPLE_CC__ == 5531))
296 asm volatile (
"rdtsc\n\t" :
"=a" (eax),
"=d" (edx));
297 u1.
total_time += ((
unsigned long long) edx << 32) + eax;
298#elif (defined __i386__ || defined __x86_64__) && (defined __GNUC__ || defined __INTEL_COMPILER)
310#elif defined __ia64__ && defined __INTEL_COMPILER
312#elif defined __ia64__ && defined __GNUC__
314 asm volatile (
"mov %0=ar.itc" :
"=r" (
time));
316#elif defined __PPC__ && (defined __GNUC__ || defined __xlC__)
317 int high, low, retry;
330 "=r" (high),
"=r" (low),
"=r" (retry),
337#if defined __x86_64__ && defined __INTEL_COMPILER && defined _OPENMP
338 asm volatile (
"lock;addq $1,%0" :
"+m" (
u2.
count));
339#elif defined __i386__ && defined __INTEL_COMPILER && defined _OPENMP
342 "lock;addl $1,%0\n\t"
345 "+m" (
u2.s2.count_low),
"+m" (
u2.s2.count_high)
static double CPU_speed_in_MHz
void show(std::ostream &os, const String &prefix) const
void reset()
Reset the timer to zero.
void start()
Restart the timer.
void show(std::ostream &os) const
unsigned long long getCount() const
Get the total number of times start/stop is done.
static double get_CPU_speed_in_MHz()
void show(const String &) const
Show real time on cout or a user supplied stream preceeded by the string parameter.
void print_time(std::ostream &, double time) const
double getReal() const
Get the real time (in seconds).
void stop()
Stop the timer.
void show() const
Show real time on cout or a user supplied stream.
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
TableExprNode time(const TableExprNode &node)