Commit 71a8d19b authored by Sy's avatar Sy

use of avx2 & avx512 at CN Processing level

parent 3ed622af
......@@ -1305,26 +1305,30 @@ set(PHY_TURBOIF
set(PHY_LDPC_ORIG_SRC
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/ldpc_gen_files/nrLDPC_cnProc_BG1_Z384_13.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/ldpc_gen_files/nrLDPC_cnProc_BG1_Z384_13_AVX2.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/ldpc_gen_files/nrLDPC_cnProc_BG1_Z384_13_AVX512.c
)
set(PHY_LDPC_OPTIM_SRC
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/ldpc_gen_files/nrLDPC_cnProc_BG1_Z384_13.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/ldpc_gen_files/nrLDPC_cnProc_BG1_Z384_13_AVX2.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/ldpc_gen_files/nrLDPC_cnProc_BG1_Z384_13_AVX512.c
)
set(PHY_LDPC_OPTIM8SEG_SRC
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/ldpc_gen_files/nrLDPC_cnProc_BG1_Z384_13.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/ldpc_gen_files/nrLDPC_cnProc_BG1_Z384_13_AVX2.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/ldpc_gen_files/nrLDPC_cnProc_BG1_Z384_13_AVX2.c
)
set(PHY_LDPC_OPTIM8SEGMULTI_SRC
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/ldpc_gen_files/nrLDPC_cnProc_BG1_Z384_13.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/ldpc_gen_files/nrLDPC_cnProc_BG1_Z384_13_AVX2.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/ldpc_gen_files/nrLDPC_cnProc_BG1_Z384_13_AVX512.c
)
set(PHY_NR_CODINGIF
......
......@@ -147,7 +147,8 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP
#endif
if (BG == 1)
{ if(Z==384){
nrLDPC_cnProc_BG1_Z384_13(p_procBuf->cnProcBuf,p_procBuf->cnProcBufRes);
nrLDPC_cnProc_BG1_Z384_13_AVX512(p_procBuf->cnProcBuf,p_procBuf->cnProcBufRes);
//nrLDPC_cnProc_BG1_Z384_13_AVX2(p_procBuf->cnProcBuf,p_procBuf->cnProcBufRes);
}else{
nrLDPC_cnProc_BG1(p_lut, p_procBuf, Z);
}
......@@ -250,7 +251,8 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP
if (BG == 1)
{
if(Z==384){
nrLDPC_cnProc_BG1_Z384_13(p_procBuf->cnProcBuf, p_procBuf->cnProcBufRes);
nrLDPC_cnProc_BG1_Z384_13_AVX512(p_procBuf->cnProcBuf,p_procBuf->cnProcBufRes);
//nrLDPC_cnProc_BG1_Z384_13_AVX2(p_procBuf->cnProcBuf,p_procBuf->cnProcBufRes);
}else{
nrLDPC_cnProc_BG1(p_lut, p_procBuf, Z);
}
......@@ -363,7 +365,8 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP
#endif
if (BG == 1)
{ if(Z==384){
nrLDPC_cnProc_BG1_Z384_13(p_procBuf->cnProcBuf,p_procBuf->cnProcBufRes);
nrLDPC_cnProc_BG1_Z384_13_AVX512(p_procBuf->cnProcBuf,p_procBuf->cnProcBufRes);
//nrLDPC_cnProc_BG1_Z384_13_AVX2(p_procBuf->cnProcBuf,p_procBuf->cnProcBufRes);
}else{
nrLDPC_cnProc_BG1(p_lut, p_procBuf, Z);
}
......
C=gcc
CFLAGS=-W -Wall -mavx2
CFLAGS=-W -Wall -mavx2
LDFLAGS=
EXEC=cnProc_gen
EXEC=cnProc_gen_avx2
SRC= $(wildcard *.c)
OBJ= $(SRC:.c=.o)
all: $(EXEC)
cnProc_gen: $(OBJ)
cnProc_gen_avx2: $(OBJ)
$(CC) -o $@ $^ $(LDFLAGS) -O2 -pg
main.o: cnProc_gen.h
main.o: cnProc_gen_avx2.h
%.o: %.c
$(CC) -o $@ -c $< $(CFLAGS) -I ${OPENAIR_HOME}/openair1 -g -pg
......@@ -24,4 +24,4 @@ mrproper: clean
rm -rf $(EXEC)
zip:
tar -zcvf sauvegarde.tar.gz main.c cnProc_gen.c cnProc_geno.h Makefile
tar -zcvf sauvegarde.tar.gz main.c cnProc_gen_avx2.c cnProc_gen_avx2.h Makefile
#ifndef NRLDPC_CN_GEN
#define NRLDPC_CN_GEN
void nrLDPC_cnProc_BG1_generator(uint16_t Z,int R);
void nrLDPC_cnProc_BG1_generator_AVX2(uint16_t Z,int R);
#endif
#include <stdio.h>
#include <immintrin.h>
#include "../../nrLDPC_types.h"
#include "../../nrLDPC_init.h"
#include "../../nrLDPC_bnProc.h"
#include "cnProc_gen_avx2.h"
int main(int argc, char *argv [])
{
// Z=384, R=1/3
nrLDPC_cnProc_BG1_generator_AVX2(384,0);
return(0);
}
C=gcc
CFLAGS=-W -Wall
LDFLAGS=
EXEC=cnProc_gen_avx512
SRC= $(wildcard *.c)
OBJ= $(SRC:.c=.o)
all: $(EXEC)
cnProc_gen_avx512: $(OBJ)
$(CC) -o $@ $^ $(LDFLAGS) -O2 -pg
main.o: cnProc_gen_avx512.h
%.o: %.c
$(CC) -o $@ -c $< $(CFLAGS) -I ${OPENAIR_HOME}/openair1 -g -pg
.PHONY: clean mrproper
clean:
rm -rf *.o
mrproper: clean
rm -rf $(EXEC)
zip:
tar -zcvf sauvegarde.tar.gz main.c cnProc_gen_avx512.c cnProc_gen_avx512.h Makefile
#ifndef NRLDPC_CN_GEN
#define NRLDPC_CN_GEN
void nrLDPC_cnProc_BG1_generator_AVX512(uint16_t Z,int R);
#endif
#include <stdio.h>
#include <immintrin.h>
//#include "../nrLDPCdecoder_defs.h"
#include "../../nrLDPC_types.h"
#include "../../nrLDPC_init.h"
#include "../../nrLDPC_bnProc.h"
#include "cnProc_gen_avx512.h"
int main(int argc, char *argv [])
{
// Z=384, R=1/3
nrLDPC_cnProc_BG1_generator_AVX512(384,0);
return(0);
}
#ifndef NR_CN_PROC_BG1_OPTIM
#define NR_CN_PROC_BG1_OPTIM
void nrLDPC_cnProc_BG1_Z384_13(int8_t* cnProcBuf,int8_t* cnProcBufRes);
void nrLDPC_cnProc_BG1_Z384_13_AVX512(int8_t* cnProcBuf,int8_t* cnProcBufRes);
void nrLDPC_cnProc_BG1_Z384_13_AVX2(int8_t* cnProcBuf,int8_t* cnProcBufRes);
#endif
#include <stdio.h>
#include <immintrin.h>
//#include "../nrLDPCdecoder_defs.h"
#include "../nrLDPC_types.h"
#include "../nrLDPC_init.h"
//#include "../nrLDPC_mPass.h"
//#include "../nrLDPC_cnProc.h"
#include "../nrLDPC_bnProc.h"
#include "cnProc_gen.h"
int main(int argc, char *argv [])
{
//short lift_size[51]= {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384};
// unsigned int errors, errors_bit, crc_misses;
// double errors_bit_uncoded;
//short block_length=8448; // decoder supports length: 1201 -> 1280, 2401 -> 2560
// short No_iteration=5;
//int n_segments=1;
//double rate=0.333;
//int nom_rate=1;
//int denom_rate=3;
//double SNR0=-2.0,SNR,SNR_lin;
//unsigned char qbits=8;
// unsigned int decoded_errors[10000]; // initiate the size of matrix equivalent to size of SNR
//int c,i=0, i1 = 0;
// int n_trials = 1;
// double SNR_step = 0.1;
// randominit(0);
//int test_uncoded= 0;
//short BG=1,Zc,Kb;
// cpu_freq_GHz = get_cpu_freq_GHz();
//printf("the decoder supports BG2, Kb=10, Z=128 & 256\n");
//printf(" range of blocklength: 1201 -> 1280, 2401 -> 2560\n");
// printf("block length %d: \n", block_length);
//printf("n_trials %d: \n", n_trials);
// printf("SNR0 %f: \n", SNR0);
//find minimum value in all sets of lifting size
/* Zc=0;
for (i1=0; i1 < 51; i1++)
{
if (lift_size[i1] >= (double) block_length/Kb)
{
Zc = lift_size[i1];
//printf("%d\n",Zc);
break;
}
}*/
// Allocate LDPC decoder buffers
// p_nrLDPC_procBuf = nrLDPC_init_mem();
// load_nrLDPClib();
// load_nrLDPClib_ref("_orig", &encoder_orig);
// Z=384, R=1/3
nrLDPC_cnProc_BG1_generator(384,0);
//nrLDPC_cnProc_BG1(&lut_numCnInCnGroups, &cnProcBuf, 380);
//for (block_length=8;block_length<=MAX_BLOCK_LENGTH;block_length+=8)
//determine number of bits in codeword
/*
char fname[200];
sprintf(fname,"cnProc_BG1_Zc_%d.c",384);
FILE *fd=fopen(fname,"w");
// AssertFatal(fd!=NULL,"cannot open %s\n",fname);
*/
//fclose(fd);
return(0);
}
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