Commit 5fcaf29f authored by mir's avatar mir

TASK_MANAGER_CODING flag removed

parent 75c652d4
...@@ -595,7 +595,7 @@ void completed_task_ans(task_ans_t* task) ...@@ -595,7 +595,7 @@ void completed_task_ans(task_ans_t* task)
// //
void join_task_ans(task_ans_t* arr, size_t len) void join_task_ans(task_ans_t* arr, size_t len)
{ {
//assert(len > 0); assert(len < INT_MAX);
assert(arr != NULL); assert(arr != NULL);
// We are believing Fedor // We are believing Fedor
......
#ifndef TASK_MANAGER_WORKING_STEALING_H #ifndef TASK_MANAGER_WORKING_STEALING_H
#define TASK_MANAGER_WORKING_STEALING_H #define TASK_MANAGER_WORKING_STEALING_H
#define TASK_MANAGER_CODING
#define TASK_MANAGER_RU #define TASK_MANAGER_RU
#define TASK_MANAGER_UE_DECODING #define TASK_MANAGER_UE_DECODING
......
...@@ -64,9 +64,7 @@ typedef struct { ...@@ -64,9 +64,7 @@ typedef struct {
unsigned int G; unsigned int G;
// Redundancy version index // Redundancy version index
uint8_t rv; uint8_t rv;
#ifdef TASK_MANAGER_CODING
task_ans_t* ans; task_ans_t* ans;
#endif
} encoder_implemparams_t; } encoder_implemparams_t;
typedef int32_t(LDPC_initfunc_t)(void); typedef int32_t(LDPC_initfunc_t)(void);
......
...@@ -259,9 +259,8 @@ static void ldpc8blocks(void *p) ...@@ -259,9 +259,8 @@ static void ldpc8blocks(void *p)
r_offset += E; r_offset += E;
} }
#ifdef TASK_MANAGER_CODING // Task running in // completed
completed_task_ans(impp->ans); completed_task_ans(impp->ans);
#endif
} }
int nr_dlsch_encoding(PHY_VARS_gNB *gNB, int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
...@@ -388,50 +387,23 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, ...@@ -388,50 +387,23 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
r_offset += impp.E; r_offset += impp.E;
} }
} else { } else {
notifiedFIFO_t nf = {0}; size_t const n_seg = (impp.n_segments/8+((impp.n_segments&7)==0 ? 0 : 1));
initNotifiedFIFO(&nf);
int nbJobs = 0; encoder_implemparams_t arr[n_seg];
#ifdef TASK_MANAGER_CODING task_ans_t ans[n_seg];
size_t const sz = (impp.n_segments/8+((impp.n_segments&7)==0 ? 0 : 1)); memset(ans, 0, n_seg * sizeof(task_ans_t));
encoder_implemparams_t arr[sz];
task_ans_t ans[sz]; for (int j = 0; j < n_seg; j++) {
memset(ans, 0, sz * sizeof(task_ans_t)); encoder_implemparams_t* perJobImpp = &arr[j];
#endif
for (int j = 0; j < (impp.n_segments / 8 + ((impp.n_segments & 7) == 0 ? 0 : 1)); j++) {
#ifdef TASK_MANAGER_CODING
assert(nbJobs < sz);
encoder_implemparams_t* perJobImpp = &arr[nbJobs];
#else
notifiedFIFO_elt_t *req = newNotifiedFIFO_elt(sizeof(impp), j, &nf, ldpc8blocks);
encoder_implemparams_t *perJobImpp = (encoder_implemparams_t *)NotifiedFifoData(req);
#endif
*perJobImpp = impp; *perJobImpp = impp;
perJobImpp->macro_num = j; perJobImpp->macro_num = j;
perJobImpp->ans = &ans[j];
#ifdef TASK_MANAGER_CODING task_t t = {.func = ldpc8blocks, .args = perJobImpp};
perJobImpp->ans = &ans[nbJobs];
task_t t = {.args = perJobImpp, .func = ldpc8blocks};
async_task_manager(&gNB->man, t); async_task_manager(&gNB->man, t);
#else
pushTpool(&gNB->threadPool, req);
#endif
nbJobs++;
}
#ifdef TASK_MANAGER_CODING
if(nbJobs > 0) {
join_task_ans(ans, nbJobs);
}
#else
while (nbJobs) {
notifiedFIFO_elt_t *req = pullNotifiedFIFO(&nf);
if (req == NULL)
break; // Tpool has been stopped
delNotifiedFIFO_elt(req);
nbJobs--;
} }
#endif
join_task_ans(ans, n_seg);
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_OUT);
return 0; return 0;
......
...@@ -729,7 +729,7 @@ typedef struct PHY_VARS_gNB_s { ...@@ -729,7 +729,7 @@ typedef struct PHY_VARS_gNB_s {
void *scopeData; void *scopeData;
/// structure for analyzing high-level RT measurements /// structure for analyzing high-level RT measurements
rt_L1_profiling_t rt_L1_profiling; rt_L1_profiling_t rt_L1_profiling;
#if defined(TASK_MANAGER_CODING) || defined(TASK_MANAGER_RU) || defined(TASK_MANAGER_SIM) #if defined(TASK_MANAGER_RU) || defined(TASK_MANAGER_SIM)
task_manager_t man; task_manager_t man;
task_manager_t man_rx_tx_ru; task_manager_t man_rx_tx_ru;
#endif #endif
......
...@@ -856,7 +856,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) ...@@ -856,7 +856,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
task_ans_t ans[16] = {0}; task_ans_t ans[16] = {0};
thread_info_tm_t t_info = {.buf = (uint8_t*)arr, .len = 0, .ans = ans}; thread_info_tm_t t_info = {.buf = (uint8_t*)arr, .len = 0, .ans = ans};
int64_t const t0 = time_now_ns(); //int64_t const t0 = time_now_ns();
int totalDecode = 0; int totalDecode = 0;
for (int ULSCH_id = 0; ULSCH_id < gNB->max_nb_pusch; ULSCH_id++) { for (int ULSCH_id = 0; ULSCH_id < gNB->max_nb_pusch; ULSCH_id++) {
NR_gNB_ULSCH_t *ulsch = &gNB->ulsch[ULSCH_id]; NR_gNB_ULSCH_t *ulsch = &gNB->ulsch[ULSCH_id];
......
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