Skip to content

Commit 89c6fda

Browse files
committed
Implement intSimdMatrixAVX512VNNI (dummy)
This dummy implementation just copied the code from AVX2. Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 parent 88ef07e commit 89c6fda

File tree

5 files changed

+621
-0
lines changed

5 files changed

+621
-0
lines changed

Makefile.am

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,14 @@ libtesseract_la_LIBADD += libtesseract_avx512.la
170170
noinst_LTLIBRARIES += libtesseract_avx512.la
171171
endif
172172

173+
if HAVE_AVX512VNNI
174+
libtesseract_avx512vnni_la_CXXFLAGS = -march=icelake-client
175+
libtesseract_avx512vnni_la_CXXFLAGS += -I$(top_srcdir)/src/ccutil
176+
libtesseract_avx512vnni_la_SOURCES = src/arch/intsimdmatrixavx512vnni.cpp
177+
libtesseract_la_LIBADD += libtesseract_avx512vnni.la
178+
noinst_LTLIBRARIES += libtesseract_avx512vnni.la
179+
endif
180+
173181
if HAVE_FMA
174182
libtesseract_fma_la_CXXFLAGS = -mfma
175183
libtesseract_fma_la_CXXFLAGS += -I$(top_srcdir)/src/ccutil

configure.ac

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ AX_CHECK_COMPILE_FLAG([-Werror=unused-command-line-argument], [WERROR=-Werror=un
130130
AM_CONDITIONAL([HAVE_AVX], false)
131131
AM_CONDITIONAL([HAVE_AVX2], false)
132132
AM_CONDITIONAL([HAVE_AVX512F], false)
133+
AM_CONDITIONAL([HAVE_AVX512VNNI], false)
133134
AM_CONDITIONAL([HAVE_FMA], false)
134135
AM_CONDITIONAL([HAVE_SSE4_1], false)
135136
AM_CONDITIONAL([HAVE_NEON], false)
@@ -156,6 +157,12 @@ case "${host_cpu}" in
156157
AC_DEFINE([HAVE_AVX512F], [1], [Enable AVX512F instructions])
157158
fi
158159

160+
AX_CHECK_COMPILE_FLAG([-march=icelake-client], [avx512vnni=true], [avx512vnni=false], [$WERROR])
161+
AM_CONDITIONAL([HAVE_AVX512VNNI], $avx512vnni)
162+
if $avx512vnni; then
163+
AC_DEFINE([HAVE_AVX512VNNI], [1], [Enable AVX512VNNI instructions])
164+
fi
165+
159166
AX_CHECK_COMPILE_FLAG([-mfma], [fma=true], [fma=false], [$WERROR])
160167
AM_CONDITIONAL([HAVE_FMA], $fma)
161168
if $fma; then

src/arch/intsimdmatrix.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ struct TESS_API IntSimdMatrix {
117117
static const IntSimdMatrix intSimdMatrixNEON;
118118
// Only available with AVX2 / AVX / FMA / SSE.
119119
static const IntSimdMatrix intSimdMatrixAVX2;
120+
static const IntSimdMatrix intSimdMatrixAVX512VNNI;
120121
static const IntSimdMatrix intSimdMatrixSSE;
121122
};
122123

0 commit comments

Comments
 (0)