From 33e4b6217e7ae668351dc1c3ad1ac391154ddc19 Mon Sep 17 00:00:00 2001
From: NAUD Maxence <maxence.naud@cea.fr>
Date: Sun, 19 Jan 2025 15:57:41 +0000
Subject: [PATCH] UPD: change log::info of some tests to the new format

---
 unit_tests/operator/Test_BitShift.cpp            |  8 ++++----
 unit_tests/operator/Test_ClipImpl.cpp            | 16 ++++++++--------
 unit_tests/operator/Test_DivImpl.cpp             | 12 ++++++------
 .../operator/Test_GlobalAveragePoolingImpl.cpp   |  6 +++---
 unit_tests/operator/Test_MatMulImpl.cpp          | 12 ++++++------
 unit_tests/operator/Test_MulImpl.cpp             | 12 ++++++------
 unit_tests/operator/Test_PowImpl.cpp             | 12 ++++++------
 unit_tests/operator/Test_RoundImpl.cpp           |  4 ++--
 unit_tests/operator/Test_SubImpl.cpp             | 12 ++++++------
 9 files changed, 47 insertions(+), 47 deletions(-)

diff --git a/unit_tests/operator/Test_BitShift.cpp b/unit_tests/operator/Test_BitShift.cpp
index db97e8d3..33ab932e 100644
--- a/unit_tests/operator/Test_BitShift.cpp
+++ b/unit_tests/operator/Test_BitShift.cpp
@@ -136,8 +136,8 @@ TEST_CASE("[cpu/operator] BitShift_TEST", "[BitShift][CPU]") {
 
 
             }
-            fmt::print("INFO: number of elements over time spent: {}\n", (number_of_operation / duration.count()));
-            fmt::print("INFO: total time: {}μs\n", duration.count());
+            Log::info("number of elements over time spent: {}\n", (number_of_operation / duration.count()));
+            Log::info("total time: {}μs\n", duration.count());
         }
         SECTION("Test BitShift kernels with Broadcasting") {
             std::size_t number_of_operation = 0;
@@ -236,8 +236,8 @@ TEST_CASE("[cpu/operator] BitShift_TEST", "[BitShift][CPU]") {
                 const std::size_t nb_elements = std::accumulate(dimsOut.cbegin(), dimsOut.cend(), std::size_t(1), std::multiplies<std::size_t>());
                 number_of_operation += nb_elements;
             }
-            fmt::print("INFO: number of elements over time spent: {}\n", (number_of_operation / duration.count()));
-            fmt::print("INFO: total time: {}μs\n", duration.count());
+            Log::info("number of elements over time spent: {}\n", (number_of_operation / duration.count()));
+            Log::info("total time: {}μs\n", duration.count());
         }
 
 }
diff --git a/unit_tests/operator/Test_ClipImpl.cpp b/unit_tests/operator/Test_ClipImpl.cpp
index 1a7aa5e5..99147ac9 100644
--- a/unit_tests/operator/Test_ClipImpl.cpp
+++ b/unit_tests/operator/Test_ClipImpl.cpp
@@ -119,8 +119,8 @@ TEST_CASE("[cpu/operator] Clip", "[Clip][CPU]")
 
             REQUIRE(approxEq<float>(*(op->getOutput(0)), *Tres));
         }
-        fmt::print("INFO: multiplications over time spent: {}\n", totalComputation/duration.count());
-        fmt::print("INFO: total time: {}\n", duration.count());
+        Log::info("multiplications over time spent: {}\n", totalComputation/duration.count());
+        Log::info("total time: {}\n", duration.count());
     }
     SECTION("Clip test with min >= max [Forward]") {
         std::size_t totalComputation = 0;
@@ -179,8 +179,8 @@ TEST_CASE("[cpu/operator] Clip", "[Clip][CPU]")
 
             REQUIRE(approxEq<float>(*(op->getOutput(0)), *Tres));
         }
-        fmt::print("INFO: multiplications over time spent: {}\n", totalComputation/duration.count());
-        fmt::print("INFO: total time: {}\n", duration.count());
+        Log::info("multiplications over time spent: {}\n", totalComputation/duration.count());
+        Log::info("total time: {}\n", duration.count());
     }
     SECTION("Clip with Clip Attr [Forward]")
     {
@@ -232,8 +232,8 @@ TEST_CASE("[cpu/operator] Clip", "[Clip][CPU]")
 
             REQUIRE(approxEq<float>(*(op->getOutput(0)), *Tres));
         }
