Skip to content

Commit 229ee99

Browse files
committed
+add _dstMask initialization in SynetConvolution16bNhwcSpecV2::SetAlgParam.
1 parent 0280106 commit 229ee99

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Simd/SimdBaseSynetConvolution16bNhwcSpecV2.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,23 @@ namespace Simd
9797
for (size_t y = 0, offsY = offsS; y < p.kernelY; y += 1, offsY += dY)
9898
for (size_t offsX = offsY, endX = offsY + p.kernelX * dX; offsX < endX; offsX += dX, i++)
9999
_srcOffs[i] = (int)offsX;
100+
101+
_dstMask.Resize(AlignHi((a.srcH * a.batch - a.gapV) * a.srcW - a.padH, a.F));
102+
size_t i = 0;
103+
for (size_t b = 0; b < a.batch; b++)
104+
{
105+
for (size_t y = 0; y < p.dstH; y++)
106+
{
107+
for (size_t x = 0; x < p.dstW; x++, i++)
108+
_dstMask[i] = -1;
109+
for (size_t x = 0; x < a.gapH; x++, i++)
110+
_dstMask[i] = 0;
111+
}
112+
for (size_t y = 0, gapI = a.gapV * a.srcW; y < gapI && i < _dstMask.size; y++, i++)
113+
_dstMask[i] = 0;
114+
}
115+
for (; i < _dstMask.size; i++)
116+
_dstMask[i] = 0;
100117
}
101118

102119
size_t SynetConvolution16bNhwcSpecV2::ExternalBufferSize() const

0 commit comments

Comments
 (0)