Skip to content

Commit

Permalink
nnet.h no longer needs to #include "vec.h"
Browse files Browse the repository at this point in the history
  • Loading branch information
jmvalin committed Oct 20, 2023
1 parent 1032e47 commit 88c58cf
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 36 deletions.
1 change: 1 addition & 0 deletions dnn/nnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 8 additions & 1 deletion dnn/nnet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 0 additions & 11 deletions dnn/vec.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 0 additions & 13 deletions dnn/vec_avx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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*/
11 changes: 0 additions & 11 deletions dnn/vec_neon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions dnn/write_lpcnet_weights.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 88c58cf

Please sign in to comment.