Commit 05190ad8 authored by Raymond Knopp's avatar Raymond Knopp Committed by Robert Schmidt

perf: add TWOPASS_CN_PROC dispatch in nrLDPC_decoder

Add //#define TWOPASS_CN_PROC alongside UNROLL_CN_PROC=1.
When UNROLL_CN_PROC is commented out and TWOPASS_CN_PROC is
defined, all four cnProc call sites (first-iter BG1/BG2,
loop BG1/BG2) dispatch to nrLDPC_cnProc_BG1_2pass /
nrLDPC_cnProc_BG2_2pass instead of the LUT-based variants.

To benchmark: comment UNROLL_CN_PROC and uncomment TWOPASS_CN_PROC.
To revert to LUT generic: comment both.

Assisted-by: Claude:claude-sonnet-4.6
Signed-off-by: default avatarRaymond Knopp <raymond.knopp@eurecom.fr>
parent 4b58b31b
......@@ -19,6 +19,7 @@
#include "openair1/PHY/CODING/coding_defs.h"
#include "log.h"
#define UNROLL_CN_PROC 1
//#define TWOPASS_CN_PROC // comment UNROLL_CN_PROC and uncomment to use two-pass min-sum cnProc
#define UNROLL_BN_PROC 1
#define UNROLL_BN_PROC_PC 1
#define UNROLL_BN2CN_PROC 1
......@@ -237,8 +238,12 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr,
NR_LDPC_PROFILER_DETAIL(start_meas(&p_profiler->cnProc));
if (BG==1) {
#ifndef UNROLL_CN_PROC
#ifdef TWOPASS_CN_PROC
nrLDPC_cnProc_BG1_2pass(p_lut, cnProcBuf, cnProcBufRes, Z);
#else
nrLDPC_cnProc_BG1(p_lut, cnProcBuf, cnProcBufRes, Z);
#else
#endif
#else
switch (R)
{
case 13:
......@@ -281,7 +286,11 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr,
#endif
} else {
#ifndef UNROLL_CN_PROC
#ifdef TWOPASS_CN_PROC
nrLDPC_cnProc_BG2_2pass(p_lut, cnProcBuf, cnProcBufRes, Z);
#else
nrLDPC_cnProc_BG2(p_lut, cnProcBuf, cnProcBufRes, Z);
#endif
#else
switch (R) {
case 15:
......@@ -543,8 +552,12 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr,
#endif
if (BG==1) {
#ifndef UNROLL_CN_PROC
#ifdef TWOPASS_CN_PROC
nrLDPC_cnProc_BG1_2pass(p_lut, cnProcBuf, cnProcBufRes, Z);
#else
nrLDPC_cnProc_BG1(p_lut, cnProcBuf, cnProcBufRes, Z);
#else
#endif
#else
switch (R) {
case 13:
{
......@@ -583,7 +596,11 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr,
#endif
} else {
#ifndef UNROLL_CN_PROC
#ifdef TWOPASS_CN_PROC
nrLDPC_cnProc_BG2_2pass(p_lut, cnProcBuf, cnProcBufRes, Z);
#else
nrLDPC_cnProc_BG2(p_lut, cnProcBuf, cnProcBufRes, Z);
#endif
#else
switch (R) {
case 15:
......
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