From 12ca5c6703a75720126eeb09e5361a5018eb0b09 Mon Sep 17 00:00:00 2001 From: NAUD Maxence <maxence.naud@cea.fr> Date: Sat, 19 Oct 2024 21:08:19 +0000 Subject: [PATCH] Fix forgotten 'delete' calls at the end of some tests --- unit_tests/data/Test_TensorImpl.cpp | 4 ++++ unit_tests/operator/Test_MatMulImpl.cpp | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/unit_tests/data/Test_TensorImpl.cpp b/unit_tests/data/Test_TensorImpl.cpp index b05171a1..4bfa10ab 100644 --- a/unit_tests/data/Test_TensorImpl.cpp +++ b/unit_tests/data/Test_TensorImpl.cpp @@ -154,6 +154,10 @@ TEST_CASE("Test addition of Tensors","[TensorImpl][Add]") { Tensor T4(T1->dims()); T4.setDataType(DataType::Float64); REQUIRE_THROWS(*T0 + T4); + + delete[] array0; + delete[] array1; + delete[] result; } } diff --git a/unit_tests/operator/Test_MatMulImpl.cpp b/unit_tests/operator/Test_MatMulImpl.cpp index 8a1e589f..d6e934b4 100644 --- a/unit_tests/operator/Test_MatMulImpl.cpp +++ b/unit_tests/operator/Test_MatMulImpl.cpp @@ -101,6 +101,10 @@ TEST_CASE("[cpu/operator] MatMul(forward)", "[MatMul][CPU]") { duration += std::chrono::duration_cast<std::chrono::microseconds>(end - start); REQUIRE(approxEq<float>(*(op->getOutput(0)), *Tres)); + + delete[] bigArray1; + delete[] bigArray2; + delete[] res; } std::cout << "multiplications over time spent: " << totalComputation/duration.count() << std::endl; std::cout << "total time: " << duration.count() << std::endl; @@ -165,6 +169,10 @@ TEST_CASE("[cpu/operator] MatMul(forward)", "[MatMul][CPU]") { duration += std::chrono::duration_cast<std::chrono::microseconds>(end - start); REQUIRE(approxEq<float>(*(op->getOutput(0)), *Tres)); + + delete[] bigArray1; + delete[] bigArray2; + delete[] res; } std::cout << "multiplications over time spent: " << totalComputation/duration.count() << std::endl; std::cout << "total time: " << duration.count() << std::endl; @@ -231,6 +239,10 @@ TEST_CASE("[cpu/operator] MatMul(forward)", "[MatMul][CPU]") { end = std::chrono::system_clock::now(); duration += std::chrono::duration_cast<std::chrono::microseconds>(end - start); REQUIRE(approxEq<float>(*(op->getOutput(0)), *Tres)); + + delete[] bigArray1; + delete[] bigArray2; + delete[] res; } std::cout << "multiplications over time spent: " << totalComputation/duration.count() << std::endl; std::cout << "total time: " << duration.count() << std::endl; -- GitLab