37#if defined(NOCTAssert)
40#define CTAssert(c) IpplCTAssert<(c)>::test()
57 assertion(
const char* cond,
const char* file,
int line);
67 using std::runtime_error::what;
69 virtual const char*
what() {
return msg; };
79void toss_cookies(
const char* cond,
const char* file,
int line);
80template <
class S,
class T>
81void toss_cookies(
const char* cond,
const char* astr,
const char* bstr, S a,
T b,
const char* file,
83 std::string what =
"Assertion '" + std::string(cond) +
"' failed. \n";
84 what += std::string(astr) +
" = " + std::to_string(a) +
", ";
85 what += std::string(bstr) +
" = " + std::to_string(b) +
"\n";
87 what += std::string(file) +
", line " + std::to_string(line);
89 throw std::runtime_error(what);
91void insist(
const char* cond,
const char* msg,
const char* file,
int line);
104#define PAssert_EQ(a, b)
105#define PAssert_NE(a, b)
106#define PAssert_LT(a, b)
107#define PAssert_LE(a, b)
108#define PAssert_GT(a, b)
109#define PAssert_GE(a, b)
111#if defined(__HIP_PLATFORM_AMD__) \
112 || defined(__CUDA_ARCH__)
114#define PAssert_CMP(cmp, a, b)
118 toss_cookies(#c, __FILE__, __LINE__);
119#define PAssert_CMP(cmp, a, b) \
121 toss_cookies(#cmp, #a, #b, a, b, __FILE__, __LINE__);
123#define PAssert_EQ(a, b) PAssert_CMP(a == b, a, b)
124#define PAssert_NE(a, b) PAssert_CMP(a != b, a, b)
125#define PAssert_LT(a, b) PAssert_CMP(a < b, a, b)
126#define PAssert_LE(a, b) PAssert_CMP(a <= b, a, b)
127#define PAssert_GT(a, b) PAssert_CMP(a > b, a, b)
128#define PAssert_GE(a, b) PAssert_CMP(a >= b, a, b)
139#define PInsist(c, m) \
141 insist(#c, m, __FILE__, __LINE__);
void insist(const char *cond, const char *msg, const char *file, int line)
void toss_cookies(const char *cond, const char *file, int line)
assertion & operator=(const assertion &a)
assertion(const char *cond, const char *file, int line)
virtual const char * what()