Skip to content

Commit

Permalink
*fix bug: Error in class InputMemoryStream.
Browse files Browse the repository at this point in the history
  • Loading branch information
ermig1979 committed Dec 24, 2024
1 parent 2452284 commit f2af786
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions docs/2025.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ <h5>Bug fixing</h5>
<li>Error in AMX-BF16 optimizations of function DepthwiseConvolutionLargePad.</li>
<li>Error in Base implementation of class SynetMergedConvolution16bCdc.</li>
<li>Error in Base implementation of class SynetMergedConvolution16bCd.</li>
<li>Error in class InputMemoryStream.</li>
</ul>
<h5>Removing</h5>
<ul>
Expand Down
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ <h3>Contributors</h3>
<p> 2024-2024 <a href="http://github.com/CC493">Sergey Chezhin</a>.</p>
<p> 2024-2024 <a href="http://github.com/TareHimself">Tare</a>.</p>
<p> 2024-2024 <a href="http://github.com/bmharper">Ben Harper</a>.</p>
<p> 2024-2024 <a href="http://github.com/T8902">Ties Dirksen</a>.</p>
</td>
</tr> </table>

Expand Down
13 changes: 7 additions & 6 deletions src/Simd/SimdMemoryStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* Simd Library (http://ermig1979.github.io/Simd).
*
* Copyright (c) 2011-2023 Yermalayeu Ihar,
* 2022-2022 Fabien Spindler.
* 2022-2022 Fabien Spindler,
* 2024-2024 Ties Dirksen.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -196,7 +197,7 @@ namespace Simd
if (!SkipGap())
return false;
value = 0;
while (!IsGap(_data[_pos]) && _pos < _size)
while (_pos < _size && !IsGap(_data[_pos]))
{
if (_data[_pos] >= '0' && _data[_pos] <= '9')
value = value * 10 + Unsigned(_data[_pos] - '0');
Expand All @@ -219,21 +220,21 @@ namespace Simd

SIMD_INLINE bool SkipValue(uint8_t value)
{
while (_data[_pos] == value && _pos < _size)
while (_pos < _size && _data[_pos] == value)
_pos++;
return _pos < _size;
}

SIMD_INLINE bool SkipNotGap()
{
while (!IsGap(_data[_pos]) && _pos < _size)
while (_pos < _size && !IsGap(_data[_pos]))
_pos++;
return _pos < _size;
}

SIMD_INLINE bool SkipGap()
{
while (IsGap(_data[_pos]) && _pos < _size)
while (_pos < _size && IsGap(_data[_pos]))
_pos++;
return _pos < _size;
}
Expand Down Expand Up @@ -278,7 +279,7 @@ namespace Simd
SIMD_INLINE void FillBits()
{
static const size_t canReadByte = (sizeof(_bitBuffer) - 1) * 8;
while (_bitCount <= canReadByte && _pos < _size)
while (_pos < _size && _bitCount <= canReadByte)
{
_bitBuffer |= (size_t)_data[_pos++] << _bitCount;
_bitCount += 8;
Expand Down
7 changes: 3 additions & 4 deletions src/Test/TestSynetMergedConvolution16b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,10 @@ namespace Test
//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);
#endif
#if 1
result = result && SynetMergedConvolution16bForwardAutoTest(eps, Param(Shp(1, 512, 8, 6), Cnv(aSw, 1, 1, 512), Cnv(aId, 3, 1), b16, f32), f1, f2);
result = result && SynetMergedConvolution16bForwardAutoTest(eps, Param(Shp(1, 512, 8, 6), Cnv(aSw, 1, 1, 512), Cnv(aSw, 3, 1), b16, f32), f1, f2);
result = result && SynetMergedConvolution16bForwardAutoTest(eps, Param(Shp(1, 512, 6, 8), Cnv(aSw, 1, 1, 512), Cnv(aSw, 3, 1), b16, f32), f1, f2);
result = result && SynetMergedConvolution16bForwardAutoTest(eps, Param(Shp(1, 512, 12, 12), Cnv(aSw, 1, 1, 512), Cnv(aSw, 3, 1), b16, b16), f1, f2);
result = result && SynetMergedConvolution16bForwardAutoTest(eps, Param(Shp(1, 128, 24, 24), Cnv(aSw, 1, 1, 128), Cnv(aSw, 3, 1), b16, b16), f1, f2);
result = result && SynetMergedConvolution16bForwardAutoTest(eps, Param(Shp(1, 64, 48, 48), Cnv(aSw, 1, 1, 64), Cnv(aSw, 3, 1), b16, b16), f1, f2);
result = result && SynetMergedConvolution16bForwardAutoTest(eps, Param(Shp(1, 512, 12, 4), Cnv(aSw, 1, 1, 512), Cnv(aSw, 3, 1), b16, f32), f1, f2);
result = result && SynetMergedConvolution16bForwardAutoTest(eps, Param(Shp(1, 512, 4, 12), Cnv(aSw, 1, 1, 512), Cnv(aSw, 3, 1), b16, b16), f1, f2);
#endif
#else
{
Expand Down

0 comments on commit f2af786

Please sign in to comment.