Commit 7b68c486 authored by Robert Schmidt's avatar Robert Schmidt

Make LDPC generator output directory prefix configurable

parent 25004365
......@@ -5,7 +5,7 @@
#include "../../nrLDPC_types.h"
void nrLDPC_bnProcPc_BG1_generator_AVX2(int R)
void nrLDPC_bnProcPc_BG1_generator_AVX2(const char *dir, int R)
{
const char *ratestr[3]={"13","23","89"};
......@@ -15,7 +15,7 @@ void nrLDPC_bnProcPc_BG1_generator_AVX2(int R)
// system("mkdir -p ../ldpc_gen_files");
char fname[FILENAME_MAX+1];
snprintf(fname, sizeof(fname), "../ldpc_gen_files/bnProcPc/nrLDPC_bnProcPc_BG1_R%s_AVX2.h", ratestr[R]);
snprintf(fname, sizeof(fname), "%s/bnProcPc/nrLDPC_bnProcPc_BG1_R%s_AVX2.h", dir, ratestr[R]);
FILE *fd=fopen(fname,"w");
if (fd == NULL) {
printf("Cannot create file %s\n", fname);
......
......@@ -5,7 +5,7 @@
#include "../../nrLDPC_types.h"
void nrLDPC_bnProcPc_BG2_generator_AVX2(int R)
void nrLDPC_bnProcPc_BG2_generator_AVX2(const char *dir, int R)
{
const char *ratestr[3]={"15","13","23"};
......@@ -15,7 +15,7 @@ void nrLDPC_bnProcPc_BG2_generator_AVX2(int R)
// system("mkdir -p ../ldpc_gen_files");
char fname[FILENAME_MAX+1];
snprintf(fname, sizeof(fname), "../ldpc_gen_files/bnProcPc/nrLDPC_bnProcPc_BG2_R%s_AVX2.h", ratestr[R]);
snprintf(fname, sizeof(fname), "%s/bnProcPc/nrLDPC_bnProcPc_BG2_R%s_AVX2.h", dir, ratestr[R]);
FILE *fd=fopen(fname,"w");
if (fd == NULL) {
printf("Cannot create file %s\n", fname);
......
......@@ -6,7 +6,7 @@
#include "../../nrLDPC_types.h"
void nrLDPC_bnProc_BG1_generator_AVX2(int R)
void nrLDPC_bnProc_BG1_generator_AVX2(const char *dir, int R)
{
const char *ratestr[3]={"13","23","89"};
......@@ -16,7 +16,7 @@ void nrLDPC_bnProc_BG1_generator_AVX2(int R)
// system("mkdir -p ../ldpc_gen_files");
char fname[FILENAME_MAX+1];
snprintf(fname, sizeof(fname), "../ldpc_gen_files/bnProc/nrLDPC_bnProc_BG1_R%s_AVX2.h", ratestr[R]);
snprintf(fname, sizeof(fname), "%s/bnProc/nrLDPC_bnProc_BG1_R%s_AVX2.h", dir, ratestr[R]);
FILE *fd=fopen(fname,"w");
if (fd == NULL) {
printf("Cannot create file %s\n", fname);
......
......@@ -6,7 +6,7 @@
void nrLDPC_bnProc_BG2_generator_AVX2(int R)
void nrLDPC_bnProc_BG2_generator_AVX2(const char *dir, int R)
{
const char *ratestr[3]={"15","13","23"};
......@@ -16,7 +16,7 @@ void nrLDPC_bnProc_BG2_generator_AVX2(int R)
// system("mkdir -p ../ldpc_gen_files");
char fname[FILENAME_MAX+1];
snprintf(fname, sizeof(fname), "../ldpc_gen_files/bnProc/nrLDPC_bnProc_BG2_R%s_AVX2.h", ratestr[R]);
snprintf(fname, sizeof(fname), "%s/bnProc/nrLDPC_bnProc_BG2_R%s_AVX2.h", dir, ratestr[R]);
FILE *fd=fopen(fname,"w");
if (fd == NULL) {
printf("Cannot create file %s\n", fname);
......
......@@ -2,25 +2,28 @@
#include <stdio.h>
#include <stdint.h>
#define NB_R 3
void nrLDPC_bnProc_BG1_generator_AVX2(int);
void nrLDPC_bnProc_BG2_generator_AVX2(int);
void nrLDPC_bnProcPc_BG1_generator_AVX2(int);
void nrLDPC_bnProcPc_BG2_generator_AVX2(int);
void nrLDPC_bnProc_BG1_generator_AVX2(const char*, int);
void nrLDPC_bnProc_BG2_generator_AVX2(const char*, int);
void nrLDPC_bnProcPc_BG1_generator_AVX2(const char*, int);
void nrLDPC_bnProcPc_BG2_generator_AVX2(const char*, int);
int main()
int main(int argc, char *argv[])
{
if (argc != 2) {
fprintf(stderr, "usage: %s <output-dir>\n", argv[0]);
return 1;
}
const char *dir = argv[1];
int R[NB_R]={0,1,2};
for(int i=0; i<NB_R;i++){
nrLDPC_bnProc_BG1_generator_AVX2(dir, R[i]);
nrLDPC_bnProc_BG2_generator_AVX2(dir, R[i]);
nrLDPC_bnProc_BG1_generator_AVX2(R[i]);
nrLDPC_bnProc_BG2_generator_AVX2(R[i]);
nrLDPC_bnProcPc_BG1_generator_AVX2(R[i]);
nrLDPC_bnProcPc_BG2_generator_AVX2(R[i]);
nrLDPC_bnProcPc_BG1_generator_AVX2(dir, R[i]);
nrLDPC_bnProcPc_BG2_generator_AVX2(dir, R[i]);
}
return(0);
}
......@@ -6,7 +6,7 @@
#include "../../nrLDPC_types.h"
void nrLDPC_bnProcPc_BG1_generator_AVX512(int R)
void nrLDPC_bnProcPc_BG1_generator_AVX512(const char *dir, int R)
{
const char *ratestr[3]={"13","23","89"};
......@@ -16,7 +16,7 @@ void nrLDPC_bnProcPc_BG1_generator_AVX512(int R)
char fname[FILENAME_MAX+1];
snprintf(fname, sizeof(fname), "../ldpc_gen_files/bnProcPc_avx512/nrLDPC_bnProcPc_BG1_R%s_AVX512.h", ratestr[R]);
snprintf(fname, sizeof(fname), "%s/bnProcPc_avx512/nrLDPC_bnProcPc_BG1_R%s_AVX512.h", dir, ratestr[R]);
FILE *fd=fopen(fname,"w");
if (fd == NULL) {
printf("Cannot create file %s\n", fname);
......
......@@ -6,7 +6,7 @@
#include "../../nrLDPC_types.h"
void nrLDPC_bnProcPc_BG2_generator_AVX512(int R)
void nrLDPC_bnProcPc_BG2_generator_AVX512(const char *dir, int R)
{
const char *ratestr[3]={"15","13","23"};
......@@ -16,7 +16,7 @@ void nrLDPC_bnProcPc_BG2_generator_AVX512(int R)
// system("mkdir -p ../ldpc_gen_files");
char fname[FILENAME_MAX+1];
snprintf(fname, sizeof(fname), "../ldpc_gen_files/bnProcPc_avx512/nrLDPC_bnProcPc_BG2_R%s_AVX512.h", ratestr[R]);
snprintf(fname, sizeof(fname), "%s/bnProcPc_avx512/nrLDPC_bnProcPc_BG2_R%s_AVX512.h", dir, ratestr[R]);
FILE *fd=fopen(fname,"w");
if (fd == NULL) {
printf("Cannot create file %s\n", fname);
......
......@@ -6,7 +6,7 @@
#include "../../nrLDPC_types.h"
void nrLDPC_bnProc_BG1_generator_AVX512(int R)
void nrLDPC_bnProc_BG1_generator_AVX512(const char *dir, int R)
{
const char *ratestr[3]={"13","23","89"};
......@@ -16,7 +16,7 @@ void nrLDPC_bnProc_BG1_generator_AVX512(int R)
// system("mkdir -p ../ldpc_gen_files");
char fname[FILENAME_MAX+1];
snprintf(fname, sizeof(fname), "../ldpc_gen_files/bnProc_avx512/nrLDPC_bnProc_BG1_R%s_AVX512.h", ratestr[R]);
snprintf(fname, sizeof(fname), "%s/bnProc_avx512/nrLDPC_bnProc_BG1_R%s_AVX512.h", dir, ratestr[R]);
FILE *fd=fopen(fname,"w");
if (fd == NULL) {
printf("Cannot create file %s\n", fname);
......
......@@ -6,7 +6,7 @@
#include "../../nrLDPC_types.h"
void nrLDPC_bnProc_BG2_generator_AVX512(int R)
void nrLDPC_bnProc_BG2_generator_AVX512(const char *dir, int R)
{
const char *ratestr[3]={"15","13","23"};
......@@ -16,7 +16,7 @@ void nrLDPC_bnProc_BG2_generator_AVX512(int R)
// system("mkdir -p ../ldpc_gen_files");
char fname[FILENAME_MAX+1];
snprintf(fname, sizeof(fname), "../ldpc_gen_files/bnProc_avx512/nrLDPC_bnProc_BG2_R%s_AVX512.h", ratestr[R]);
snprintf(fname, sizeof(fname), "%s/bnProc_avx512/nrLDPC_bnProc_BG2_R%s_AVX512.h", dir, ratestr[R]);
FILE *fd=fopen(fname,"w");
if (fd == NULL) {
printf("Cannot create file %s\n", fname);
......
......@@ -3,25 +3,28 @@
#include <stdint.h>
#include <stdlib.h>
#define NB_R 3
void nrLDPC_bnProc_BG1_generator_AVX512(int);
void nrLDPC_bnProc_BG2_generator_AVX512(int);
void nrLDPC_bnProcPc_BG1_generator_AVX512(int);
void nrLDPC_bnProcPc_BG2_generator_AVX512(int);
void nrLDPC_bnProc_BG1_generator_AVX512(const char *, int);
void nrLDPC_bnProc_BG2_generator_AVX512(const char *, int);
void nrLDPC_bnProcPc_BG1_generator_AVX512(const char *, int);
void nrLDPC_bnProcPc_BG2_generator_AVX512(const char *, int);
int main()
int main(int argc, char *argv[])
{
if (argc != 2) {
fprintf(stderr, "usage: %s <output-dir>\n", argv[0]);
return 1;
}
const char *dir = argv[1];
int R[NB_R]={0,1,2};
for(int i=0; i<NB_R;i++){
nrLDPC_bnProc_BG1_generator_AVX512(dir, R[i]);
nrLDPC_bnProc_BG2_generator_AVX512(dir, R[i]);
nrLDPC_bnProc_BG1_generator_AVX512(R[i]);
nrLDPC_bnProc_BG2_generator_AVX512(R[i]);
nrLDPC_bnProcPc_BG1_generator_AVX512(R[i]);
nrLDPC_bnProcPc_BG2_generator_AVX512(R[i]);
nrLDPC_bnProcPc_BG1_generator_AVX512(dir, R[i]);
nrLDPC_bnProcPc_BG2_generator_AVX512(dir, R[i]);
}
return(0);
}
......@@ -3,7 +3,7 @@
#include <stdint.h>
#include "../../nrLDPCdecoder_defs.h"
void nrLDPC_cnProc_BG1_generator_AVX2(int R)
void nrLDPC_cnProc_BG1_generator_AVX2(const char* dir, int R)
{
const char *ratestr[3]={"13","23","89"};
......@@ -13,7 +13,7 @@ void nrLDPC_cnProc_BG1_generator_AVX2(int R)
// system("mkdir -p ../ldpc_gen_files");
char fname[FILENAME_MAX+1];
snprintf(fname, sizeof(fname), "../ldpc_gen_files/cnProc/nrLDPC_cnProc_BG1_R%s_AVX2.h", ratestr[R]);
snprintf(fname, sizeof(fname), "%s/cnProc/nrLDPC_cnProc_BG1_R%s_AVX2.h", dir, ratestr[R]);
FILE *fd=fopen(fname,"w");
if (fd == NULL) {
printf("Cannot create file %s\n", fname);
......
......@@ -6,7 +6,7 @@
#include "../../nrLDPC_bnProc.h"
void nrLDPC_cnProc_BG2_generator_AVX2(int R)
void nrLDPC_cnProc_BG2_generator_AVX2(const char* dir, int R)
{
const char *ratestr[3]={"15","13","23"};
......@@ -16,7 +16,7 @@ void nrLDPC_cnProc_BG2_generator_AVX2(int R)
// system("mkdir -p ldpc_gen_files/avx2");
char fname[FILENAME_MAX+1];
snprintf(fname, sizeof(fname), "../ldpc_gen_files/cnProc/nrLDPC_cnProc_BG2_R%s_AVX2.h", ratestr[R]);
snprintf(fname, sizeof(fname), "%s/cnProc/nrLDPC_cnProc_BG2_R%s_AVX2.h", dir, ratestr[R]);
FILE *fd=fopen(fname,"w");
if (fd == NULL) {
printf("Cannot create file %s\n", fname);
......
......@@ -2,18 +2,21 @@
#include <stdio.h>
#include <stdint.h>
#define NB_R 3
void nrLDPC_cnProc_BG1_generator_AVX2(int);
void nrLDPC_cnProc_BG2_generator_AVX2(int);
int main()
void nrLDPC_cnProc_BG1_generator_AVX2(const char*, int);
void nrLDPC_cnProc_BG2_generator_AVX2(const char*, int);
int main(int argc, char *argv[])
{
int R[NB_R]={0,1,2};
for(int i=0; i<NB_R;i++){
nrLDPC_cnProc_BG1_generator_AVX2(R[i]);
nrLDPC_cnProc_BG2_generator_AVX2(R[i]);
if (argc != 2) {
fprintf(stderr, "usage: %s <output-dir>\n", argv[0]);
return 1;
}
const char *dir = argv[1];
int R[NB_R]={0,1,2};
for(int i=0; i<NB_R;i++) {
nrLDPC_cnProc_BG1_generator_AVX2(dir, R[i]);
nrLDPC_cnProc_BG2_generator_AVX2(dir, R[i]);
}
return(0);
}
......
......@@ -3,7 +3,7 @@
#include <stdlib.h>
#include "../../nrLDPCdecoder_defs.h"
void nrLDPC_cnProc_BG1_generator_AVX512(int R)
void nrLDPC_cnProc_BG1_generator_AVX512(const char *dir, int R)
{
const char *ratestr[3]={"13","23","89"};
......@@ -13,7 +13,7 @@ void nrLDPC_cnProc_BG1_generator_AVX512(int R)
// system("mkdir -p ../ldpc_gen_files");
char fname[FILENAME_MAX+1];
snprintf(fname, sizeof(fname), "../ldpc_gen_files/cnProc_avx512/nrLDPC_cnProc_BG1_R%s_AVX512.h", ratestr[R]);
snprintf(fname, sizeof(fname), "%s/cnProc_avx512/nrLDPC_cnProc_BG1_R%s_AVX512.h", dir, ratestr[R]);
FILE *fd=fopen(fname,"w");
if (fd == NULL) {
printf("Cannot create file %s\n", fname);
......
......@@ -3,7 +3,7 @@
#include <stdint.h>
#include "../../nrLDPCdecoder_defs.h"
void nrLDPC_cnProc_BG2_generator_AVX512(int R)
void nrLDPC_cnProc_BG2_generator_AVX512(const char *dir, int R)
{
const char *ratestr[3]={"15","13","23"};
......@@ -13,7 +13,7 @@ void nrLDPC_cnProc_BG2_generator_AVX512(int R)
// system("mkdir -p ../ldpc_gen_files");
char fname[FILENAME_MAX+1];
snprintf(fname, sizeof(fname), "../ldpc_gen_files/cnProc_avx512/nrLDPC_cnProc_BG2_R%s_AVX512.h", ratestr[R]);
snprintf(fname, sizeof(fname), "%s/cnProc_avx512/nrLDPC_cnProc_BG2_R%s_AVX512.h", dir, ratestr[R]);
FILE *fd=fopen(fname,"w");
if (fd == NULL) {
printf("Cannot create file %s\n", fname);
......
......@@ -2,19 +2,22 @@
#include <stdio.h>
#include <stdint.h>
#define NB_R 3
void nrLDPC_cnProc_BG1_generator_AVX512(int);
void nrLDPC_cnProc_BG2_generator_AVX512(int);
int main()
void nrLDPC_cnProc_BG1_generator_AVX512(const char *, int);
void nrLDPC_cnProc_BG2_generator_AVX512(const char *, int);
int main(int argc, char *argv[])
{
if (argc != 2) {
fprintf(stderr, "usage: %s <output-dir>\n", argv[0]);
return 1;
}
const char *dir = argv[1];
int R[NB_R]={0,1,2};
for(int i=0; i<NB_R;i++){
nrLDPC_cnProc_BG1_generator_AVX512(R[i]);
nrLDPC_cnProc_BG2_generator_AVX512(R[i]);
nrLDPC_cnProc_BG1_generator_AVX512(dir, R[i]);
nrLDPC_cnProc_BG2_generator_AVX512(dir, R[i]);
}
return(0);
}
......@@ -10,8 +10,8 @@ mkdir bnProc
mkdir bnProc_avx512
mkdir bnProcPc
mkdir bnProcPc_avx512
cd ../generator_bnProc; make; make clean; ./bnProc_gen_avx2
cd ../generator_cnProc; make; make clean; ./cnProc_gen_avx2
cd ../generator_bnProc_avx512; make; make clean; ./bnProc_gen_avx512
cd ../generator_cnProc_avx512; make; make clean; ./cnProc_gen_avx512
cd ../generator_bnProc; make; make clean; ./bnProc_gen_avx2 ../ldpc_gen_files
cd ../generator_cnProc; make; make clean; ./cnProc_gen_avx2 ../ldpc_gen_files
cd ../generator_bnProc_avx512; make; make clean; ./bnProc_gen_avx512 ../ldpc_gen_files
cd ../generator_cnProc_avx512; make; make clean; ./cnProc_gen_avx512 ../ldpc_gen_files
)
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