Skip to content

Commit

Permalink
[software] Fix includes in applications
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelRiedel committed Feb 23, 2024
1 parent 69a59a4 commit 7c41569
Show file tree
Hide file tree
Showing 29 changed files with 45 additions and 43 deletions.
2 changes: 1 addition & 1 deletion software/apps/axpy_i32/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <string.h>

#include "encoding.h"
#include "kernel/axpy.h"
#include "mempool_axpy_i32p.h"
#include "printf.h"
#include "runtime.h"
#include "synchronization.h"
Expand Down
8 changes: 4 additions & 4 deletions software/apps/cfft_radix2_q16/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
#include <string.h>

/* Mempool runtime libraries */
#include "builtins_v2.h"
#include "dma.h"
#include "encoding.h"
#include "printf.h"
#include "runtime.h"
#include "synchronization.h"
#include "xpulp/builtins_v2.h"

/* CFFT mempool libraries */
#include "data/data_cfft_radix2_q16.h"
#include "kernel/mempool_radix2_cfft_q16p.h"
#include "kernel/mempool_radix2_cfft_q16s.h"
#include "data_cfft_radix2_q16.h"
#include "mempool_radix2_cfft_q16p.h"
#include "mempool_radix2_cfft_q16s.h"

#define PARALLEL
#define SINGLE
Expand Down
12 changes: 6 additions & 6 deletions software/apps/cfft_radix4_q16/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
#include <string.h>

/* Mempool runtime libraries */
#include "builtins_v2.h"
#include "dma.h"
#include "encoding.h"
#include "printf.h"
#include "runtime.h"
#include "synchronization.h"
#include "xpulp/builtins_v2.h"

/* CFFT data libraries */
#include "data/data_cfft_radix4_q16.h"
#include "data_cfft_radix4_q16.h"