-        fmt::print("INFO: multiplications over time spent: {}\n", totalComputation/duration.count());
-        fmt::print("INFO: total time: {}\n", duration.count());
+        Log::info("multiplications over time spent: {}\n", totalComputation/duration.count());
+        Log::info("total time: {}\n", duration.count());
     }
     SECTION("Simple clip test [Backward]") {
         std::size_t totalComputation = 0;
@@ -311,8 +311,8 @@ TEST_CASE("[cpu/operator] Clip", "[Clip][CPU]")
             duration += std::chrono::duration_cast<std::chrono::microseconds>(end - start);
             REQUIRE(GT1 == BackwardTensorVec);
         }
-        fmt::print("INFO: multiplications over time spent: {}\n", totalComputation/duration.count());
-        fmt::print("INFO: total time: {}\n", duration.count());
+        Log::info("multiplications over time spent: {}\n", totalComputation/duration.count());
+        Log::info("total time: {}\n", duration.count());
     }
  }
 } // namespace Aidge
diff --git a/unit_tests/operator/Test_DivImpl.cpp b/unit_tests/operator/Test_DivImpl.cpp
index b03fe4aa..4037b2ad 100644
--- a/unit_tests/operator/Test_DivImpl.cpp
+++ b/unit_tests/operator/Test_DivImpl.cpp
@@ -126,8 +126,8 @@ TEST_CASE("[cpu/operator] Div", "[Div][CPU]") {
 
                 // with broadcasting
             }
-            fmt::print("INFO: number of elements over time spent: {}\n", (number_of_operation / duration.count()));
-            fmt::print("INFO: total time: {} μs\n", duration.count());
+            Log::info("number of elements over time spent: {}\n", (number_of_operation / duration.count()));
+            Log::info("total time: {} μs\n", duration.count());
         }
 
         SECTION("+1-D Tensor / +1-D Tensor - broadcasting") {
@@ -221,8 +221,8 @@ TEST_CASE("[cpu/operator] Div", "[Div][CPU]") {
                 const std::size_t nb_elements = std::accumulate(dimsOut.cbegin(), dimsOut.cend(), std::size_t(1), std::multiplies<std::size_t>());
                 number_of_operation += nb_elements;
             }
-            fmt::print("INFO: number of elements over time spent: {}\n", (number_of_operation / duration.count()));
-            fmt::print("INFO: total time: {} μs\n", duration.count());
+            Log::info("number of elements over time spent: {}\n", (number_of_operation / duration.count()));
+            Log::info("total time: {} μs\n", duration.count());
         }
         SECTION("+1-D Tensor / 1-D Tensor") {
             std::size_t number_of_operation = 0;
@@ -317,8 +317,8 @@ TEST_CASE("[cpu/operator] Div", "[Div][CPU]") {
                 number_of_operation += nb_elements;
             }
 
-            fmt::print("INFO: number of elements over time spent: {}\n", (number_of_operation / duration.count()));
-            fmt::print("INFO: total time: {} μs\n", duration.count());
+            Log::info("number of elements over time spent: {}\n", (number_of_operation / duration.count()));
+            Log::info("total time: {} μs\n", duration.count());
         }
     }
 }
diff --git a/unit_tests/operator/Test_GlobalAveragePoolingImpl.cpp b/unit_tests/operator/Test_GlobalAveragePoolingImpl.cpp
index 63f8d326..8e8536ac 100644
--- a/unit_tests/operator/Test_GlobalAveragePoolingImpl.cpp
+++ b/unit_tests/operator/Test_GlobalAveragePoolingImpl.cpp
@@ -554,9 +554,9 @@ TEST_CASE("[cpu/operator] GlobalAveragePooling",
           delete[] result;
         }
       }
-      fmt::print("INFO: GlobalAveragePooling total execution time: {}µs\n", duration.count());
-      fmt::print("INFO: Number of operations : {}\n", number_of_operation);
-      fmt::print("INFO: Operation / µs = {}\n", number_of_operation / duration.count());
+      Log::info("GlobalAveragePooling total execution time: {}µs\n", duration.count());
+      Log::info("Number of operations : {}\n", number_of_operation);
+      Log::info("Operation / µs = {}\n", number_of_operation / duration.count());
     }
   }
 }
diff --git a/unit_tests/operator/Test_MatMulImpl.cpp b/unit_tests/operator/Test_MatMulImpl.cpp
index daef47b3..f062f06c 100644
--- a/unit_tests/operator/Test_MatMulImpl.cpp
+++ b/unit_tests/operator/Test_MatMulImpl.cpp
@@ -111,8 +111,8 @@ TEST_CASE("[cpu/operator] MatMul(forward)", "[MatMul][CPU]") {
             delete[] bigArray2;
             delete[] res;
         }
