QUDA  v1.1.0
A library for QCD on GPUs
Namespaces | Macros | Functions
util_quda.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <enum_quda.h>
#include <comm_quda.h>
#include <tune_key.h>

Go to the source code of this file.

Namespaces

 quda
 

Macros

#define zeroThread
 
#define printfZero(...)
 
#define printfQuda(...)
 
#define errorQuda(...)
 
#define warningQuda(...)
 
#define checkCudaErrorNoSync()
 
#define checkCudaError()   checkCudaErrorNoSync()
 

Functions

QudaTune getTuning ()
 Query whether autotuning is enabled or not. Default is enabled but can be overridden by setting QUDA_ENABLE_TUNING=0. More...
 
QudaVerbosity getVerbosity ()
 
char * getOutputPrefix ()
 
FILE * getOutputFile ()
 
void setVerbosity (QudaVerbosity verbosity)
 
void setOutputPrefix (const char *prefix)
 
void setOutputFile (FILE *outfile)
 
void pushVerbosity (QudaVerbosity verbosity)
 Push a new verbosity onto the stack. More...
 
void popVerbosity ()
 Pop the verbosity restoring the prior one on the stack. More...
 
void pushOutputPrefix (const char *prefix)
 Push a new output prefix onto the stack. More...
 
void popOutputPrefix ()
 Pop the output prefix restoring the prior one on the stack. More...
 
bool getRankVerbosity ()
 This function returns true if the calling rank is enabled for verbosity (e.g., whether printQuda and warningQuda will print out from this rank). More...
 
char * getPrintBuffer ()
 
char * getOmpThreadStr ()
 Returns a string of the form ",omp_threads=$OMP_NUM_THREADS", which can be used for storing the number of OMP threads for CPU functions recorded in the tune cache. More...
 
void quda::saveTuneCache (bool error=false)
 

Macro Definition Documentation

◆ checkCudaError

#define checkCudaError ( )    checkCudaErrorNoSync()

Definition at line 158 of file util_quda.h.

◆ checkCudaErrorNoSync

#define checkCudaErrorNoSync ( )
Value:
do { \
cudaError_t error = cudaGetLastError(); \
if (error != cudaSuccess) errorQuda("(CUDA) %s", cudaGetErrorString(error)); \
} while (0)
#define errorQuda(...)
Definition: util_quda.h:120

Definition at line 143 of file util_quda.h.

◆ errorQuda

#define errorQuda (   ...)
Value:
do { \
fprintf(getOutputFile(), "%sERROR: ", getOutputPrefix()); \
fprintf(getOutputFile(), __VA_ARGS__); \
fprintf(getOutputFile(), " (" __FILE__ ":%d in %s())\n", \
__LINE__, __func__); \
fprintf(getOutputFile(), "%s last kernel called was (name=%s,volume=%s,aux=%s)\n", \
getLastTuneKey().volume, getLastTuneKey().aux); \
comm_abort(1); \
} while (0)
void saveTuneCache(bool error=false)
Definition: tune.cpp:439
quda::TuneKey getLastTuneKey()
Definition: tune.cpp:30
FILE * getOutputFile()
Definition: util_quda.cpp:23
char * getOutputPrefix()
Definition: util_quda.cpp:22

Definition at line 120 of file util_quda.h.

◆ printfQuda

#define printfQuda (   ...)
Value:
do { \
fprintf(getOutputFile(), "%s", getOutputPrefix()); \
fprintf(getOutputFile(), __VA_ARGS__); \
fflush(getOutputFile()); \
} while (0)

Definition at line 114 of file util_quda.h.

◆ printfZero

#define printfZero (   ...)
Value:
do { \
if (zeroThread) printf(__VA_ARGS__); \
} while (0)
#define zeroThread
Definition: util_quda.h:68

Definition at line 72 of file util_quda.h.

◆ warningQuda

#define warningQuda (   ...)
Value:
do { \
fprintf(getOutputFile(), "%sWARNING: ", getOutputPrefix()); \
fprintf(getOutputFile(), __VA_ARGS__); \
fprintf(getOutputFile(), "\n"); \
fflush(getOutputFile()); \
} \
} while (0)
@ QUDA_SILENT
Definition: enum_quda.h:265
QudaVerbosity getVerbosity()
Definition: util_quda.cpp:21

Definition at line 132 of file util_quda.h.

◆ zeroThread

#define zeroThread
Value:
(threadIdx.x + blockDim.x*blockIdx.x==0 && \
threadIdx.y + blockDim.y*blockIdx.y==0 && \
threadIdx.z + blockDim.z*blockIdx.z==0)

Definition at line 68 of file util_quda.h.

Function Documentation

◆ getOmpThreadStr()

char* getOmpThreadStr ( )

Returns a string of the form ",omp_threads=$OMP_NUM_THREADS", which can be used for storing the number of OMP threads for CPU functions recorded in the tune cache.

Returns
Returns the string

Definition at line 134 of file util_quda.cpp.

◆ getOutputFile()

FILE* getOutputFile ( )

Definition at line 23 of file util_quda.cpp.

◆ getOutputPrefix()

char* getOutputPrefix ( )

Definition at line 22 of file util_quda.cpp.

◆ getPrintBuffer()

char* getPrintBuffer ( )

Definition at line 132 of file util_quda.cpp.

◆ getRankVerbosity()

bool getRankVerbosity ( )

This function returns true if the calling rank is enabled for verbosity (e.g., whether printQuda and warningQuda will print out from this rank).

Returns
Return whether this rank will print

Definition at line 30 of file util_quda.cpp.

◆ getTuning()

QudaTune getTuning ( )

Query whether autotuning is enabled or not. Default is enabled but can be overridden by setting QUDA_ENABLE_TUNING=0.

Returns
If autotuning is enabled

Definition at line 52 of file util_quda.cpp.

◆ getVerbosity()

QudaVerbosity getVerbosity ( )

Definition at line 21 of file util_quda.cpp.

◆ popOutputPrefix()

void popOutputPrefix ( )

Pop the output prefix restoring the prior one on the stack.

Definition at line 121 of file util_quda.cpp.

◆ popVerbosity()

void popVerbosity ( )

Pop the verbosity restoring the prior one on the stack.

Definition at line 94 of file util_quda.cpp.

◆ pushOutputPrefix()

void pushOutputPrefix ( const char *  prefix)

Push a new output prefix onto the stack.

Definition at line 105 of file util_quda.cpp.

◆ pushVerbosity()

void pushVerbosity ( QudaVerbosity  verbosity)

Push a new verbosity onto the stack.

Definition at line 83 of file util_quda.cpp.

◆ setOutputFile()

void setOutputFile ( FILE *  outfile)

Definition at line 75 of file util_quda.cpp.

◆ setOutputPrefix()

void setOutputPrefix ( const char *  prefix)

Definition at line 69 of file util_quda.cpp.

◆ setVerbosity()

void setVerbosity ( QudaVerbosity  verbosity)

Definition at line 25 of file util_quda.cpp.