#include "opencl_source_map.hpp" namespace MNN { #ifndef MNN_OPENCL_BUFFER_CLOSED const char* cast_buf = "#ifdef MNN_SUPPORT_FP16\n" "#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n" "#endif\n" "#define GLOBAL_SIZE_2_DIMS ""__private const int global_size_dim0,__private const int global_size_dim1,\n" "#define DEAL_NON_UNIFORM_DIM2(input1, input2) "" if (input1 >= global_size_dim0 || input2 >= global_size_dim1) { "" return; "" }\n" "__kernel void cast_buf(GLOBAL_SIZE_2_DIMS\n" " __global INPUT_TYPE* input,\n" " __global OUTPUT_TYPE* output,\n" " __private const int size\n" " ) {\n" " const int idx=get_global_id(0);\n" " const int idy=get_global_id(1);\n" " DEAL_NON_UNIFORM_DIM2(idx,idy);\n" " const int inp_offset=idx*4;\n" "#ifdef PACK_LEAVE\n" " if(inp_offset+3 >= size){\n" " int remain=size-inp_offset;\n" " for(int i=0; i