aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTatWai Chong <tatwai.chong@arm.com>2023-08-18 17:58:17 +0000
committerTatWai Chong <tatwai.chong@arm.com>2023-08-18 11:10:31 -0700
commit39b5edc49734e08ca6d1c0b091416a04b2f60beb (patch)
treed4f72e89833508e8da31ff1d161c4d5d4b2d1714 /include
parent5f920211ac23393a7b98a0d358bfbfc3232d5c8f (diff)
downloadserialization_lib-39b5edc49734e08ca6d1c0b091416a04b2f60beb.tar.gz
[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 <tatwai.chong@arm.com>
Diffstat (limited to 'include')
-rw-r--r--include/numpy_utils.h3
1 files changed, 3 insertions, 0 deletions
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<int32_t>& 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