/*
CHOOSE ONE
Expand Down Expand Up @@ -46,10 +46,10 @@
#endif

#define ABS(x) (((x) < 0) ? (-x) : (x))
#include "kernel/mempool_radix4_cfft_butterfly_q16.h"
#include "kernel/mempool_radix4_cfft_q16_bitreversal.h"
#include "kernel/mempool_radix4_cfft_q16p.h"
#include "kernel/mempool_radix4_cfft_q16s.h"
#include "mempool_radix4_cfft_butterfly_q16.h"
#include "mempool_radix4_cfft_q16_bitreversal.h"
#include "mempool_radix4_cfft_q16p.h"
#include "mempool_radix4_cfft_q16s.h"

int16_t l1_pSrc[N_FFTs_ROW * 8 * N_BANKS]
__attribute__((aligned(4 * N_BANKS), section(".l1_prio")));
Expand Down
8 changes: 4 additions & 4 deletions software/apps/chest_q16/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
#include <stdlib.h>
#include <string.h>

#include "builtins_v2.h"
#include "encoding.h"
#include "printf.h"
#include "runtime.h"
#include "synchronization.h"
#include "xpulp/builtins_v2.h"

#include "data/data_chest_q16.h"
#include "data_chest_q16.h"

#include "kernel/chest_q16p.h"
#include "kernel/chest_q16s.h"
#include "mempool_chest_q16p.h"
#include "mempool_chest_q16s.h"

//#define SINGLE
#define PARALLEL
Expand Down
8 changes: 4 additions & 4 deletions software/apps/cholesky_q32/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ int32_t In[N_BANKS] __attribute__((aligned(N_BANKS), section(".l1")));
#endif

#include "initialization.h"
#include "kernel/mempool_cholesky_q32s.h"
#include "kernel/mempool_linearsolver_q32s.h"
#include "mempool_cholesky_q32s.h"
#include "mempool_linearsolver_q32s.h"

#include "kernel/mempool_cholesky_q32p.h"
#include "kernel/mempool_linearsolver_q32p.h"
#include "mempool_cholesky_q32p.h"
#include "mempool_linearsolver_q32p.h"

void initialize() {

Expand Down
2 changes: 1 addition & 1 deletion software/apps/conv2d_i32/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <string.h>

#include "encoding.h"
#include "kernel/convolution.h"
#include "mempool_conv2d_i32p.h"
#include "printf.h"
#include "runtime.h"
#include "synchronization.h"
Expand Down
2 changes: 1 addition & 1 deletion software/apps/conv2d_i8/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#include <string.h>

#include "encoding.h"
#include "mempool_conv2d_i8s.h"
#include "printf.h"
#include "runtime.h"
#include "synchronization.h"
#include "xpulp/conv_2d.h"

#define M 32
#define N 32
Expand Down
2 changes: 1 addition & 1 deletion software/apps/dct_i32/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <string.h>

#include "encoding.h"
#include "kernel/dct.h"
#include "mempool_dct_i32p.h"
#include "printf.h"
#include "runtime.h"
#include "synchronization.h"
Expand Down
2 changes: 1 addition & 1 deletion software/apps/matmul_i16/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#include <string.h>

#include "encoding.h"
#include "mempool_matmul_i16p.h"
#include "printf.h"
#include "runtime.h"
#include "synchronization.h"
#include "xpulp/mat_mul.h"

// Define Matrix dimensions:
// C = AB with A=[MxN], B=[NxP], C=[MxP]
Expand Down
2 changes: 1 addition & 1 deletion software/apps/matmul_i32/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#include <string.h>

#include "encoding.h"
#include "mempool_matmul_i32p.h"
#include "printf.h"
#include "runtime.h"
#include "synchronization.h"
#include "xpulp/mat_mul.h"

// Define Matrix dimensions:
// C = AB with A=[MxN], B=[NxP], C=[MxP]
Expand Down
2 changes: 1 addition & 1 deletion software/apps/matmul_i8/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#include <string.h>

#include "encoding.h"
#include "mempool_matmul_i8p.h"
#include "printf.h"
#include "runtime.h"
#include "synchronization.h"
#include "xpulp/mat_mul.h"

// Define Matrix dimensions:
// C = AB with A=[MxN], B=[NxP], C=[MxP]
Expand Down
2 changes: 1 addition & 1 deletion software/apps/matrix_mul/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <string.h>

#include "encoding.h"
#include "kernel/mat_mul.h"
#include "mempool_matmul_i32p.h"
#include "printf.h"
#include "runtime.h"
#include "synchronization.h"
Expand Down
2 changes: 1 addition & 1 deletion software/apps/synth_i32/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <string.h>

#include "encoding.h"
#include "kernel/synth.h"
#include "mempool_synth_i32p.h"
#include "printf.h"
#include "runtime.h"
#include "synchronization.h"
Expand Down
2 changes: 1 addition & 1 deletion software/apps/tests/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <string.h>

#include "encoding.h"
#include "kernel/mat_mul.h"
#include "mempool_matmul_i32p.h"
#include "printf.h"
#include "runtime.h"
#include "synchronization.h"
Expand Down
2 changes: 1 addition & 1 deletion software/kernels/mempool_chest_q16p.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Author: Marco Bertuletti, ETH Zurich

// Includes inner loop
#include "chest_q16s.h"
#include "mempool_chest_q16s.h"

/**
@brief Block-type channel estimation.
Expand Down
2 changes: 1 addition & 1 deletion software/kernels/mempool_cholesky_q32p.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// Author: Marco Bertuletti, ETH Zurich

#include "kernel/mempool_sqrt_q32s.h"
#include "mempool_sqrt_q32s.h"

/**
@brief Parallel Cholesky decomposition.
Expand Down
2 changes: 1 addition & 1 deletion software/kernels/mempool_cholesky_q32s.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// Author: Marco Bertuletti, ETH Zurich

#include "kernel/mempool_sqrt_q32s.h"
#include "mempool_sqrt_q32s.h"

/**
@brief Choleksy decomposition with Banachiewicz algorithm.
Expand Down
2 changes: 1 addition & 1 deletion software/kernels/mempool_conv2d_i8s.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Davide Schiavone, ETH Zurich
// Sergio Mazzola, ETH Zurich

#include "xpulp/builtins_v2.h"
#include "builtins_v2.h"
#include <stdint.h>
#include <string.h>

Expand Down
2 changes: 1 addition & 1 deletion software/kernels/mempool_linearsolver_q32p.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ increase the utilization of the cores operating on multiple problems.
RIGHT
*/

#include "kernel/mempool_sqrt_q32s.h"
#include "mempool_sqrt_q32s.h"

