Skip to content

Commit 55b3fb5

Browse files
committed
Vulkan: remove unnecessary lower bound checks for H/W_idx in the conv_2d shader.
1 parent 7e24d17 commit 55b3fb5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ggml/src/ggml-vulkan/vulkan-shaders/conv2d_mm.comp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ void main() {
288288
min(max(W_idx + H_idx * p.nb11 + Cin_idx_b * p.nb12 + N_idx * p.nb13, 0), p.Cin * p.N * p.W * p.H - 1);
289289
float val = src_data[src_idx];
290290
if (CRS_idx_b >= CRS || NPQ_idx >= NPQ
291-
|| int32_t(H_idx) < 0 || H_idx >= p.H || int32_t(W_idx) < 0 || W_idx >= p.W
291+
|| H_idx >= p.H || W_idx >= p.W // Lower bound checks aren't necessary. (idx >= 0x80000000 for such case)
292292
#ifdef TRANSPOSE
293293
|| (H_idx_x_s1 - H_idx * p.s1 != 0) || (W_idx_x_s0 - W_idx * p.s0 != 0)
294294
#endif

0 commit comments

Comments
 (0)