mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
17 lines
507 B
Common Lisp
17 lines
507 B
Common Lisp
__kernel void forward(__global float *input, int c, int h, int w, int crop_height, int crop_width, int dh, int dw, int flip, __global float *output)
|
|
{
|
|
int id = get_global_id(0);
|
|
int count = id;
|
|
int j = id % crop_width;
|
|
id /= crop_width;
|
|
int i = id % crop_height;
|
|
id /= crop_height;
|
|
int k = id % c;
|
|
id /= c;
|
|
int b = id;
|
|
int col = (flip) ? w - dw - j - 1 : j + dw;
|
|
int row = i + dh;
|
|
int index = col+w*(row+h*(k + c*b));
|
|
output[count] = input[index];
|
|
}
|