Skip to content

Commit 7ec7072

Browse files
committed
Add OpenMP usage
1 parent b85dda6 commit 7ec7072

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/compile.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22

33
gcc -DTRAINING=1 -Wall -W -O3 -g -I../include denoise.c kiss_fft.c pitch.c celt_lpc.c -o dump_data -lm
4-
gcc -o test_lpcnet -mavx2 -mfma -g -O3 -Wall -W -Wextra lpcnet.c nnet.c nnet_data.c -lm
4+
gcc -fopenmp -o test_lpcnet -mavx2 -mfma -g -O3 -Wall -W -Wextra lpcnet.c nnet.c nnet_data.c -lm

src/lpcnet.c

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "common.h"
3232
#include "arch.h"
3333
#include "lpcnet.h"
34+
#include "omp.h"
3435

3536
#define NB_FEATURES 38
3637
#define NB_TOTAL_FEATURES 55
@@ -166,6 +167,7 @@ void lpcnet_synthesize(LPCNetState *lpcnet, short *output, const float *features
166167
RNN_CLEAR(output, N);
167168
return;
168169
}
170+
#pragma omp parallel for
169171
for (i=start;i<N;i++)
170172
{
171173
int j;
@@ -195,6 +197,7 @@ void lpcnet_synthesize(LPCNetState *lpcnet, short *output, const float *features
195197
int main(int argc, char **argv) {
196198
FILE *fin, *fout;
197199
LPCNetState *net;
200+
198201
net = lpcnet_create();
199202
if (argc != 3)
200203
{

0 commit comments

Comments
 (0)