35 #undef ASSERT_DECLARE_UNIQUE_PARAMS 36 #undef ASSERT_DECLARE_PARAMS 37 #undef ASSERT_UNIQUE_PARAMS 59 #undef last_assert_n_x 62 #undef last_assert_n_r 63 #undef last_assert_x_r 64 #undef last_assert_n_x_r 67 #undef last_assert_n_r0 68 #undef last_assert_x_r0 69 #undef last_assert_n_x_r0 74 # define ASSERT_DECLARE_UNIQUE_PARAMS 75 # define ASSERT_DECLARE_PARAMS 76 # define ASSERT_UNIQUE_PARAMS 77 # define ASSERT_PARAMS 80 # define assert(test) ((void)0) 81 # define assert_n(test, integer_value) ((void)0) 82 # define assert_x(test, float_value) ((void)0) 83 # define assert_n_x(test, integer_value, float_value) ((void)0) 85 # define assert_r(test) ((void)0) 86 # define assert_n_r(test, integer_value) ((void)0) 87 # define assert_x_r(test, float_value) ((void)0) 88 # define assert_n_x_r(test, integer_value, float_value) ((void)0) 90 # define assert_r0(test) ((void)0) 91 # define assert_n_r0(test, integer_value) ((void)0) 92 # define assert_x_r0(test, float_value) ((void)0) 93 # define assert_n_x_r0(test, integer_value, float_value) ((void)0) 95 # define last_assert(test) ((void)0) 96 # define last_assert_n(test, integer_value) ((void)0) 97 # define last_assert_x(test, float_value) ((void)0) 98 # define last_assert_n_x(test, integer_value, float_value) ((void)0) 100 # define last_assert_r(test) ((void)0) 101 # define last_assert_n_r(test, integer_value) ((void)0) 102 # define last_assert_x_r(test, float_value) ((void)0) 103 # define last_assert_n_x_r(test, integer_value, float_value) ((void)0) 105 # define last_assert_r0(test) ((void)0) 106 # define last_assert_n_r0(test, integer_value) ((void)0) 107 # define last_assert_x_r0(test, float_value) ((void)0) 108 # define last_assert_n_x_r0(test, integer_value, float_value) ((void)0) 118 # define ASSERT_DECLARE_UNIQUE_PARAMS __global unsigned long* const assert_result_, __global float* const assert_result_float_ 124 # define ASSERT_DECLARE_PARAMS , ASSERT_DECLARE_UNIQUE_PARAMS 130 # define ASSERT_UNIQUE_PARAMS assert_result_, assert_result_float_ 136 # define ASSERT_PARAMS , ASSERT_UNIQUE_PARAMS 142 # define assert_reset { \ 143 assert_result_[0] = 0; \ 144 assert_result_[1] = 0; \ 145 assert_result_float_[0] = 0.0; \ 146 barrier(CLK_GLOBAL_MEM_FENCE); \ 162 # define assert(test) assert_n_x(test, 0, 0.0) 177 # define assert_n(test, integer_value) assert_n_x(test, integer_value, 0.0) 192 # define assert_x(test, float_value) assert_n_x(test, 0, float_value) 208 # define assert_n_x(test, integer_value, float_value) \ 209 assert_fct_(test, __FILE__, __LINE__, #test, \ 210 integer_value, float_value, \ 211 assert_result_, assert_result_float_) 223 # define assert_r(test) { \ 224 if (!assert(test)) { \ 239 # define assert_n_r(test, integer_value) { \ 240 if (!assert_n(test, integer_value)) { \ 255 # define assert_x_r(test, float_value) { \ 256 if (!assert_x(test, float_value)) { \ 272 # define assert_n_x_r(test, integer_value, float_value) { \ 273 if (!assert_n_x(test, integer_value, float_value)) { \ 288 # define assert_r0(test) { \ 289 if (!assert(test)) { \ 304 # define assert_n_r0(test, integer_value) { \ 305 if (!assert_n(test, integer_value)) { \ 320 # define assert_x_r0(test, float_value) { \ 321 if (!assert_x(test, float_value)) { \ 337 # define assert_n_x_r0(test, integer_value, float_value) { \ 338 if (!assert_n_x(test, integer_value, float_value)) { \ 356 # define last_assert(test) last_assert_n_x(test, 0, 0.0) 371 # define last_assert_n(test, integer_value) last_assert_n_x(test, integer_value, 0.0) 386 # define last_assert_x(test, float_value) last_assert_n_x(test, 0, float_value) 402 # define last_assert_n_x(test, integer_value, float_value) \ 403 last_assert_fct_(test, __FILE__, __LINE__, #test, \ 404 integer_value, float_value, \ 405 assert_result_, assert_result_float_) 417 # define last_assert_r(test) { \ 418 if (!last_assert(test)) { \ 433 # define last_assert_n_r(test, integer_value) { \ 434 if (!last_assert_n(test, integer_value)) { \ 449 # define last_assert_x_r(test, float_value) { \ 450 if (!last_assert_x(test, float_value)) { \ 466 # define last_assert_n_x_r(test, integer_value, float_value) { \ 467 if (!last_assert_n_x(test, integer_value, float_value)) { \ 482 # define last_assert_r0(test) { \ 483 if (!last_assert(test)) { \ 498 # define last_assert_n_r0(test, integer_value) { \ 499 if (!last_assert_n(test, integer_value)) { \ 514 # define last_assert_x_r0(test, float_value) { \ 515 if (!last_assert_x(test, float_value)) { \ 531 # define last_assert_n_x_r0(test, integer_value, float_value) { \ 532 if (!last_assert_n_x(test, integer_value, float_value)) { \ 570 __constant
char*
const filename,
const unsigned int line,
571 __constant
char*
const assertion,
572 const unsigned long integer_value,
const float float_value,
573 __global
unsigned long*
const assert_result,
574 __global
float*
const assert_result_float) {
576 if (assert_result[0] == 0) {
577 assert_result[0] = line;
578 assert_result[1] = integer_value;
579 assert_result_float[0] = float_value;
581 #if __OPENCL_C_VERSION__ >= 120 // CL_VERSION_1_2 582 printf(
"[%s:%u\tAssertion `%s' failed |\t%lu\t%li |\t%f]\n", filename, line, assertion,
583 integer_value, (
signed long)integer_value, float_value);
615 __constant
char*
const filename,
const unsigned int line,
616 __constant
char*
const assertion,
617 const unsigned long integer_value,
const float float_value,
618 __global
unsigned long*
const assert_result,
619 __global
float*
const assert_result_float) {
621 assert_result[0] = line;
622 assert_result[1] = integer_value;
623 assert_result_float[0] = float_value;
624 #if __OPENCL_C_VERSION__ >= 120 // CL_VERSION_1_2 625 printf(
"[%s:%u\tAssertion `%s' failed |\t%lu\t%li\t%f]\n", filename, line, assertion,
626 integer_value, (
signed long)integer_value, float_value);
bool assert_fct_(const bool test, __constant char *const filename, const unsigned int line, __constant char *const assertion, const unsigned long integer_value, const float float_value, __global unsigned long *const assert_result, __global float *const assert_result_float)
Generic function called by all assert*() macros in debug mode.
bool last_assert_fct_(const bool test, __constant char *const filename, const unsigned int line, __constant char *const assertion, const unsigned long integer_value, const float float_value, __global unsigned long *const assert_result, __global float *const assert_result_float)
Generic function called by all last_assert*() macros in debug mode. Similar to assert_fct_() but sets...