/*
 ============================================================================
 Name        : gemm.vx
 Author      : Sam
 Version     :
 Copyright   : Your copyright notice
 Description :
 ============================================================================
 */
#include "cl_viv_vx_ext.h"

_viv_uniform int4 extract_packed;
__kernel void vxcTransform_setupThres_F16toF16
    (
    __read_only     image2d_array_t initTensor,
    __read_only     image2d_array_t inputFC,
     global int*     thresFlag,
    __write_only    image2d_array_t thres
    )
{
    int2 coord    = (int2)(0, 0);

    vxc_ushort8 src0, src1, dst;

    int flag = *thresFlag;
    VXC_ReadImage(src0, initTensor, coord, VXC_5BITOFFSET_XY(0, 0), VXC_MODIFIER(0, 5, 0, VXC_RM_TowardZero, 0));
    VXC_ReadImage(src1, inputFC, coord, VXC_5BITOFFSET_XY(0, 0), VXC_MODIFIER(0, 5, 0, VXC_RM_TowardZero, 0));

    VXC_BitExtract(dst, src0, src1, extract_packed, VXC_MODIFIER(0, 5, 0, VXC_RM_TowardZero, 0));

    VXC_WriteImage(thres, coord, dst, VXC_MODIFIER(0, 5, 0, VXC_RM_TowardZero, 0));
}
