summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLiam Barry <liam.barry@arm.com>2023-08-03 18:21:58 +0100
committerRichard <richard.burton@arm.com>2023-08-29 12:48:06 +0000
commit677d43fa8f55a8aa52e6bd9d1884e2797650fd65 (patch)
tree154774010a306aeac14bf2eb4b4a0846dd905c1b /tests
parentf1b28b861e301122b85ad7dc3d8ccb0720fcb584 (diff)
downloadml-embedded-evaluation-kit-677d43fa8f55a8aa52e6bd9d1884e2797650fd65.tar.gz
MLECO-4260: Replace raw C++ pointers with smart variants
Model: Added std::unique_ptr qualifier to Model.cc member and used make_unique when creating interpreter object Removed custom destructor and un-necessary memory cleanup following failed allocation DataStructures: Refactored array 2d to use a std::vector under the hood. This should preserve desired attributes including contiguous memory while removing the need for custom destructor. Original size function renamed to dimSize to avoid confusion with vector.size() Accompanying changes made to preprocessing and ASR tests. AppContext: Replaced use of raw pointers in AppContext.hpp. Previously a std::map including IAttribute pointers required individual deallocation as they were allocated using new. Signed-off-by: Liam Barry <liam.barry@arm.com> Change-Id: I1a34dce5dea6ecf4883a9ada3a20f827eb6e6d6b
Diffstat (limited to 'tests')
-rw-r--r--tests/use_case/asr/AsrFeaturesTests.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/use_case/asr/AsrFeaturesTests.cc b/tests/use_case/asr/AsrFeaturesTests.cc
index e88d932..0518ade 100644
--- a/tests/use_case/asr/AsrFeaturesTests.cc
+++ b/tests/use_case/asr/AsrFeaturesTests.cc
@@ -1,6 +1,6 @@
/*
- * SPDX-FileCopyrightText: Copyright 2021-2022 Arm Limited and/or its affiliates <open-source-office@arm.com>
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-FileCopyrightText: Copyright 2021-2023 Arm Limited and/or its affiliates
+ * <open-source-office@arm.com> SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -100,14 +100,14 @@ TEST_CASE("Floating point asr features calculation", "[ASR]")
/* First 4 and last 4 values are different because we pad AFTER diff calculated. */
for (size_t i = 0; i < numMfccFeats; ++i) {
const float* start_goldenDelta1Buf = goldenDelta1Buf[i].data() + 4;
- const float* start_delta1 = delta1Buf.begin() + i * delta1Buf.size(1) + 4;
+ const float* start_delta1 = delta1Buf.begin() + i * delta1Buf.dimSize(1) + 4;
std::vector<float> goldenDataDelta1(start_goldenDelta1Buf, start_goldenDelta1Buf + numFeatVectors - 8);
std::vector<float> tensorDataDelta1(start_delta1, start_delta1 + numFeatVectors - 8);
CheckOutputs<float>(goldenDataDelta1,tensorDataDelta1);
const float* start_goldenDelta2Buf = goldenDelta2Buf[i].data() + 4;
- const float* start_delta2 = delta2Buf.begin() + i * delta2Buf.size(1) + 4;
+ const float* start_delta2 = delta2Buf.begin() + i * delta2Buf.dimSize(1) + 4;
std::vector<float> goldenDataDelta2(start_goldenDelta2Buf, start_goldenDelta2Buf + numFeatVectors - 8);
std::vector<float> tensorDataDelta2(start_delta2, start_delta2 + numFeatVectors - 8);