42#include "../tools/cuda/cudaFunctionAttributes.hpp"
59 CODI_CUDAFunctionAttributes
inline void checkAndOutputAssert(
bool const condition,
char const* conditionString,
60 char const* function,
char const* file,
int line) {
63 std::cerr <<
"codiAssertion failed: " << conditionString <<
" in function " << function <<
" at " << file <<
":"
83 int const line,
bool warning,
char const* message,
86 char const* kind = (warning) ?
"Warning" :
"Error";
87 fprintf(stderr,
"%s in function %s (%s:%d)\nThe message is: ", kind, function, file, line);
90 va_start(vl, message);
91 vfprintf(stderr, message, vl);
94 fprintf(stderr,
"\n");
106#define CODI_EXCEPTION(...) ::codi::outputExceptionOrWarning(__func__, __FILE__, __LINE__, false, __VA_ARGS__)
113#define CODI_WARNING(...) ::codi::outputExceptionOrWarning(__func__, __FILE__, __LINE__, true, __VA_ARGS__)
115#if defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER)
116 #define DEPRECATE(foo, msg) foo __attribute__((deprecated(msg)))
117#elif defined(_MSC_VER)
118 #define DEPRECATE(foo, msg) __declspec(deprecated(msg)) foo
120 #error This compiler is not supported.
135 "static_warning: Implicit conversion of CoDiPack type to real.") {}
CoDiPack - Code Differentiation Package.
Definition codi.hpp:90
void outputExceptionOrWarning(char const function[], char const file[], int const line, bool warning, char const *message,...)
Prints the positions and the message of the exception.
Definition exceptions.hpp:82
void checkAndOutputAssert(bool const condition, char const *conditionString, char const *function, char const *file, int line)
Checks the assert statement and aborts the program if the statement is false.
Definition exceptions.hpp:59
Definition exceptions.hpp:125
static void implicitCast()
Show a warning about an implicit cast of an active real type.
Definition exceptions.hpp:129
static void implicitCastStatic(::std::true_type const &)
Implementation that ignores the warning.
Definition exceptions.hpp:138
DEPRECATE(static void implicitCastStatic(::std::false_type const &), "static_warning: Implicit conversion of CoDiPack type to real.")
Implementation that displayes the warning.
Definition exceptions.hpp:134