From 1247a02f6d2f1aa9d871560c73b46dc1eebe781f Mon Sep 17 00:00:00 2001 From: Hongzhi Wang Date: Mon, 23 Aug 2021 11:12:38 +0200 Subject: [PATCH] Initializing the device in lib load function --- .../nrLDPC_decoder/nrLDPC_decoder_offload.c | 4 +-- openair1/PHY/CODING/nrLDPC_load.c | 30 ++++++++++++------- openair1/SIMULATION/NR_PHY/ulsim.c | 18 ----------- 3 files changed, 21 insertions(+), 31 deletions(-) diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c index 2ebb32ce99..6c22468221 100644 --- a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c +++ b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c @@ -1613,8 +1613,8 @@ int32_t nrLDPC_decod_offload(t_nrLDPC_dec_params* p_decParams, uint8_t C, uint8_ 0, ad->ops_mempool, 1, - 1, - 1); + get_num_ops(), + get_num_lcores()); if (f_ret != TEST_SUCCESS) { printf("Couldn't init test op params"); } diff --git a/openair1/PHY/CODING/nrLDPC_load.c b/openair1/PHY/CODING/nrLDPC_load.c index 44502193a9..93941c8f24 100644 --- a/openair1/PHY/CODING/nrLDPC_load.c +++ b/openair1/PHY/CODING/nrLDPC_load.c @@ -78,20 +78,28 @@ int load_nrLDPClib_offload(void) { int ret=load_module_shlib("ldpc_offload",&shlib_decoffload_fdesc,1,NULL); AssertFatal( (ret >= 0),"Error loading ldpc decoder offload"); nrLDPC_decoder_offload = (nrLDPC_decoffloadfunc_t)shlib_decoffload_fdesc.fptr; + + 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, 0); + + return 0; } -/*int load_nrLDPClib_offload(void) { - loader_shlibfunc_t shlib_decoffload_fdesc; - - shlib_decoffload_fdesc.fname = "top_testsuite"; - int ret=load_module_shlib("ldpc_offload",&shlib_decoffload_fdesc,1,NULL); - AssertFatal( (ret >= 0),"Error loading ldpc decoder offload"); - top_testsuite = (nrLDPC_dectopfunc_t)shlib_decoffload_fdesc.fptr; -return 0; -} -*/ - int load_nrLDPClib_ref(char *libversion, nrLDPC_encoderfunc_t * nrLDPC_encoder_ptr) { loader_shlibfunc_t shlib_encoder_fdesc; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index c84578e199..fcca53fcaf 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -643,24 +643,6 @@ int main(int argc, char **argv) load_nrLDPClib_offload(); - t_nrLDPC_dec_params decParams; - t_nrLDPC_dec_params* p_decParams = &decParams; - int8_t l_ol [68*384]; - __m128i *pl_ol128 = (__m128i*)&l_ol; - int8_t llrProcBuf[22*384]; - - p_decParams->Z = 384; - p_decParams->BG = 1; - - nrLDPC_decoder_offload(p_decParams, - 1, - 0, - 0, - 25344, - 8, - (int8_t*)&pl_ol128[0], - llrProcBuf, 0); - if (snr1set == 0) snr1 = snr0 + 10; double sampling_frequency;