dashboard
repositories
filestore
activity
search
login
speedprog
/
mtg/mtg_card_detector
summary
reflog
commits
tree
tickets
docs
forks
compare
blame
|
history
|
raw
I am so done with opencl, switching to cuda
Joseph Redmon
2015-01-20
4ac78c89269138b4623993f9f1d81829d8e88131
[~speedprog/mtg/mtg_card_detector.git]
/
src
/
crop_layer.cl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
__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];
}