From 39b5edc49734e08ca6d1c0b091416a04b2f60beb Mon Sep 17 00:00:00 2001 From: TatWai Chong Date: Fri, 18 Aug 2023 17:58:17 +0000 Subject: [fix] explicitly declare template specialization for readFromNpyFile Not all compiler/linker can link the typed call side to the desired type of specialized template function without having explicit declaration in the header file. Dtype mismatch will happen during reading numpy file when wrong caller-callee pair linked. Change-Id: If97c2a12d9cb602e08c8c31e828f85577cf002e6 Signed-off-by: TatWai Chong --- include/numpy_utils.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/numpy_utils.h b/include/numpy_utils.h index 83fbd5c..a788f81 100644 --- a/include/numpy_utils.h +++ b/include/numpy_utils.h @@ -139,4 +139,7 @@ private: static NPError writeNpyHeader(FILE* outfile, const std::vector& shape, const char* dtype_str); }; +template <> +NumpyUtilities::NPError NumpyUtilities::readFromNpyFile(const char* filename, const uint32_t elems, int32_t* databuf); + #endif // _TOSA_NUMPY_UTILS_H -- cgit v1.2.1