Skip to content

Commit 48e679b

Browse files
committed
+add AVX2 optimizations of function SynetSoftmax16b (part 1).
1 parent 200c642 commit 48e679b

9 files changed

Lines changed: 388 additions & 20 deletions

File tree

docs/2026.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ <h5>New features</h5>
4747
<li>Parameter 'params' to function SimdSynetInnerProduct16bSetParams.</li>
4848
<li>Base implementation of class SynetGatherElements.</li>
4949
<li>Base implementation, SSE4.1, AVX2, AVX-512BW optimizations of function SynetNormalizeLayerForward16bV2.</li>
50-
<li>Base implementation, SSE4.1 optimizations of function SynetSoftmax16b.</li>
50+
<li>Base implementation, SSE4.1, AVX2 optimizations of function SynetSoftmax16b.</li>
5151
</ul>
5252
<h5>Improving</h5>
5353
<ul>

prj/vs2022/Avx2.vcxproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@
152152
<ClCompile Include="..\..\src\Simd\SimdAvx2SynetQuantizeLinear.cpp" />
153153
<ClCompile Include="..\..\src\Simd\SimdAvx2SynetScale.cpp" />
154154
<ClCompile Include="..\..\src\Simd\SimdAvx2SynetScale16b.cpp" />
155-
<ClCompile Include="..\..\src\Simd\SimdAvx2SynetSoftmax.cpp" />
155+
<ClCompile Include="..\..\src\Simd\SimdAvx2SynetSoftmax16b.cpp" />
156+
<ClCompile Include="..\..\src\Simd\SimdAvx2SynetSoftmax32f.cpp" />
156157
<ClCompile Include="..\..\src\Simd\SimdAvx2SynetUnaryOperation.cpp" />
157158
<ClCompile Include="..\..\src\Simd\SimdAvx2Texture.cpp" />
158159
<ClCompile Include="..\..\src\Simd\SimdAvx2Transform.cpp" />

prj/vs2022/Avx2.vcxproj.filters

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,6 @@
406406
<ClCompile Include="..\..\src\Simd\SimdAvx2SynetScale16b.cpp">
407407
<Filter>Avx2\Synet\Other</Filter>
408408
</ClCompile>
409-
<ClCompile Include="..\..\src\Simd\SimdAvx2SynetSoftmax.cpp">
410-
<Filter>Avx2\Synet\Other</Filter>
411-
</ClCompile>
412409
<ClCompile Include="..\..\src\Simd\SimdAvx2SynetUnaryOperation.cpp">
413410
<Filter>Avx2\Synet\Other</Filter>
414411
</ClCompile>
@@ -472,6 +469,12 @@
472469
<ClCompile Include="..\..\src\Simd\SimdAvx2SynetNormalize32f.cpp">
473470
<Filter>Avx2\Synet\Normalize</Filter>
474471
</ClCompile>
472+
<ClCompile Include="..\..\src\Simd\SimdAvx2SynetSoftmax16b.cpp">
473+
<Filter>Avx2\Synet\Softmax</Filter>
474+
</ClCompile>
475+
<ClCompile Include="..\..\src\Simd\SimdAvx2SynetSoftmax32f.cpp">
476+
<Filter>Avx2\Synet\Softmax</Filter>
477+
</ClCompile>
475478
</ItemGroup>
476479
<ItemGroup>
477480
<Filter Include="Avx2">
@@ -537,6 +540,9 @@
537540
<Filter Include="Avx2\Synet\Normalize">
538541
<UniqueIdentifier>{73ef30bd-9802-44ff-a136-fe77b4e92c11}</UniqueIdentifier>
539542
</Filter>
543+
<Filter Include="Avx2\Synet\Softmax">
544+
<UniqueIdentifier>{86bdc095-1674-4e46-b8a5-8da827051b9a}</UniqueIdentifier>
545+
</Filter>
540546
</ItemGroup>
541547
<ItemGroup>
542548
<ClInclude Include="..\..\src\Simd\SimdAvx2.h">

src/Simd/SimdAvx2.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,8 @@ namespace Simd
569569

570570
void SynetSoftmax32f(const float * src, size_t outer, size_t size, size_t inner, float * dst);
571571

572+
void SynetSoftmax16b(const uint16_t* src, size_t outer, size_t count, size_t inner, uint16_t* dst);
573+
572574
void SynetSoftplus32f(const float* src, size_t size, const float* beta, const float* threshold, float* dst);
573575

574576
void SynetShuffleLayerForward(const float* src0, const float* src1, size_t channels0, size_t channels1, size_t spatial, float* dst0, float* dst1, SimdTensorFormatType format, int type);

0 commit comments

Comments
 (0)