Download modules/core/src/opencl/repeat.cl from tgollogly/test: direct link, hf CLI and curl.
- Browser
- Download file 1.73 kB
-
https://huggingface.co/tgollogly/test/resolve/main/modules/core/src/opencl/repeat.cl
- Command line
-
hf download hf://tgollogly/test/modules/core/src/opencl/repeat.cl
-
curl -L -o repeat.cl https://huggingface.co/tgollogly/test/resolve/main/modules/core/src/opencl/repeat.cl
1.73 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 repeat(__global const uchar * srcptr, int src_step, int src_offset, int src_rows, int src_cols, | |
| __global uchar * dstptr, int dst_step, int dst_offset) | |
| { | |
| int x = get_global_id(0); | |
| int y0 = get_global_id(1) * rowsPerWI; | |
| if (x < src_cols) | |
| { | |
| int src_index = mad24(y0, src_step, mad24(x, (int)sizeof(T), src_offset)); | |
| int dst_index0 = mad24(y0, dst_step, mad24(x, (int)sizeof(T), dst_offset)); | |
| for (int y = y0, y1 = min(src_rows, y0 + rowsPerWI); y < y1; ++y, src_index += src_step, dst_index0 += dst_step) | |
| { | |
| T srcelem = loadpix(srcptr + src_index); | |
| for (int ey = 0; ey < ny; ++ey) | |
| { | |
| int dst_index = mad24(ey * src_rows, dst_step, dst_index0); | |
| for (int ex = 0; ex < nx; ++ex) | |
| { | |
| storepix(srcelem, dstptr + dst_index); | |
| dst_index = mad24(src_cols, (int)sizeof(T), dst_index); | |
| } | |
| } | |
| } | |
| } | |
| } | |