84 __global
unsigned int*
const outs
86 const unsigned int g_id = get_global_id(0);
87 const unsigned int l_id = get_local_id(0);
91 PRINT2(
"global, local id: %u, %u\n", g_id, l_id);
93 for (
unsigned int i = 0; i < 1000000; ++i) {
94 barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);
109 assert_n(
sizeof(
unsigned int) == 4,
sizeof(
unsigned int));
110 assert_n(
sizeof(
float) == 4,
sizeof(
float));
120 PRINT(
"PRINT message\n");
121 PRINT1(
"PRINT1 %u\n", 42);
122 PRINT2(
"PRINT2 %u %i\n", 42, -1);
123 PRINT3(
"PRINT2 %u %i %f\n", 42, -1, 3.14);
130 PRINT(
"PRINT message\n");
131 PRINT1(
"PRINT1 %u\n", 42);
132 PRINT2(
"PRINT2 %u %i\n", 42, -1);
133 PRINT3(
"PRINT2 %u %i %f\n", 42, -1, 3.14);
155 # define NASSERT_NOT_DEFINED 173 #ifdef NASSERT_NOT_DEFINED #define PRINT2(format, a, b)
printf() function with 2 paramters.
#define assert_x(test, float_value)
If test is true then do nothing. Else init (if they are still null) assert_result and assert_result_f...
#define assert_n(test, integer_value)
If test is true then do nothing. Else init (if they are still null) assert_result and assert_result_f...
unsigned int bar(unsigned int n ASSERT_DECLARE_PARAMS)
#define assert_n_x_r(test, integer_value, float_value)
Like assert_n_x() but if assertion failed then return.
#define assert_n_r(test, integer_value)
Like assert_n() but if assertion failed then return.
#define ASSERT_UNIQUE_PARAMS
Transmit the extra parameters in the calling of a function with ASSERT_DECLARE_UNIQUE_PARAM.
void foo2(unsigned int n ASSERT_DECLARE_PARAMS)
void foo(ASSERT_DECLARE_UNIQUE_PARAMS)
#define ASSERT_PARAMS
Transmit the extra parameters in the calling of a function with ASSERT_DECLARE_PARAM.
#define last_assert_n_x(test, integer_value, float_value)
If test is true then do nothing. Else init (if they are still null) assert_result and assert_result_f...
#define assert_x_r(test, float_value)
Like assert_x() but if assertion failed then return.
Helper macros to use printf() function during development when it is available (from OpenCL 1...
#define assert_n_x(test, integer_value, float_value)
If test is true then do nothing. Else init (if they are still null) assert_result and assert_result_f...
#define assert(test)
If test is true then do nothing. Else init (if they are still null) assert_result and assert_result_f...
#define assert_r(test)
Like assert() but if assertion failed then return.
#define PRINT(str)
printf() function without paramters.
#define PRINT1(format, a)
printf() function with 1 paramter.
#define ASSERT_DECLARE_PARAMS
Declare extra parameters in the signature (with other params) of kernel function or other functions t...
#define assert_r0(test)
Like assert() but if assertion failed then return 0.
#define ASSERT_DECLARE_UNIQUE_PARAMS
Declare extra parameters in the signature (without other params) of kernel function or other function...
#define PRINT3(format, a, b, c)
printf() function with 3 paramters.
C-like assert alternative (because assert doesn't exist in OpenCL), with necessary helper macros to t...
__kernel void example(const unsigned int in, __global unsigned int *const outs ASSERT_DECLARE_PARAMS)