-        fmt::print("INFO: number of multiplications over time spent: {}\n", (totalComputation / duration.count()));
-        fmt::print("INFO: total time: {} μs\n", duration.count());
+        Log::info("number of multiplications over time spent: {}\n", (totalComputation / duration.count()));
+        Log::info("total time: {} μs\n", duration.count());
     }
 
     SECTION("3-D Tensors") {
@@ -179,8 +179,8 @@ TEST_CASE("[cpu/operator] MatMul(forward)", "[MatMul][CPU]") {
             delete[] bigArray2;
             delete[] res;
         }
-        fmt::print("INFO: number of multiplications over time spent: {}\n", (totalComputation / duration.count()));
-        fmt::print("INFO: total time: {} μs\n", duration.count());
+        Log::info("number of multiplications over time spent: {}\n", (totalComputation / duration.count()));
+        Log::info("total time: {} μs\n", duration.count());
     }
 
     SECTION("4-D Tensors") {
@@ -249,8 +249,8 @@ TEST_CASE("[cpu/operator] MatMul(forward)", "[MatMul][CPU]") {
             delete[] bigArray2;
             delete[] res;
         }
-        fmt::print("INFO: number of multiplications over time spent: {}\n", (totalComputation / duration.count()));
-        fmt::print("INFO: total time: {} μs\n", duration.count());
+        Log::info("number of multiplications over time spent: {}\n", (totalComputation / duration.count()));
+        Log::info("total time: {} μs\n", duration.count());
     }
 
     SECTION("+2-D / 1-D") {
diff --git a/unit_tests/operator/Test_MulImpl.cpp b/unit_tests/operator/Test_MulImpl.cpp
index 925b9f20..b5f51725 100644
--- a/unit_tests/operator/Test_MulImpl.cpp
+++ b/unit_tests/operator/Test_MulImpl.cpp
@@ -437,8 +437,8 @@ TEST_CASE("[cpu/operator] Mul", "[Mul][CPU]") {
                 delete[] array1;
                 delete[] result;
             }
-            fmt::print("INFO: number of elements over time spent: {}\n", (number_of_operation / duration.count()));
-            fmt::print("INFO: total time: {} μs\n", duration.count());
+            Log::info("number of elements over time spent: {}\n", (number_of_operation / duration.count()));
+            Log::info("total time: {} μs\n", duration.count());
         }
 
 
@@ -568,8 +568,8 @@ TEST_CASE("[cpu/operator] Mul", "[Mul][CPU]") {
                 const std::size_t nb_elements = std::accumulate(dimsOut.cbegin(), dimsOut.cend(), std::size_t(1), std::multiplies<std::size_t>());
                 number_of_operation += nb_elements;
             }
-            fmt::print("INFO: number of elements over time spent: {}\n", (number_of_operation / duration.count()));
-            fmt::print("INFO: total time: {} μs\n", duration.count());
+            Log::info("number of elements over time spent: {}\n", (number_of_operation / duration.count()));
+            Log::info("total time: {} μs\n", duration.count());
         }
         SECTION("+1-D Tensor / 1-D Tensor") {
             std::size_t number_of_operation = 0;
@@ -664,8 +664,8 @@ TEST_CASE("[cpu/operator] Mul", "[Mul][CPU]") {
                 number_of_operation += nb_elements;
             }
 
-            fmt::print("INFO: number of elements over time spent: {}\n", (number_of_operation / duration.count()));
-            fmt::print("INFO: total time: {} μs\n", duration.count());
+            Log::info("number of elements over time spent: {}\n", (number_of_operation / duration.count()));
+            Log::info("total time: {} μs\n", duration.count());
         }
     }
 }
diff --git a/unit_tests/operator/Test_PowImpl.cpp b/unit_tests/operator/Test_PowImpl.cpp
index 8238da39..55a416c3 100644
--- a/unit_tests/operator/Test_PowImpl.cpp
+++ b/unit_tests/operator/Test_PowImpl.cpp
@@ -126,8 +126,8 @@ TEST_CASE("[cpu/operator] Pow", "[Pow][CPU]") {
 
                 // with broadcasting
             }
