1 #ifndef _QUDA_INTERNAL_H 2 #define _QUDA_INTERNAL_H 9 #if ((defined(QMP_COMMS) || defined(MPI_COMMS)) && !defined(MULTI_GPU)) 10 #error "MULTI_GPU must be enabled to use MPI or QMP" 13 #if (!defined(QMP_COMMS) && !defined(MPI_COMMS) && defined(MULTI_GPU)) 14 #error "MPI or QMP must be enabled to use MULTI_GPU" 29 #define MAX_SHORT 32767.0f 31 #define TEX_ALIGN_REQ (512*2) //Fermi, factor 2 comes from even/odd 32 #define ALIGNMENT_ADJUST(n) ( (n+TEX_ALIGN_REQ-1)/TEX_ALIGN_REQ*TEX_ALIGN_REQ) 42 #if (__COMPUTE_CAPABILITY__ >= 300) && (CUDA_VERSION >= 5000) 43 #define USE_TEXTURE_OBJECTS 47 #ifndef USE_TEXTURE_OBJECTS 48 #undef MAX_MULTI_BLAS_N 49 #define MAX_MULTI_BLAS_N 1 54 #include "nvToolsExt.h" 90 extern pthread_mutex_t pthread_mutex;
99 typedef std::complex<double>
Complex;
127 void Start(
const char *
func,
const char *file,
int line) {
129 printfQuda(
"ERROR: Cannot start an already running timer (%s:%d in %s())\n", file, line,
func);
132 gettimeofday(&
start, NULL);
136 void Stop(
const char *
func,
const char *file,
int line) {
138 printfQuda(
"ERROR: Cannot stop an unstarted timer (%s:%d in %s())\n", file, line,
func);
141 gettimeofday(&
stop, NULL);
145 last = ds + 0.000001*dus;
154 void Reset(
const char *
func,
const char *file,
int line) {
156 printfQuda(
"ERROR: Cannot reset a started timer (%s:%d in %s())\n", file, line,
func);
209 #ifdef INTERFACE_NVTX 213 #define PUSH_RANGE(name,cid) { \ 214 int color_id = cid; \ 215 color_id = color_id%nvtx_num_colors;\ 216 nvtxEventAttributes_t eventAttrib = {0}; \ 217 eventAttrib.version = NVTX_VERSION; \ 218 eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; \ 219 eventAttrib.colorType = NVTX_COLOR_ARGB; \ 220 eventAttrib.color = nvtx_colors[color_id]; \ 221 eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII; \ 222 eventAttrib.message.ascii = name; \ 223 eventAttrib.category = cid;\ 224 nvtxRangePushEx(&eventAttrib); \ 226 #define POP_RANGE nvtxRangePop(); 228 #define PUSH_RANGE(name,cid) 234 #ifdef INTERFACE_NVTX 235 static const uint32_t nvtx_colors[];
236 static const int nvtx_num_colors;
320 #define TPSTART(idx) Start_(__func__, __FILE__, __LINE__, idx) 321 #define TPSTOP(idx) Stop_(__func__, __FILE__, __LINE__, idx) 322 #define TPRESET() Reset_(__func__, __FILE__, __LINE__) 340 #endif // _QUDA_INTERNAL_H void Stop_(const char *func, const char *file, int line, QudaProfileType idx)
static std::string pname[]
void Start_(const char *func, const char *file, int line, QudaProfileType idx)
enum QudaPrecision_s QudaPrecision
cudaDeviceProp deviceProp
std::complex< double > Complex
static void StartGlobal(const char *func, const char *file, int line, QudaProfileType idx)
static int global_total_level[QUDA_PROFILE_COUNT]
__darwin_suseconds_t tv_usec
double Last(QudaProfileType idx)
QudaInvertParam inv_param
bool canReuseResidentGauge(QudaInvertParam *inv_param)
Timer profile[QUDA_PROFILE_COUNT]
static void StopGlobal(const char *func, const char *file, int line, QudaProfileType idx)
#define PUSH_RANGE(name, cid)
void Start(const char *func, const char *file, int line)
void Reset_(const char *func, const char *file, int line)
static bool global_switchOff[QUDA_PROFILE_COUNT]
static Timer global_profile[QUDA_PROFILE_COUNT]
Main header file for the QUDA library.
TimeProfile(std::string fname)
#define QUDA_MAX_DIM
Maximum number of dimensions supported by QUDA. In practice, no routines make use of more than 5...
static void PrintGlobal()
void Stop(const char *func, const char *file, int line)
void Reset(const char *func, const char *file, int line)
TimeProfile(std::string fname, bool use_global)