/**
@brief First step of Cholesky.
Expand Down
2 changes: 1 addition & 1 deletion software/kernels/mempool_linearsolver_q32s.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// Author: Marco Bertuletti, ETH Zurich

#include "kernel/mempool_sqrt_q32s.h"
#include "mempool_sqrt_q32s.h"

/**
@brief Solution of a lower triangular system Lx=y.
Expand Down
2 changes: 1 addition & 1 deletion software/kernels/mempool_matmul_i16p.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Author: Samuel Riedel, ETH Zurich
// Sergio Mazzola, ETH Zurich

#include "xpulp/builtins_v2.h"
#include "builtins_v2.h"

/* This library implements the matrix multiplication for several data widths
* in Zmultiple different ways. The functions all follow the following format:
Expand Down
2 changes: 1 addition & 1 deletion software/kernels/mempool_matmul_i8p.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Author: Samuel Riedel, ETH Zurich
// Sergio Mazzola, ETH Zurich

#include "xpulp/builtins_v2.h"
#include "builtins_v2.h"

/* This library implements the matrix multiplication for several data widths
* in Zmultiple different ways. The functions all follow the following format:
Expand Down
2 changes: 1 addition & 1 deletion software/kernels/mempool_matmul_i8s.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Author: Samuel Riedel, ETH Zurich
// Sergio Mazzola, ETH Zurich

#include "xpulp/builtins_v2.h"
#include "builtins_v2.h"

/* This library implements the matrix multiplication for several data widths
* in Zmultiple different ways. The functions all follow the following format:
Expand Down
2 changes: 1 addition & 1 deletion software/kernels/mempool_radix2_cfft_q16p.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Author: Marco Bertuletti, ETH Zurich

#define MIN(x, y) (((x) < (y)) ? (x) : (y))
#include "xpulp/builtins_v2.h"
#include "builtins_v2.h"

void mempool_radix2_cfft_q16p(uint16_t fftLen, int16_t *pTwiddle,
uint16_t *pBitRevTable, int16_t *pSrc,
Expand Down
2 changes: 1 addition & 1 deletion software/kernels/mempool_radix2_cfft_q16s.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Author: Marco Bertuletti, ETH Zurich

#define MIN(x, y) (((x) < (y)) ? (x) : (y))
#include "xpulp/builtins_v2.h"
#include "builtins_v2.h"

void mempool_radix2_cfft_q16s(uint16_t fftLen, int16_t *pTwiddle,
uint16_t *pBitRevTable, int16_t *pSrc,
Expand Down
2 changes: 1 addition & 1 deletion software/kernels/mempool_radix4_cfft_butterfly_q16.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// Author: Marco Bertuletti, ETH Zurich

#include "xpulp/builtins_v2.h"
#include "builtins_v2.h"

/**
@brief First butterfly stage.
Expand Down
2 changes: 1 addition & 1 deletion software/kernels/mempool_radix4_cfft_q16p.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// Author: Marco Bertuletti, ETH Zurich

#include "xpulp/builtins_v2.h"
#include "builtins_v2.h"
#define MIN(x, y) (((x) < (y)) ? (x) : (y))

#ifndef ASM
Expand Down
2 changes: 1 addition & 1 deletion software/kernels/mempool_radix4_cfft_q16s.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// Author: Marco Bertuletti, ETH Zurich

#include "xpulp/builtins_v2.h"
#include "builtins_v2.h"

void mempool_radix4_cfft_q16s_riscv32(int16_t *pIn, uint32_t fftLen,
int16_t *pCoef16,
Expand Down
4 changes: 3 additions & 1 deletion software/runtime/runtime.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ HALIDE_INSTALL_DIR ?= $(INSTALL_DIR)/halide
HALIDE_INCLUDE ?= $(HALIDE_INSTALL_DIR)/include
HALIDE_LIB ?= $(HALIDE_INSTALL_DIR)/lib
OMP_DIR ?= $(ROOT_DIR)/omp
KERNELS_DIR ?= $(abspath $(ROOT_DIR)/../kernels)
DATA_DIR ?= $(abspath $(ROOT_DIR)/../data)

COMPILER ?= gcc
XPULPIMG ?= $(xpulpimg)
Expand Down Expand Up @@ -90,7 +92,7 @@ endif
RISCV_LLVM_TARGET ?= --target=$(RISCV_TARGET) --sysroot=$(GCC_INSTALL_DIR)/$(RISCV_TARGET) --gcc-toolchain=$(GCC_INSTALL_DIR)

RISCV_WARNINGS += -Wunused-variable -Wconversion -Wall -Wextra # -Werror
RISCV_FLAGS_COMMON_TESTS ?= -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI) -I$(ROOT_DIR) -I$(HALIDE_INCLUDE) -static
RISCV_FLAGS_COMMON_TESTS ?= -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI) -I$(ROOT_DIR) -I$(KERNELS_DIR) -I$(DATA_DIR) -I$(HALIDE_INCLUDE) -static
RISCV_FLAGS_COMMON ?= $(RISCV_FLAGS_COMMON_TESTS) -g -std=gnu99 -O3 -fno-builtin-memcpy -fno-builtin-memset -ffast-math -fno-common -fno-builtin-printf $(DEFINES) $(RISCV_WARNINGS)
RISCV_FLAGS_GCC ?= -mcmodel=medany -Wa,-march=$(RISCV_ARCH_AS) -mtune=mempool -fno-tree-loop-distribute-patterns # -falign-loops=32 -falign-jumps=32
RISCV_FLAGS_LLVM ?= -mcmodel=small -mcpu=mempool-rv32 -mllvm -misched-topdown
Expand Down

0 comments on commit 7c41569

Please sign in to comment.