ficus icon indicating copy to clipboard operation
ficus copied to clipboard

Fix possible out-of-bounds bug in OpConv.fx

Open zihaomu opened this issue 2 years ago • 2 comments

Fix possible out-of-bounds bug

zihaomu avatar Aug 18 '22 07:08 zihaomu

@zihaomu, this is not a bug. Please, check the condition on the next line:

if (j + 8 > out_width) {
...

this is so-called "Halide trick" of handling loop tails

vpisarev avatar Aug 19 '22 20:08 vpisarev

Hi @vpisarev, I get your point now. A very useful trick so that the end of the loop can still use SIMD acceleration. That means there some tails will be computed twice.

And when pbptr is true, it may cause bugs if you still use another trick you told me before (pb_data was saved as Conv's output_data). If pb_data is different from output_data, it works fine.

zihaomu avatar Aug 19 '22 23:08 zihaomu