Download modules/core/src/opencl/normalize.cl from tgollogly/test: direct link, hf CLI and curl.
- Browser
- Download file 2.33 kB
-
https://huggingface.co/tgollogly/test/resolve/main/modules/core/src/opencl/normalize.cl
- Command line
-
hf download hf://tgollogly/test/modules/core/src/opencl/normalize.cl
-
curl -L -o normalize.cl https://huggingface.co/tgollogly/test/resolve/main/modules/core/src/opencl/normalize.cl
2.33 kB
| // This file is part of OpenCV project. | |
| // It is subject to the license terms in the LICENSE file found in the top-level directory | |
| // of this distribution and at http://opencv.org/license.html. | |
| // Copyright (C) 2014, Itseez, Inc., all rights reserved. | |
| // Third party copyrights are property of their respective owners. | |
| __kernel void normalizek(__global const uchar * srcptr, int src_step, int src_offset, | |
| __global const uchar * mask, int mask_step, int mask_offset, | |
| __global uchar * dstptr, int dst_step, int dst_offset, int dst_rows, int dst_cols | |
| , float scale | |
| , float delta | |
| ) | |
| { | |
| int x = get_global_id(0); | |
| int y0 = get_global_id(1) * rowsPerWI; | |
| if (x < dst_cols) | |
| { | |
| int src_index = mad24(y0, src_step, mad24(x, srcTSIZE, src_offset)); | |
| int mask_index = mad24(y0, mask_step, x + mask_offset); | |
| int dst_index = mad24(y0, dst_step, mad24(x, dstTSIZE, dst_offset)); | |
| for (int y = y0, y1 = min(y0 + rowsPerWI, dst_rows); y < y1; | |
| ++y, src_index += src_step, dst_index += dst_step, mask_index += mask_step) | |
| { | |
| if (mask[mask_index]) | |
| { | |
| workT value = convertToWT(loadpix(srcptr + src_index)); | |
| value = fma(value, (workT)(scale), (workT)(delta)); | |
| value *= (workT)(scale); | |
| value += (workT)(delta); | |
| storepix(convertToDT(value), dstptr + dst_index); | |
| } | |
| } | |
| } | |
| } | |