diff options
author | Jean-Marc Valin <jmvalin@amazon.com> | 2023-10-21 00:08:35 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@amazon.com> | 2023-10-21 00:25:27 +0300 |
commit | 88c58cfaf37d513b6bd1660617e50e610e1ab58d (patch) | |
tree | cae67cc6e2aad7e5f5fad08a582b88bc4f906089 | |
parent | 1032e47d3f3376947280d2c7769c522b6474c6ad (diff) |
nnet.h no longer needs to #include "vec.h"
-rw-r--r-- | dnn/nnet.c | 1 | ||||
-rw-r--r-- | dnn/nnet.h | 9 | ||||
-rw-r--r-- | dnn/vec.h | 11 | ||||
-rw-r--r-- | dnn/vec_avx.h | 13 | ||||
-rw-r--r-- | dnn/vec_neon.h | 11 | ||||
-rw-r--r-- | dnn/write_lpcnet_weights.c | 1 |
6 files changed, 10 insertions, 36 deletions
@@ -40,6 +40,7 @@ #include "plc_data.h" #include "fargan.h" #include "os_support.h" +#include "vec.h" #ifdef NO_OPTIMIZATIONS #if defined(_MSC_VER) @@ -29,7 +29,14 @@ #define _NNET_H_ #include <stddef.h> -#include "vec.h" +#include "opus_types.h" + +#ifdef DISABLE_DOT_PROD +typedef float qweight; +#else +typedef signed char qweight; +#define DOT_PROD +#endif #define ACTIVATION_LINEAR 0 #define ACTIVATION_SIGMOID 1 @@ -47,17 +47,6 @@ #define NO_OPTIMIZATIONS -#ifndef DISABLE_DOT_PROD -#define DOT_PROD -/*#define USE_SU_BIAS*/ -#endif - -#ifdef DOT_PROD -typedef signed char qweight; -#else -typedef float qweight; -#endif - static inline void sgemv16x1(float *out, const float *weights, int rows, int cols, int col_stride, const float *x) { int i, j; diff --git a/dnn/vec_avx.h b/dnn/vec_avx.h index 39002b11..b41f9862 100644 --- a/dnn/vec_avx.h +++ b/dnn/vec_avx.h @@ -40,13 +40,6 @@ #define USE_SU_BIAS - -/* Use 8-bit dot products unless disabled or if stuck with SSE2. */ -#ifndef DISABLE_DOT_PROD -#define DOT_PROD -#endif - - #ifndef __SSE_4_1__ static inline __m128 mm_floor_ps(__m128 x) { __m128 half = _mm_set1_ps(0.5); @@ -882,11 +875,5 @@ static inline void cgemv8x4(float *_out, const opus_int8 *w, const float *scale, #define SCALE_1 (1.f/128.f/127.f) #define USE_SU_BIAS -#ifdef DOT_PROD -typedef signed char qweight; -#else -typedef float qweight; -#endif - #endif /*VEC_AVX_H*/ diff --git a/dnn/vec_neon.h b/dnn/vec_neon.h index db5beef4..e9959b97 100644 --- a/dnn/vec_neon.h +++ b/dnn/vec_neon.h @@ -34,17 +34,6 @@ #include <arm_neon.h> #include "os_support.h" -#ifndef DISABLE_DOT_PROD -#define DOT_PROD -#endif - -#ifdef DOT_PROD -typedef signed char qweight; -#else -typedef float qweight; -#endif - - #ifndef LPCNET_TEST static inline float32x4_t exp4_approx(float32x4_t x) { int32x4_t i; diff --git a/dnn/write_lpcnet_weights.c b/dnn/write_lpcnet_weights.c index 395b8d5d..722a373d 100644 --- a/dnn/write_lpcnet_weights.c +++ b/dnn/write_lpcnet_weights.c @@ -33,6 +33,7 @@ #include <stddef.h> #include "nnet.h" #include "os_support.h" +#include "arch.h" /* This is a bit of a hack because we need to build nnet_data.c and plc_data.c without USE_WEIGHTS_FILE, but USE_WEIGHTS_FILE is defined in config.h. */ |