mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
dnn(ocl): avoid mess FP16/FP32 in convolution layer
This commit is contained in:
@@ -138,7 +138,7 @@ static bool ocl_convertFp16( InputArray _src, OutputArray _dst, int sdepth, int
|
||||
sdepth == CV_32F ? "half" : "float",
|
||||
rowsPerWI,
|
||||
sdepth == CV_32F ? " -D FLOAT_TO_HALF " : "");
|
||||
ocl::Kernel k("convertFp16", ocl::core::halfconvert_oclsrc, build_opt);
|
||||
ocl::Kernel k(sdepth == CV_32F ? "convertFp16_FP32_to_FP16" : "convertFp16_FP16_to_FP32", ocl::core::halfconvert_oclsrc, build_opt);
|
||||
if (k.empty())
|
||||
return false;
|
||||
|
||||
|
||||
@@ -47,8 +47,17 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
__kernel void convertFp16(__global const uchar * srcptr, int src_step, int src_offset,
|
||||
__global uchar * dstptr, int dst_step, int dst_offset, int dst_rows, int dst_cols)
|
||||
__kernel void
|
||||
#ifdef FLOAT_TO_HALF
|
||||
convertFp16_FP32_to_FP16
|
||||
#else
|
||||
convertFp16_FP16_to_FP32
|
||||
#endif
|
||||
(
|
||||
__global const uchar * srcptr, int src_step, int src_offset,
|
||||
__global uchar * dstptr, int dst_step, int dst_offset,
|
||||
int dst_rows, int dst_cols
|
||||
)
|
||||
{
|
||||
int x = get_global_id(0);
|
||||
int y0 = get_global_id(1) * rowsPerWI;
|
||||
|
||||
Reference in New Issue
Block a user