/**************************************************************************** ** TAU Portable Profiling Package ** ** http://www.acl.lanl.gov/tau ** ***************************************************************************** ** Copyright 1997 ** ** Department of Computer and Information Science, University of Oregon ** ** Advanced Computing Laboratory, Los Alamos National Laboratory ** ****************************************************************************/ /*************************************************************************** ** File : KtauFuncInfo.h ** ** Description : TAU Kernel Profiling Interface ** ** Author : Aroon Nataraj ** ** : Suravee Suthikulpanit ** ** Contact : {anataraj,suravee}@cs.uoregon.edu ** ** Flags : Compile with ** ** -DTAU_KTAU to enable KTAU ** ** Documentation : ** ***************************************************************************/ #ifndef _KTAUFUNCINFO_H_ #define _KTAUFUNCINFO_H_ #include #if (defined(PTHREADS) || defined(TULIPTHREADS) || defined(JAVA) || defined(TAU_WINDOWS) || defined (TAU_OPENMP) || defined (TAU_SPROC)) #ifndef TAU_MAX_THREADS #ifdef TAU_CHARM #define TAU_MAX_THREADS 512 #else #define TAU_MAX_THREADS 128 #endif #endif //ifndef TAU_MAX_THREADS #else #define TAU_MAX_THREADS 1 #endif //defined(PTHREADS) || defined(TULIPTHREADS) || defined(JAVA) || defined(TAU_WINDOWS) || defined (TAU_OPENMP) || defined (TAU_SPROC) class KtauFuncInfo { public: KtauFuncInfo(); ~KtauFuncInfo(); unsigned long long GetInclTicks(int grp) { return inclticks[grp]; } void AddInclTicks(unsigned long long ticks, int grp) { inclticks[grp] += ticks; } unsigned long long GetExclTicks(int grp) { return exclticks[grp]; } void AddExclTicks(unsigned long long ticks, int grp) { exclticks[grp] += ticks; } unsigned long long GetInclKExcl(int grp) { return inclKExcl[grp]; } void AddInclKExcl(unsigned long long ticks, int grp) { inclKExcl[grp] += ticks; } unsigned long long GetExclKExcl(int grp) { return exclKExcl[grp]; } void AddExclKExcl(unsigned long long ticks, int grp) { exclKExcl[grp] += ticks; } unsigned long long GetInclCalls(int grp) { return inclcalls[grp]; } void AddInclCalls(unsigned long long calls, int grp) { inclcalls[grp] += calls; } unsigned long long GetExclCalls(int grp) { return exclcalls[grp]; } void AddExclCalls(unsigned long long calls, int grp) { exclcalls[grp] += calls; } unsigned long long GetKernelGrpCalls(int tid, int grp) { return kernelGrpCalls[tid][grp];} unsigned long long GetKernelGrpIncl(int tid, int grp) { return kernelGrpIncl[tid][grp];} unsigned long long GetKernelGrpExcl(int tid, int grp) { return kernelGrpExcl[tid][grp];} void ResetCounters(int tid, int grp) { inclticks[grp] = exclticks[grp] = inclKExcl[grp] = exclKExcl[grp] = inclcalls[grp] = exclcalls[grp] = 0; } void ResetAllCounters(int tid) { for(int i = 0; i