Skip to content

Commit

Permalink
Fix Linux build issues (#25)
Browse files Browse the repository at this point in the history
* Fix Linux build issues
* Add missing prototypes to testsupport.h
* Get rid of type-aliasing warning
* Go down to z14 to support older distros
* Resolve CPPCheck errors.

---------

Signed-off-by: Andreas Krebbel <[email protected]>
Co-authored-by: Nicholas Marion <[email protected]>
  • Loading branch information
Andreas-Krebbel and n-marion authored Nov 22, 2024
1 parent 4409b70 commit 8823d82
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 230 deletions.
4 changes: 2 additions & 2 deletions config.zdnn
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ case "${target}" in
CFLAGS_INIT="-O3 -mzvector -Wall -std=gnu99 -fstack-protector-all ${CFLAGS_INIT:-}"
CFLAGS_QUOTE_INIT="-Wall" # Not needed on Linux. Just repeat an option to prevent it from being empty.
CFLAGS_OPT_EXPENSIVE="-funroll-loops"
CFLAGS="-O3 -march=z16 -mzvector -Wall -std=gnu99 -fstack-protector-all ${CFLAGS_OPT_EXPENSIVE} ${CFLAGS:-}"
CFLAGS="-O3 -march=z14 -mzvector -Wall -std=gnu99 -fstack-protector-all ${CFLAGS_OPT_EXPENSIVE} ${CFLAGS:-}"
CFLAGS_QUOTE="-Wall"
CFLAGS_DEBUG="-O0 -g3 ${CFLAGS_DEBUG:-}"
CFLAGS_SHARED="-fPIC ${CFLAGS_SHARED:-}"
CFLAGS_ASM="-Wa,-adhln -fno-asynchronous-unwind-tables ${CFLAGS_ASM:-}"
CFLAGS_NOSEARCH=""
CXXFLAGS="-O3 -march=z16 -Wall ${CXXFLAGS:-}"
CXXFLAGS="-O3 -march=z14 -Wall ${CXXFLAGS:-}"
CPP_SYMCHECK_FLAGS="-E -o zdnn.i"
SODIR="${SODIR:-lib}"
LIBNAME="${LIBNAME:-libzdnn}"
Expand Down
10 changes: 10 additions & 0 deletions tests/testsupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ extern float ZERO_ARRAY[1];
// likely due to something's wrong with the testcase itself
#define GENERAL_TESTCASE_FAILURE 0xDEADBEEF

void nhwc_2_nchw(void *nhwc_ptr, uint32_t n, uint32_t h, uint32_t w, uint32_t c,
int element_size, void *nchw_ptr);
size_t *alloc_offsets(zdnn_ztensor *ztensor);
size_t *alloc_rnn_offsets(const zdnn_ztensor *ztensor);
size_t *alloc_rnn_output_offsets(const zdnn_ztensor *ztensor);
Expand Down Expand Up @@ -228,6 +230,10 @@ extern char error_message[ERROR_MESSAGE_STR_LENGTH];

extern zdnn_data_types test_datatype;

void UnityDefaultTestRunWithAllPreDataType(UnityTestFunction Func,
const char *FuncName,
const int FuncLineNum);

void UnityDefaultTestRunWithDLFloat16PreDataType(UnityTestFunction Func,
const char *FuncName,
const int FuncLineNum);
Expand All @@ -240,6 +246,10 @@ void UnityDefaultTestRunWithIndexPreDataType(UnityTestFunction Func,
const char *FuncName,
const int FuncLineNum);

void UnityDefaultTestRunWithAllTfrmdDataType(UnityTestFunction Func,
const char *FuncName,
const int FuncLineNum);

void UnityDefaultTestRunWithDLFloat16TfrmdDataType(UnityTestFunction Func,
const char *FuncName,
const int FuncLineNum);
Expand Down
Loading

0 comments on commit 8823d82

Please sign in to comment.