From d06722da6ba740d00a77bab389d80bc3952e5f10 Mon Sep 17 00:00:00 2001 From: NAUD Maxence <maxence.naud@cea.fr> Date: Thu, 3 Aug 2023 14:04:18 +0000 Subject: [PATCH] [Upd] test names, [Rmv] Makefile, [Change] IONb_t for IOIndex_t --- Makefile | 36 ------------------- src/operator/FCImpl.cpp | 2 +- unit_tests/Test_Scheduler.cpp | 2 +- unit_tests/operator/Test_AddImpl.cpp | 2 +- unit_tests/operator/Test_AvgPoolingImpl.cpp | 2 +- unit_tests/operator/Test_BatchNormImpl.cpp | 2 +- .../operator/Test_ConvDepthWiseImpl.cpp | 2 +- unit_tests/operator/Test_ConvImpl.cpp | 2 +- unit_tests/operator/Test_FCImpl.cpp | 2 +- unit_tests/operator/Test_LeakyReLUImpl.cpp | 2 +- unit_tests/operator/Test_ReLUImpl.cpp | 2 +- unit_tests/operator/Test_SoftmaxImpl.cpp | 2 +- 12 files changed, 11 insertions(+), 47 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index 8aed5f74..00000000 --- a/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -# This makefile does nothing but delegating the actual building to cmake -BUILDDIR := build -MAKEFLAGS := --no-print-directory - -all: cpu_with_pybind - -cpu_only: - mkdir -p ${BUILDDIR}; \ - cd ${BUILDDIR}; \ - cmake -DBUILD_CPU_ALONE=ON -DCMAKE_BUILD_TYPE=Release -DPYBIND=OFF -DTESTS=OFF ..; \ - ${MAKE} ${MAKEFLAGS}; - -cpu_tests: - mkdir -p ${BUILDDIR}; \ - cd ${BUILDDIR}; \ - cmake -DBUILD_CPU_ALONE=ON -DCMAKE_BUILD_TYPE=Debug -DPYBIND=OFF -DTESTS=ON ..; \ - ${MAKE} ${MAKEFLAGS}; \ - cd tests; \ - ctest --output-on-failure || true; - -cpu_with_pybind: - mkdir -p ${BUILDDIR}; \ - cd ${BUILDDIR}; \ - cmake -DBUILD_CPU_ALONE=ON -DCMAKE_BUILD_TYPE=Release -DPYBIND=ON -DTESTS=OFF ..; \ - ${MAKE} ${MAKEFLAGS}; - -cpu_with_pybind_tests: - mkdir -p ${BUILDDIR}; \ - cd ${BUILDDIR}; \ - cmake -DBUILD_CPU_ALONE=ON -DCMAKE_BUILD_TYPE=Debug -DPYBIND=ON -DTESTS=ON ..; \ - ${MAKE} ${MAKEFLAGS}; \ - cd tests; \ - ctest --output-on-failure || true; - -clean: - if [ -d "${BUILDDIR}" ]; then rm -rf ${BUILDDIR}; fi \ No newline at end of file diff --git a/src/operator/FCImpl.cpp b/src/operator/FCImpl.cpp index 0f1bf604..3195aa99 100644 --- a/src/operator/FCImpl.cpp +++ b/src/operator/FCImpl.cpp @@ -59,7 +59,7 @@ Aidge::NbElts_t Aidge::FCImpl_cpu::getRequiredMemory( Aidge::NbElts_t Aidge::FCImpl_cpu::getNbConsumedData(Aidge::IOIndex_t inputIdx) const { - assert((inputIdx >= 0) && (static_cast<IONb_t>(inputIdx) < mNbConsumedData.size())); + assert((inputIdx != gk_IODefaultIndex) && (inputIdx < mNbConsumedData.size())); return mNbConsumedData[static_cast<std::size_t>(inputIdx)]; } diff --git a/unit_tests/Test_Scheduler.cpp b/unit_tests/Test_Scheduler.cpp index 57f3ce2e..e83d8e97 100644 --- a/unit_tests/Test_Scheduler.cpp +++ b/unit_tests/Test_Scheduler.cpp @@ -23,7 +23,7 @@ using namespace Aidge; -TEST_CASE("[aidge/_CPU/scheduler] SequentialScheduler(forward)") { +TEST_CASE("[cpu/scheduler] SequentialScheduler(forward)") { std::shared_ptr<Tensor> inputTensor = std::make_shared<Tensor>(Array4D<int, 2, 1, 5, 5>{{{{{0, 1, 2, 3, 4}, {5, 6, 7, 8, 9}, diff --git a/unit_tests/operator/Test_AddImpl.cpp b/unit_tests/operator/Test_AddImpl.cpp index 13356ba2..998e9bce 100644 --- a/unit_tests/operator/Test_AddImpl.cpp +++ b/unit_tests/operator/Test_AddImpl.cpp @@ -18,7 +18,7 @@ using namespace Aidge; -TEST_CASE("[aidge/_CPU/operator] Add(forward)") { +TEST_CASE("[cpu/operator] Add(forward)") { std::shared_ptr<Tensor> input1 = std::make_shared<Tensor>(Array4D<int,3,3,3,2> { { { diff --git a/unit_tests/operator/Test_AvgPoolingImpl.cpp b/unit_tests/operator/Test_AvgPoolingImpl.cpp index e6ff2aa7..4348291a 100644 --- a/unit_tests/operator/Test_AvgPoolingImpl.cpp +++ b/unit_tests/operator/Test_AvgPoolingImpl.cpp @@ -20,7 +20,7 @@ using namespace Aidge; -TEST_CASE("[aidge/_CPU/operator] AvgPooling(forward)") { +TEST_CASE("[cpu/operator] AvgPooling(forward)") { std::shared_ptr<Tensor> myInput = std::make_shared<Tensor>(Array4D<float,2,2,5,5> { //NCHW { { diff --git a/unit_tests/operator/Test_BatchNormImpl.cpp b/unit_tests/operator/Test_BatchNormImpl.cpp index eace14ec..92d1e5f2 100644 --- a/unit_tests/operator/Test_BatchNormImpl.cpp +++ b/unit_tests/operator/Test_BatchNormImpl.cpp @@ -19,7 +19,7 @@ using namespace Aidge; -TEST_CASE("[aidge/_CPU/operator] BatchNorm(forward)") { +TEST_CASE("[cpu/operator] BatchNorm(forward)") { std::shared_ptr<Node> myBatchNorm = BatchNorm<2>(0.00001F, 0.1F, "mybatchnorm"); myBatchNorm->getOperator()->setDatatype(DataType::Float32); myBatchNorm->getOperator()->setBackend("cpu"); diff --git a/unit_tests/operator/Test_ConvDepthWiseImpl.cpp b/unit_tests/operator/Test_ConvDepthWiseImpl.cpp index 444c0d45..eccf262a 100644 --- a/unit_tests/operator/Test_ConvDepthWiseImpl.cpp +++ b/unit_tests/operator/Test_ConvDepthWiseImpl.cpp @@ -19,7 +19,7 @@ using namespace Aidge; -TEST_CASE("[aidge/_CPU/operator] ConvDepthWise(forward)") { +TEST_CASE("[cpu/operator] ConvDepthWise(forward)") { std::shared_ptr<Node> myCDW = ConvDepthWise({3,3}, "mycdw"); myCDW->getOperator()->setDatatype(DataType::Int32); myCDW->getOperator()->setBackend("cpu"); diff --git a/unit_tests/operator/Test_ConvImpl.cpp b/unit_tests/operator/Test_ConvImpl.cpp index 358c402b..d747eec8 100644 --- a/unit_tests/operator/Test_ConvImpl.cpp +++ b/unit_tests/operator/Test_ConvImpl.cpp @@ -20,7 +20,7 @@ using namespace Aidge; -TEST_CASE("[aidge/_CPU/operator] Conv(forward)") { +TEST_CASE("[cpu/operator] Conv(forward)") { SECTION("Classic Conv") { std::shared_ptr<Node> myConv = Conv(3,4,{3,3}, "myconv"); myConv->getOperator()->setDatatype(DataType::Int32); diff --git a/unit_tests/operator/Test_FCImpl.cpp b/unit_tests/operator/Test_FCImpl.cpp index f3056e07..7ef92875 100644 --- a/unit_tests/operator/Test_FCImpl.cpp +++ b/unit_tests/operator/Test_FCImpl.cpp @@ -19,7 +19,7 @@ using namespace Aidge; -TEST_CASE("[aidge/_CPU/oeprator] FC(forward)") { +TEST_CASE("[cpu/oeprator] FC(forward)") { std::shared_ptr<Tensor> myWeights = std::make_shared<Tensor>(Array2D<int, 5, 75>{ {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 2, 3, 4, 5, 6, 7, 8, diff --git a/unit_tests/operator/Test_LeakyReLUImpl.cpp b/unit_tests/operator/Test_LeakyReLUImpl.cpp index 582a2276..b3ca9205 100644 --- a/unit_tests/operator/Test_LeakyReLUImpl.cpp +++ b/unit_tests/operator/Test_LeakyReLUImpl.cpp @@ -18,7 +18,7 @@ using namespace Aidge; -TEST_CASE("[aidge/_CPU/operator] LeakyReLU(forward)") { +TEST_CASE("[cpu/operator] LeakyReLU(forward)") { SECTION("1D Tensor") { std::shared_ptr<Tensor> input0 = std::make_shared<Tensor>(Array1D<int,10> { {0, 1, 2,-3, 4,-5,-6, 7, 8, 9} diff --git a/unit_tests/operator/Test_ReLUImpl.cpp b/unit_tests/operator/Test_ReLUImpl.cpp index 99f5cd6a..c8d04401 100644 --- a/unit_tests/operator/Test_ReLUImpl.cpp +++ b/unit_tests/operator/Test_ReLUImpl.cpp @@ -21,7 +21,7 @@ using namespace Aidge; -TEST_CASE("[aidge/_CPU/operator] ReLU(forward)") { +TEST_CASE("[cpu/operator] ReLU(forward)") { SECTION("1D Tensor") { std::shared_ptr<Tensor> input0 = std::make_shared<Tensor>(Array1D<int,10> { {0, 1, 2,-3, 4,-5,-6, 7, 8, 9} diff --git a/unit_tests/operator/Test_SoftmaxImpl.cpp b/unit_tests/operator/Test_SoftmaxImpl.cpp index 32324b5c..785d5bb3 100644 --- a/unit_tests/operator/Test_SoftmaxImpl.cpp +++ b/unit_tests/operator/Test_SoftmaxImpl.cpp @@ -20,7 +20,7 @@ using namespace Aidge; -TEST_CASE("[aidge/_CPU/operator] Softmax(forward)") { +TEST_CASE("[cpu/operator] Softmax(forward)") { SECTION("2D Tensor") { std::shared_ptr<Tensor> input = std::make_shared<Tensor>(Array2D<float,2,10> { { -- GitLab