Skip to content

Commit f2af786

Browse files
committed
*fix bug: Error in class InputMemoryStream.
1 parent 2452284 commit f2af786

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

docs/2025.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ <h5>Bug fixing</h5>
6363
<li>Error in AMX-BF16 optimizations of function DepthwiseConvolutionLargePad.</li>
6464
<li>Error in Base implementation of class SynetMergedConvolution16bCdc.</li>
6565
<li>Error in Base implementation of class SynetMergedConvolution16bCd.</li>
66+
<li>Error in class InputMemoryStream.</li>
6667
</ul>
6768
<h5>Removing</h5>
6869
<ul>

docs/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ <h3>Contributors</h3>
7575
<p> 2024-2024 <a href="http://github.com/CC493">Sergey Chezhin</a>.</p>
7676
<p> 2024-2024 <a href="http://github.com/TareHimself">Tare</a>.</p>
7777
<p> 2024-2024 <a href="http://github.com/bmharper">Ben Harper</a>.</p>
78+
<p> 2024-2024 <a href="http://github.com/T8902">Ties Dirksen</a>.</p>
7879
</td>
7980
</tr> </table>
8081

src/Simd/SimdMemoryStream.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
* Simd Library (http://ermig1979.github.io/Simd).
33
*
44
* Copyright (c) 2011-2023 Yermalayeu Ihar,
5-
* 2022-2022 Fabien Spindler.
5+
* 2022-2022 Fabien Spindler,
6+
* 2024-2024 Ties Dirksen.
67
*
78
* Permission is hereby granted, free of charge, to any person obtaining a copy
89
* of this software and associated documentation files (the "Software"), to deal
@@ -196,7 +197,7 @@ namespace Simd
196197
if (!SkipGap())
197198
return false;
198199
value = 0;
199-
while (!IsGap(_data[_pos]) && _pos < _size)
200+
while (_pos < _size && !IsGap(_data[_pos]))
200201
{
201202
if (_data[_pos] >= '0' && _data[_pos] <= '9')
202203
value = value * 10 + Unsigned(_data[_pos] - '0');
@@ -219,21 +220,21 @@ namespace Simd
219220

220221
SIMD_INLINE bool SkipValue(uint8_t value)
221222
{
222-
while (_data[_pos] == value && _pos < _size)
223+
while (_pos < _size && _data[_pos] == value)
223224
_pos++;
224225
return _pos < _size;
225226
}
226227

227228
SIMD_INLINE bool SkipNotGap()
228229
{
229-
while (!IsGap(_data[_pos]) && _pos < _size)
230+
while (_pos < _size && !IsGap(_data[_pos]))
230231
_pos++;
231232
return _pos < _size;
232233
}
233234

234235
SIMD_INLINE bool SkipGap()
235236
{
236-
while (IsGap(_data[_pos]) && _pos < _size)
237+
while (_pos < _size && IsGap(_data[_pos]))
237238
_pos++;
238239
return _pos < _size;
239240
}
@@ -278,7 +279,7 @@ namespace Simd
278279
SIMD_INLINE void FillBits()
279280
{
280281
static const size_t canReadByte = (sizeof(_bitBuffer) - 1) * 8;
281-
while (_bitCount <= canReadByte && _pos < _size)
282+
while (_pos < _size && _bitCount <= canReadByte)
282283
{
283284
_bitBuffer |= (size_t)_data[_pos++] << _bitCount;
284285
_bitCount += 8;

src/Test/TestSynetMergedConvolution16b.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,10 @@ namespace Test
282282
//result = result && SynetMergedConvolution16bForwardAutoTest(eps, Param(Shp(2, 512, 127, 127), Cnv(a0, 1, 1, 1024), Cnv(a1, 3, 1), Cnv(a2, 1, 1, 512), t, f32, f32), f1, f2);
283283
#endif
284284
#if 1
285-
result = result && SynetMergedConvolution16bForwardAutoTest(eps, Param(Shp(1, 512, 8, 6), Cnv(aSw, 1, 1, 512), Cnv(aId, 3, 1), b16, f32), f1, f2);
285+
result = result && SynetMergedConvolution16bForwardAutoTest(eps, Param(Shp(1, 512, 8, 6), Cnv(aSw, 1, 1, 512), Cnv(aSw, 3, 1), b16, f32), f1, f2);
286286
result = result && SynetMergedConvolution16bForwardAutoTest(eps, Param(Shp(1, 512, 6, 8), Cnv(aSw, 1, 1, 512), Cnv(aSw, 3, 1), b16, f32), f1, f2);
287-
result = result && SynetMergedConvolution16bForwardAutoTest(eps, Param(Shp(1, 512, 12, 12), Cnv(aSw, 1, 1, 512), Cnv(aSw, 3, 1), b16, b16), f1, f2);
288-
result = result && SynetMergedConvolution16bForwardAutoTest(eps, Param(Shp(1, 128, 24, 24), Cnv(aSw, 1, 1, 128), Cnv(aSw, 3, 1), b16, b16), f1, f2);
289-
result = result && SynetMergedConvolution16bForwardAutoTest(eps, Param(Shp(1, 64, 48, 48), Cnv(aSw, 1, 1, 64), Cnv(aSw, 3, 1), b16, b16), f1, f2);
287+
result = result && SynetMergedConvolution16bForwardAutoTest(eps, Param(Shp(1, 512, 12, 4), Cnv(aSw, 1, 1, 512), Cnv(aSw, 3, 1), b16, f32), f1, f2);
288+
result = result && SynetMergedConvolution16bForwardAutoTest(eps, Param(Shp(1, 512, 4, 12), Cnv(aSw, 1, 1, 512), Cnv(aSw, 3, 1), b16, b16), f1, f2);
290289
#endif
291290
#else
292291
{

0 commit comments

Comments
 (0)