26 #if defined(DATA_TYPE) // Compile time constants 49 __kernel
void crop_tensor(
58 const int in_x = get_global_id(0) * (in_step_x / in_stride_x);
60 #if defined(WIDTH_FLIPPED) 61 const int in_y = in_offset_y - get_global_id(1);
62 #else // defined(WIDTH_FLIPPED) 63 const int in_y = in_offset_y + get_global_id(1);
64 #endif // defined(WIDTH_FLIPPED) 66 #if defined(HEIGHT_FLIPPED) 67 const int in_z = in_offset_z - get_global_id(2);
68 #else // defined(HEIGHT_FLIPPED) 69 const int in_z = in_offset_z + get_global_id(2);
70 #endif // defined(HEIGHT_FLIPPED) 74 #if defined(LAST_ACCESSED_X) 77 const int shift = max((
int)(get_global_id(0) *
VEC_SIZE) - (
int)LAST_ACCESSED_X, 0);
80 #endif // defined(LAST_ACCESSED_X) 82 __global
const uchar *input_addr =
tensor3D_offset(&in, in_x, in_y, in_z);
91 #else // defined(VEC_SIZE) 93 #endif // defined(VEC_SIZE) 96 #endif // defined(DATA_TYPE) && defined(LAST_ACCESSED_X)
int stride_x
Stride of the image in X dimension (in bytes)
Structure to hold 3D tensor information.
#define CONVERT_TO_TENSOR3D_STRUCT_NO_STEP(name)
#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)