25 #if defined(DATA_TYPE) && defined(SRC_WIDTH) && defined(SRC_HEIGHT) && defined(SRC_DEPTH) && defined(DST_DEPTH) 57 const int y = get_global_id(1);
58 const int z = get_global_id(2) % DST_DEPTH;
59 const int batch = get_global_id(2) / DST_DEPTH;
61 #if defined(VEC_SIZE) && defined(OFFSET) 65 const int id = (int)(get_global_id(0));
69 const int tile_number = x / SRC_WIDTH;
70 x -= (tile_number) * OFFSET;
71 int x_input = x % SRC_WIDTH;
74 const int last_tile = (int)(x_input + VEC_SIZE > SRC_WIDTH);
75 x -= last_tile * OFFSET;
76 x_input = x % SRC_WIDTH;
77 output.
ptr -= (tile_number + last_tile) * OFFSET * output_stride_x;
80 input.
ptr =
tensor4D_offset(&input, x_input, y % SRC_HEIGHT, z % SRC_DEPTH, batch % SRC_BATCHES);
88 #else // !defined(VEC_SIZE) || !defined(OFFSET) 89 const int x = get_global_id(0);
92 input.
ptr =
tensor4D_offset(&input, x % SRC_WIDTH, y % SRC_HEIGHT, z % SRC_DEPTH, batch % SRC_BATCHES);
95 #endif // defined(VEC_SIZE) && defined(OFFSET) 97 #endif // defined(DATA_TYPE) && defined(SRC_WIDTH) && defined(SRC_HEIGHT) && defined(SRC_DEPTH) && defined(DST_DEPTH) __global uchar * ptr
Pointer to the starting postion of the buffer.
Structure to hold 4D tensor information.
#define CONVERT_TO_TENSOR4D_STRUCT_NO_STEP(name, mod_size)
__global const uchar * tensor4D_offset(const Tensor4D *tensor, int x, int y, int z, int w)
Get the pointer position of a Tensor4D.
#define CONVERT_TO_TENSOR4D_STRUCT(name, mod_size)
SimpleTensor< T > tile(const SimpleTensor< T > &src, const Multiples &multiples)
#define TENSOR4D_DECLARATION(name)
#define VEC_DATA_TYPE(type, size)