File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
ggml/src/ggml-vulkan/vulkan-shaders Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -68,19 +68,20 @@ void main() {
68
68
continue;
69
69
}
70
70
71
- const uint iiw = int( current_ix) * p.s0 + int( current_kx) * p.d0 - p.p0;
72
- const uint iih = oh_s1 + int( current_ky) * p.d1 - p.p1;
71
+ const uint iiw = current_ix * p.s0 + current_kx * p.d0 - p.p0;
72
+ const uint iih = oh_s1 + current_ky * p.d1 - p.p1;
73
73
74
74
offset_dst[idx] = dst_base + current_ix * p.CHW + current_ky * p.KW + current_kx;
75
75
76
- const bool valid = (iih >= 0 && iih < int(p.IH)) && (iiw >= 0 && iiw < int(p.IW));
77
- if (valid) {
78
- values[idx] = data_a[src_base + uint(iih) * p.IW + uint(iiw)];
76
+ if ((iih < p.IH) && (iiw < p.IW)) {
77
+ values[idx] = data_a[src_base + iih * p.IW + iiw];
79
78
}
80
79
81
- if (++current_ix == p.OW) {
80
+ current_ix++;
81
+ if (current_ix == p.OW) {
82
82
current_ix = 0;
83
- if (++current_ky == max_ky) {
83
+ current_ky++;
84
+ if (current_ky == max_ky) {
84
85
current_ky = 0;
85
86
current_kx++;
86
87
}
You can’t perform that action at this time.
0 commit comments