From edac6abb626993c1005feb48db497064a7d102d0 Mon Sep 17 00:00:00 2001 From: Eric Kunze Date: Wed, 28 Jun 2023 13:29:38 -0700 Subject: Fix missing template instantiations Would cause unresolved symbols to appear when building in release mode. There are a couple of minor compiler warning fixes as well. Signed-off-by: Eric Kunze Change-Id: I0f7e9a8771442a6e3c848edfe034ef534d0d8ca7 --- reference_model/include/dtype.h | 1 + reference_model/src/ops/ewise_binary.cc | 1 + reference_model/src/ops/reduction.cc | 9 +++++++++ reference_model/src/tensor.cc | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/reference_model/include/dtype.h b/reference_model/include/dtype.h index 4976b54..59b7fcd 100644 --- a/reference_model/include/dtype.h +++ b/reference_model/include/dtype.h @@ -75,6 +75,7 @@ inline const char* EnumNameTOSAREFTYPE(TOSA_REF_TYPE e) return "FP64"; default: assert(false); + return "ERROR"; } } diff --git a/reference_model/src/ops/ewise_binary.cc b/reference_model/src/ops/ewise_binary.cc index 2bc894d..8578527 100644 --- a/reference_model/src/ops/ewise_binary.cc +++ b/reference_model/src/ops/ewise_binary.cc @@ -654,6 +654,7 @@ DEF_INSTANTIATE_RANK0_6_ONE_RANK_TWO_TYPE(BinaryNodeBase, BF16, BOOL); DEF_INSTANTIATE_RANK0_6_ONE_RANK_TWO_TYPE(BinaryNodeBase, FP32, BOOL); DEF_INSTANTIATE_RANK0_6_ONE_RANK_TWO_TYPE(BinaryNodeBase, INT32, BOOL); DEF_INSTANTIATE_RANK0_6_ONE_RANK_TWO_TYPE(BinaryNodeBase, FP64, FP64); +DEF_INSTANTIATE_RANK0_6_ONE_RANK_TWO_TYPE(BinaryNodeBase, FP64, BOOL); DEF_INSTANTIATE_RANK0_6_ONE_RANK_ONE_TYPE(OpAdd, FP16); DEF_INSTANTIATE_RANK0_6_ONE_RANK_ONE_TYPE(OpAdd, BF16); diff --git a/reference_model/src/ops/reduction.cc b/reference_model/src/ops/reduction.cc index f07ffd7..639da8d 100644 --- a/reference_model/src/ops/reduction.cc +++ b/reference_model/src/ops/reduction.cc @@ -305,3 +305,12 @@ DEF_INSTANTIATE_RANK1_6_ONE_RANK_ONE_TYPE(OpReduceSum, BF16); DEF_INSTANTIATE_RANK1_6_ONE_RANK_ONE_TYPE(OpReduceSum, FP32); DEF_INSTANTIATE_RANK1_6_ONE_RANK_ONE_TYPE(OpReduceSumDouble, FP64); DEF_INSTANTIATE_RANK1_6_ONE_RANK_ONE_TYPE(OpReduceSumInt, INT32); + +DEF_INSTANTIATE_RANK1_6_ONE_RANK_ONE_TYPE(ReduceNode, BOOL); +DEF_INSTANTIATE_RANK1_6_ONE_RANK_ONE_TYPE(ReduceNode, INT8); +DEF_INSTANTIATE_RANK1_6_ONE_RANK_ONE_TYPE(ReduceNode, INT16); +DEF_INSTANTIATE_RANK1_6_ONE_RANK_ONE_TYPE(ReduceNode, INT32); +DEF_INSTANTIATE_RANK1_6_ONE_RANK_ONE_TYPE(ReduceNode, FP16); +DEF_INSTANTIATE_RANK1_6_ONE_RANK_ONE_TYPE(ReduceNode, BF16); +DEF_INSTANTIATE_RANK1_6_ONE_RANK_ONE_TYPE(ReduceNode, FP32); +DEF_INSTANTIATE_RANK1_6_ONE_RANK_ONE_TYPE(ReduceNode, FP64); \ No newline at end of file diff --git a/reference_model/src/tensor.cc b/reference_model/src/tensor.cc index 08d5b2a..1cfa6c5 100644 --- a/reference_model/src/tensor.cc +++ b/reference_model/src/tensor.cc @@ -319,7 +319,7 @@ int TosaReference::Tensor::writeToNpyFile(const char* filename) const int32_t* i32databuf = nullptr; int64_t* i64databuf = nullptr; bool* bdatabuf = nullptr; - NumpyUtilities::NPError nperror; + NumpyUtilities::NPError nperror = NumpyUtilities::NO_ERROR; uint32_t elements = getElementCount(); const TOSA_REF_TYPE dtype = getDtype(); -- cgit v1.2.1