aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2024-01-31 18:30:28 -0500
committerJean-Marc Valin <jmvalin@jmvalin.ca>2024-01-31 18:30:28 -0500
commit53c2313c5876539ae147a5135421cf10f56d6404 (patch)
tree2670662ab12b082567ad74e019374cd6c7b77704
parent6c8acc21dda42573be4812d2fe97d24adc887c74 (diff)
downloadlibopus-53c2313c5876539ae147a5135421cf10f56d6404.tar.gz
Fix lossgen shared build
-rw-r--r--dnn/lossgen.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/dnn/lossgen.c b/dnn/lossgen.c
index a0da5a4e..f38763a9 100644
--- a/dnn/lossgen.c
+++ b/dnn/lossgen.c
@@ -2,16 +2,32 @@
#include "config.h"
#endif
+#include "arch.h"
+
#include <math.h>
#include "lossgen.h"
#include "os_support.h"
#include "nnet.h"
+#include "assert.h"
/* Disable RTCD for this. */
#define RTCD_ARCH c
+/* Override assert to avoid undefined/redefined symbols. */
+#undef celt_assert
+#define celt_assert assert
+
+/* Directly include the C files we need since the symbols won't be exposed if we link in a shared object. */
+#include "parse_lpcnet_weights.c"
#include "nnet_arch.h"
+#undef compute_linear
+#undef compute_activation
+
+/* Force the C version since the SIMD versions may be hidden. */
+#define compute_linear(linear, out, in, arch) ((void)(arch),compute_linear_c(linear, out, in))
+#define compute_activation(output, input, N, activation, arch) ((void)(arch),compute_activation_c(output, input, N, activation))
+
#define MAX_RNN_NEURONS_ALL IMAX(LOSSGEN_GRU1_STATE_SIZE, LOSSGEN_GRU2_STATE_SIZE)
/* These two functions are copied from nnet.c to make sure we don't have linking issues. */