diff --git a/src/test_vec.c b/src/test_vec.c new file mode 100644 index 0000000..09b51e7 --- /dev/null +++ b/src/test_vec.c @@ -0,0 +1,130 @@ +#include +#include +#include "opus_types.h" +#include "arch.h" +#include "common.h" +#include "tansig_table.h" + +#define LPCNET_TEST + +// we need to call two versions of each functions that have the same +// name, so use #defines to temp rename them + +#define celt_exp2 celt_exp2_fast +#define tansig_approx tansig_approx_fast +#define sigmoid_approx sigmoid_approx_fast +#define softmax softmax_fast +#define vec_tanh vec_tanh_fast +#define vec_sigmoid vec_sigmoid_fast +#define sgemv_accum16 sgemv_accum16_fast +#define sparse_sgemv_accum16 sparse_sgemv_accum16_fast + +#ifdef __AVX__ +#include "vec_avx.h" +#ifdef __AVX2__ +const char simd[]="AVX2"; +#else +const char simd[]="AVX"; +#endif +#elif __ARM_NEON__ +#include "vec_neon.h" +const char simd[]="NEON"; +#else +const char simd[]="none"; + +#endif + +#undef celt_exp2 +#undef tansig_approx +#undef sigmoid_approx +#undef softmax +#undef vec_tanh +#undef vec_sigmoid +#undef sgemv_accum16 +#undef sparse_sgemv_accum16 +#include "vec.h" + +#define ROW_STEP 16 +#define ROWS ROW_STEP*10 +#define COLS 2 +#define ENTRIES 2 + +int test_sgemv_accum16() { + float weights[ROWS*COLS]; + float x[COLS]; + float out[ROWS], out_fast[ROWS]; + int i; + + printf("sgemv_accum16.....................: "); + for(i=0; i