Commit 8af206c6 authored by Hongzhi Wang's avatar Hongzhi Wang Committed by Hongzhi Wang

adding allocation free function for offload

parent 2423996b
...@@ -30,6 +30,7 @@ nrLDPC_dectopfunc_t top_testsuite; ...@@ -30,6 +30,7 @@ nrLDPC_dectopfunc_t top_testsuite;
/* functions to load the LDPC shared lib, implemented in openair1/PHY/CODING/nrLDPC_load.c */ /* functions to load the LDPC shared lib, implemented in openair1/PHY/CODING/nrLDPC_load.c */
extern int load_nrLDPClib(char *version) ; extern int load_nrLDPClib(char *version) ;
extern int load_nrLDPClib_offload(void) ; extern int load_nrLDPClib_offload(void) ;
extern int free_nrLDPClib_offload(void) ;
extern int load_nrLDPClib_ref(char *libversion, nrLDPC_encoderfunc_t * nrLDPC_encoder_ptr); // for ldpctest extern int load_nrLDPClib_ref(char *libversion, nrLDPC_encoderfunc_t * nrLDPC_encoder_ptr); // for ldpctest
/* ldpc coder/decoder functions, as loaded by load_nrLDPClib(). */ /* ldpc coder/decoder functions, as loaded by load_nrLDPClib(). */
extern nrLDPC_initcallfunc_t nrLDPC_initcall; extern nrLDPC_initcallfunc_t nrLDPC_initcall;
......
...@@ -101,6 +101,26 @@ int load_nrLDPClib_offload(void) { ...@@ -101,6 +101,26 @@ int load_nrLDPClib_offload(void) {
return 0; return 0;
} }
int free_nrLDPClib_offload(void) {
t_nrLDPC_dec_params decParams;
t_nrLDPC_dec_params* p_decParams = &decParams;
int8_t l[68*384];
int8_t llrProcBuf[22*384];
p_decParams->Z = 384;
p_decParams->BG = 1;
nrLDPC_decoder_offload(p_decParams,
1,
0,
0,
25344,
8,
l,
llrProcBuf, 2);
return 0;
}
int load_nrLDPClib_ref(char *libversion, nrLDPC_encoderfunc_t * nrLDPC_encoder_ptr) { int load_nrLDPClib_ref(char *libversion, nrLDPC_encoderfunc_t * nrLDPC_encoder_ptr) {
loader_shlibfunc_t shlib_encoder_fdesc; loader_shlibfunc_t shlib_encoder_fdesc;
......
...@@ -647,8 +647,6 @@ int main(int argc, char **argv) ...@@ -647,8 +647,6 @@ int main(int argc, char **argv)
get_softmodem_params()->do_ra = 0; get_softmodem_params()->do_ra = 0;
get_softmodem_params()->usim_test = 1; get_softmodem_params()->usim_test = 1;
//load_nrLDPClib_offload();
if (snr1set == 0) if (snr1set == 0)
snr1 = snr0 + 10; snr1 = snr0 + 10;
double sampling_frequency; double sampling_frequency;
...@@ -1544,6 +1542,7 @@ int main(int argc, char **argv) ...@@ -1544,6 +1542,7 @@ int main(int argc, char **argv)
LOG_MM("ulsimStats.m","EffTP",effTP,snrRun,1,7); LOG_MM("ulsimStats.m","EffTP",effTP,snrRun,1,7);
free(test_input_bit); free(test_input_bit);
free(estimated_output_bit); free(estimated_output_bit);
free_nrLDPClib_offload();
if (output_fd) if (output_fd)
fclose(output_fd); fclose(output_fd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment