OpenMPCD
Macros
OPENMPCD_DEBUG_ASSERT.hpp File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define OPENMPCD_DEBUG_ASSERT_HOST_EXCEPTIONTYPE(assertion, ExceptionType)   do{} while(false)
 
#define OPENMPCD_DEBUG_ASSERT_HOST(assertion)
 If OPENMPCD_DEBUG is defined, this macro checks that the given condition evaluates to true, and throws an instance of OpenMPCD::AssertionException otherwise. More...
 
#define OPENMPCD_DEBUG_ASSERT_DEVICE(assertion)   do{} while(false)
 
#define OPENMPCD_DEBUG_ASSERT_EXCEPTIONTYPE(assertion, ExceptionType)   OPENMPCD_DEBUG_ASSERT_HOST_EXCEPTIONTYPE(assertion, ExceptionType)
 
#define OPENMPCD_DEBUG_ASSERT(assertion)   OPENMPCD_DEBUG_ASSERT_EXCEPTIONTYPE(assertion, OpenMPCD::AssertionException)
 Asserts that the given expression evaluates to true, but only if OPENMPCD_DEBUG is defined. More...
 

Detailed Description

Defines the OPENMPCD_DEBUG_ASSERT macro.

Definition in file OPENMPCD_DEBUG_ASSERT.hpp.

Macro Definition Documentation

◆ OPENMPCD_DEBUG_ASSERT

#define OPENMPCD_DEBUG_ASSERT (   assertion)    OPENMPCD_DEBUG_ASSERT_EXCEPTIONTYPE(assertion, OpenMPCD::AssertionException)

Asserts that the given expression evaluates to true, but only if OPENMPCD_DEBUG is defined.

If CUDA __device__ or __global__ functions are being compiled, this macro expands to OPENMPCD_DEBUG_ASSERT_DEVICE, and otherwise expands to OPENMPCD_DEBUG_ASSERT_HOST.

Definition at line 88 of file OPENMPCD_DEBUG_ASSERT.hpp.

◆ OPENMPCD_DEBUG_ASSERT_DEVICE

#define OPENMPCD_DEBUG_ASSERT_DEVICE (   assertion)    do{} while(false)

If OPENMPCD_DEBUG is defined, this macro checks that the given condition evaluates to true, and calls assert otherwise.

If OPENMPCD_DEBUG is not defined, this macro does nothing.

Definition at line 57 of file OPENMPCD_DEBUG_ASSERT.hpp.

◆ OPENMPCD_DEBUG_ASSERT_EXCEPTIONTYPE

#define OPENMPCD_DEBUG_ASSERT_EXCEPTIONTYPE (   assertion,
  ExceptionType 
)    OPENMPCD_DEBUG_ASSERT_HOST_EXCEPTIONTYPE(assertion, ExceptionType)

Asserts that the given expression evaluates to true, but only if OPENMPCD_DEBUG is defined.

If CUDA __device__ or __global__ functions are being compiled, this macro expands to OPENMPCD_DEBUG_ASSERT_DEVICE, and otherwise expands to OPENMPCD_DEBUG_ASSERT_HOST_EXCEPTIONTYPE, with the supplied ExceptionType being passed to that macro.

Definition at line 76 of file OPENMPCD_DEBUG_ASSERT.hpp.

◆ OPENMPCD_DEBUG_ASSERT_HOST

#define OPENMPCD_DEBUG_ASSERT_HOST (   assertion)
Value:

If OPENMPCD_DEBUG is defined, this macro checks that the given condition evaluates to true, and throws an instance of OpenMPCD::AssertionException otherwise.

If OPENMPCD_DEBUG is not defined, this macro does nothing.

Definition at line 37 of file OPENMPCD_DEBUG_ASSERT.hpp.

◆ OPENMPCD_DEBUG_ASSERT_HOST_EXCEPTIONTYPE

#define OPENMPCD_DEBUG_ASSERT_HOST_EXCEPTIONTYPE (   assertion,
  ExceptionType 
)    do{} while(false)

If OPENMPCD_DEBUG is defined, this macro checks that the given condition evaluates to true, and throws an instance of ExceptionType otherwise.

If OPENMPCD_DEBUG is not defined, this macro does nothing.

Definition at line 26 of file OPENMPCD_DEBUG_ASSERT.hpp.

OpenMPCD::AssertionException
Represents an exception that is due to an assertion violation.
Definition: Exceptions.hpp:64
OPENMPCD_DEBUG_ASSERT_HOST_EXCEPTIONTYPE
#define OPENMPCD_DEBUG_ASSERT_HOST_EXCEPTIONTYPE(assertion, ExceptionType)
Definition: OPENMPCD_DEBUG_ASSERT.hpp:26