26 #define MUL_OP(x, y) ((x) * (y)) 27 #define ADD_OP(x, y) ((x) + (y)) 28 #define DIV_OP(x, y) ((x) / (y)) 29 #define POW_OP(x, y) pow((x), (y)) 30 #define SQCVT_SAT(a) (a) 32 #define LOAD_OP(offset, ptr) vload4(offset, ptr) 33 #define STORE_OP(data, offset, ptr) vstore4(data, offset, ptr) 35 #if defined(NUM_SLICES) 76 const int current_slice = get_global_id(2);
77 const int left_slice = max(-(
int)RADIUS, -current_slice);
78 const int right_slice = min((
int)RADIUS, (
int)NUM_SLICES - 1 - current_slice);
80 for(
int i = left_slice; i <= right_slice; i++)
89 normalized =
POW_OP(acc, beta_v);
97 #if defined(WIDTH_SIZE) 137 const int current_col = get_global_id(0) << 2;
138 const int left_pos = max(-(
int)RADIUS, -3 - current_col);
139 const int right_pos = min((
int)RADIUS, (
int)WIDTH_SIZE - 1 - current_col);
141 #if defined(IN_MAP_2D) 142 const int current_row = get_global_id(1);
143 const int first_row = max(-(
int)RADIUS, -current_row);
144 const int last_row = min((
int)RADIUS, (
int)get_global_size(1) - 1 - current_row);
147 #if defined(IN_MAP_2D) 148 for(
int j = first_row; j <= last_row; ++j)
151 for(
int i = left_pos; i <= right_pos; ++i)
153 #if defined(IN_MAP_2D) 162 #if defined(IN_MAP_2D) 168 normalized =
POW_OP(acc, beta_v);
174 #endif // defined(WIDTH_SIZE) 176 #if defined(NUM_SLICES) 217 const int current_cols = get_global_id(1);
218 const int first_col = max(-(
int)RADIUS, -current_cols);
219 const int last_col = min((
int)RADIUS, (
int)get_global_size(1) - 1 - current_cols);
221 #if defined(IN_MAP_2D) 222 const int current_rows = get_global_id(2);
223 const int first_row = max(-(
int)RADIUS, -current_rows);
224 const int last_row = min((
int)RADIUS, (
int)NUM_SLICES - 1 - current_rows);
227 #if defined(IN_MAP_2D) 228 for(
int j = first_row; j <= last_row; ++j)
231 for(
int i = first_col; i <= last_col; ++i)
233 #if defined(IN_MAP_2D) 242 #if defined(IN_MAP_2D) 248 normalized =
POW_OP(acc, beta_v);
#define LOAD_OP(offset, ptr)
Structure to hold 3D tensor information.
#define STORE_OP(data, offset, ptr)
#define CONVERT_TO_TENSOR3D_STRUCT(name)
__global uchar * ptr
Pointer to the starting postion of the buffer.
#define TENSOR3D_DECLARATION(name)
__global const uchar * tensor3D_offset(const Tensor3D *tensor, int x, int y, int z)
Get the pointer position of a Tensor3D.
#define VEC_DATA_TYPE(type, size)