Nektar++
Loading...
Searching...
No Matches
Classes | Namespaces | Macros
ErrorUtil.hpp File Reference
#include <iostream>
#include <stdexcept>
#include <string>
#include <LibUtilities/LibUtilitiesDeclspec.h>
#include <execinfo.h>

Go to the source code of this file.

Classes

class  Nektar::ErrorUtil
 
class  Nektar::ErrorUtil::NekError
 

Namespaces

namespace  Nektar
 

Macros

#define NEKERROR(type, msg)    Nektar::ErrorUtil::Error(type, __FILE__, __LINE__, msg, 0);
 Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode. This level assert is considered code critical, even under optimized compilation.
 
#define ROOTONLY_NEKERROR(type, msg)    Nektar::ErrorUtil::Error(type, __FILE__, __LINE__, msg, 0, true);
 
#define ASSERTL0(condition, msg)
 
#define WARNINGL0(condition, msg)
 
#define ASSERTL1(condition, msg)
 Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode. This level assert is designed for aiding in standard debug (-g) mode.
 
#define WARNINGL1(condition, msg)
 
#define ASSERTL2(condition, msg)
 Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to provide addition safety checks within the code (such as bounds checking, etc.).
 
#define WARNINGL2(condition, msg)
 
#define NEK_HOSTDEVICE_ASSERTL0(condition, msg)   ASSERTL0(condition, msg)
 Asserts for a function that both host code and a device kernel can call.
 
#define NEK_HOSTDEVICE_ASSERTL1(condition, msg)   ASSERTL1(condition, msg)
 
#define NEK_HOSTDEVICE_ASSERTL2(condition, msg)   ASSERTL2(condition, msg)
 

Macro Definition Documentation

◆ ASSERTL0

#define ASSERTL0 (   condition,
  msg 
)
Value:
if (!(condition)) \
{ \
Nektar::ErrorUtil::Error(Nektar::ErrorUtil::efatal, __FILE__, \
__LINE__, msg, 0); \
}

Definition at line 222 of file ErrorUtil.hpp.

224 { \
225 Nektar::ErrorUtil::Error(Nektar::ErrorUtil::efatal, __FILE__, \
226 __LINE__, msg, 0); \
227 }

◆ ASSERTL1

#define ASSERTL1 (   condition,
  msg 
)

Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode. This level assert is designed for aiding in standard debug (-g) mode.

Definition at line 256 of file ErrorUtil.hpp.

◆ ASSERTL2

#define ASSERTL2 (   condition,
  msg 
)

Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to provide addition safety checks within the code (such as bounds checking, etc.).

Definition at line 279 of file ErrorUtil.hpp.

◆ NEK_HOSTDEVICE_ASSERTL0

#define NEK_HOSTDEVICE_ASSERTL0 (   condition,
  msg 
)    ASSERTL0(condition, msg)

Asserts for a function that both host code and a device kernel can call.

An assert builds a std::string for its message, which no device pass can compile: nvcc drops the host call silently, and a single-pass compiler such as AdaptiveCpp's outlines it into the kernel, where the module then fails to load. These variants keep the check on the host and compile to nothing in device code, so a function marked NEK_HOSTDEVICE_INLINE carries on the Serial and AVX paths the check it cannot carry on the GPU. They are for helpers shared between host code and kernels; a kernel-only function asserts nothing, and its launcher checks the condition on the host before the launch.

Definition at line 313 of file ErrorUtil.hpp.

◆ NEK_HOSTDEVICE_ASSERTL1

#define NEK_HOSTDEVICE_ASSERTL1 (   condition,
  msg 
)    ASSERTL1(condition, msg)

Definition at line 314 of file ErrorUtil.hpp.

◆ NEK_HOSTDEVICE_ASSERTL2

#define NEK_HOSTDEVICE_ASSERTL2 (   condition,
  msg 
)    ASSERTL2(condition, msg)

Definition at line 315 of file ErrorUtil.hpp.

◆ NEKERROR

#define NEKERROR (   type,
  msg 
)     Nektar::ErrorUtil::Error(type, __FILE__, __LINE__, msg, 0);

Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode. This level assert is considered code critical, even under optimized compilation.

Definition at line 216 of file ErrorUtil.hpp.

◆ ROOTONLY_NEKERROR

#define ROOTONLY_NEKERROR (   type,
  msg 
)     Nektar::ErrorUtil::Error(type, __FILE__, __LINE__, msg, 0, true);

Definition at line 219 of file ErrorUtil.hpp.

◆ WARNINGL0

#define WARNINGL0 (   condition,
  msg 
)
Value:
if (!(condition)) \
{ \
Nektar::ErrorUtil::Error(Nektar::ErrorUtil::ewarning, __FILE__, \
__LINE__, msg, 0); \
}

Definition at line 229 of file ErrorUtil.hpp.

231 { \
232 Nektar::ErrorUtil::Error(Nektar::ErrorUtil::ewarning, __FILE__, \
233 __LINE__, msg, 0); \
234 }

◆ WARNINGL1

#define WARNINGL1 (   condition,
  msg 
)

Definition at line 257 of file ErrorUtil.hpp.

◆ WARNINGL2

#define WARNINGL2 (   condition,
  msg 
)

Definition at line 280 of file ErrorUtil.hpp.