Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

Doubt on cnn_custom_kernel sample code

Deepak_C_R
Beginner
1,071 Views

In cnn_custom_kernel there is oclCropMD() function.

kernel void oclCropMD
(
        const __global float* input, // Pointer to data
        int     num_dims_in, //number of tensor dimensions
        const __global int* dims_in, // tensor dims
        const __global int* stride_in, // tensor strides in bytes for each dim, step between two neighbor voxels

        uint     offset_x,
        uint     offset_y,

        __global float* output, // Pointer to data
        int     num_dims_out, //number of tensor dimensions
        const __global int* dims_out, // tensor dims
        const __global int* stride_out // tensor strides in bytes for each dim, step between two neighbor voxels
)
{
    const int inp_size_x = dims_in[0];
    const int inp_size_y = dims_in[1];
    const int out_size_x = dims_out[0];
    const int out_size_y = dims_out[1];

    const int x = get_global_id(0);
    const int y =  get_global_id(1)%out_size_y;
    const int ifm = get_global_id(1)/out_size_y;
    output[out_size_x*out_size_y*ifm + out_size_x*y +x] = input[inp_size_x*inp_size_y*ifm +  inp_size_x*(offset_y+y) + (offset_x + x)];
}

Is this function is called bypassing original crop function. (Is this function called instead of the original crop layer) ?

 

Thank you.

 

 

 

 

0 Kudos
2 Replies
Stav_S_Intel
Employee
1,071 Views

Hi, 

This is not bypassing but the OpenVX implementation of crop function. 

 

Regards,

Stav

0 Kudos
Deepak_C_R
Beginner
1,071 Views

Yea. I understood.

0 Kudos
Reply