Adding option to disable int8 dot products

This commit is contained in:
Jean-Marc Valin 2021-06-24 17:31:05 -04:00
parent 0b9f6bab81
commit c1535c8ccf
4 changed files with 15 additions and 1 deletions

View file

@ -73,6 +73,14 @@ AS_IF([test "$enable_assertions" = "yes"], [
AC_DEFINE([OP_ENABLE_ASSERTIONS], [1], [Enable assertions in code]) AC_DEFINE([OP_ENABLE_ASSERTIONS], [1], [Enable assertions in code])
]) ])
AC_ARG_ENABLE([dot-product],
AS_HELP_STRING([--disable-dot-product], [Disable dot product implementation]),,
enable_dot_product=yes)
AS_IF([test "$enable_dot_product" = "no"], [
AC_DEFINE([DISABLE_DOT_PROD], [1], [Disable dot product instructions])
])
AS_CASE(["$ac_cv_search_lrintf"], AS_CASE(["$ac_cv_search_lrintf"],
["no"],[], ["no"],[],
["none required"],[], ["none required"],[],
@ -114,8 +122,8 @@ AC_MSG_NOTICE([
------------------------------------------------------------------------ ------------------------------------------------------------------------
$PACKAGE_NAME $PACKAGE_VERSION: Automatic configuration OK. $PACKAGE_NAME $PACKAGE_VERSION: Automatic configuration OK.
Dot product intrinsics ....... ${enable_dot_product}
Assertions ................... ${enable_assertions} Assertions ................... ${enable_assertions}
Hidden visibility ............ ${cc_cv_flag_visibility} Hidden visibility ............ ${cc_cv_flag_visibility}
API documentation ............ ${enable_doc} API documentation ............ ${enable_doc}

View file

@ -45,8 +45,10 @@
#define NO_OPTIMIZATIONS #define NO_OPTIMIZATIONS
#ifndef DISABLE_DOT_PROD
#define DOT_PROD #define DOT_PROD
//#define USE_SU_BIAS //#define USE_SU_BIAS
#endif
#ifdef DOT_PROD #ifdef DOT_PROD
typedef signed char qweight; typedef signed char qweight;

View file

@ -34,8 +34,10 @@
#include <immintrin.h> #include <immintrin.h>
#ifndef DISABLE_DOT_PROD
#define DOT_PROD #define DOT_PROD
#define USE_SU_BIAS #define USE_SU_BIAS
#endif
#ifdef __AVX2__ #ifdef __AVX2__
static inline __m256 exp8_approx(__m256 X) static inline __m256 exp8_approx(__m256 X)

View file

@ -30,7 +30,9 @@
#include <arm_neon.h> #include <arm_neon.h>
#ifndef DISABLE_DOT_PROD
#define DOT_PROD #define DOT_PROD
#endif
typedef signed char qweight; typedef signed char qweight;