-            fmt::print("INFO: number of elements over time spent: {}\n", (number_of_operation / duration.count()));
-            fmt::print("INFO: total time: {} μs\n", duration.count());
+            Log::info("number of elements over time spent: {}\n", (number_of_operation / duration.count()));
+            Log::info("total time: {} μs\n", duration.count());
         }
 
         SECTION("+1-D Tensor / +1-D Tensor - broadcasting") {
@@ -221,8 +221,8 @@ TEST_CASE("[cpu/operator] Pow", "[Pow][CPU]") {
                 const std::size_t nb_elements = std::accumulate(dimsOut.cbegin(), dimsOut.cend(), std::size_t(1), std::multiplies<std::size_t>());
                 number_of_operation += nb_elements;
             }
-            fmt::print("INFO: number of elements over time spent: {}\n", (number_of_operation / duration.count()));
-            fmt::print("INFO: total time: {} μs\n", duration.count());
+            Log::info("number of elements over time spent: {}\n", (number_of_operation / duration.count()));
+            Log::info("total time: {} μs\n", duration.count());
         }
         SECTION("+1-D Tensor / 1-D Tensor") {
             std::size_t number_of_operation = 0;
@@ -317,8 +317,8 @@ TEST_CASE("[cpu/operator] Pow", "[Pow][CPU]") {
                 number_of_operation += nb_elements;
             }
 
-            fmt::print("INFO: number of elements over time spent: {}\n", (number_of_operation / duration.count()));
-            fmt::print("INFO: total time: {} μs\n", duration.count());
+            Log::info("number of elements over time spent: {}\n", (number_of_operation / duration.count()));
+            Log::info("total time: {} μs\n", duration.count());
         }
     }
 
diff --git a/unit_tests/operator/Test_RoundImpl.cpp b/unit_tests/operator/Test_RoundImpl.cpp
index 8b5dd53a..e658b061 100644
--- a/unit_tests/operator/Test_RoundImpl.cpp
+++ b/unit_tests/operator/Test_RoundImpl.cpp
@@ -108,8 +108,8 @@ TEST_CASE("[cpu/operator] Round_Test", "[Round][CPU]") {
 
 
             }
-            fmt::print("INFO: number of elements over time spent: {}\n", (number_of_operation / duration.count()));
-            fmt::print("INFO: total time: {} μs\n", duration.count());
+            Log::info("number of elements over time spent: {}\n", (number_of_operation / duration.count()));
+            Log::info("total time: {} μs\n", duration.count());
         }
     }
 } // namespace Aidge
diff --git a/unit_tests/operator/Test_SubImpl.cpp b/unit_tests/operator/Test_SubImpl.cpp
index 471ae560..1317e88a 100644
--- a/unit_tests/operator/Test_SubImpl.cpp
+++ b/unit_tests/operator/Test_SubImpl.cpp
@@ -126,8 +126,8 @@ TEST_CASE("[cpu/operator] Sub", "[Sub][CPU]") {
 
                 // with broadcasting
             }
-            fmt::print("INFO: number of elements over time spent: {}\n", (number_of_operation / duration.count()));
-            fmt::print("INFO: total time: {}μs\n", duration.count());
+            Log::info("number of elements over time spent: {}\n", (number_of_operation / duration.count()));
+            Log::info("total time: {}μs\n", duration.count());
         }
 
         SECTION("+1-D Tensor / +1-D Tensor - broadcasting") {
@@ -221,8 +221,8 @@ TEST_CASE("[cpu/operator] Sub", "[Sub][CPU]") {
                 const std::size_t nb_elements = std::accumulate(dimsOut.cbegin(), dimsOut.cend(), std::size_t(1), std::multiplies<std::size_t>());
                 number_of_operation += nb_elements;
             }
-            fmt::print("INFO: number of elements over time spent: {}\n", (number_of_operation / duration.count()));
-            fmt::print("INFO: total time: {}μs\n", duration.count());
+            Log::info("number of elements over time spent: {}\n", (number_of_operation / duration.count()));
+            Log::info("total time: {}μs\n", duration.count());
         }
         SECTION("+1-D Tensor / 1-D Tensor") {
             std::size_t number_of_operation = 0;
@@ -317,8 +317,8 @@ TEST_CASE("[cpu/operator] Sub", "[Sub][CPU]") {
                 number_of_operation += nb_elements;
             }
 
-            fmt::print("INFO: number of elements over time spent: {}\n", (number_of_operation / duration.count()));
-            fmt::print("INFO: total time: {}μs\n", duration.count());
+            Log::info("number of elements over time spent: {}\n", (number_of_operation / duration.count()));
+            Log::info("total time: {}μs\n", duration.count());
         }
     }
 }
-- 
GitLab