From b7ea51c46b03154331d451476da8bfa259498aad Mon Sep 17 00:00:00 2001 From: NAUD Maxence <maxence.naud@cea.fr> Date: Wed, 8 Jan 2025 11:03:01 +0000 Subject: [PATCH] add small changes --- include/aidge/backend/cpu/data/TensorImpl.hpp | 2 +- include/aidge/graph/Connector.hpp | 6 +++--- include/aidge/utils/Log.hpp | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/aidge/backend/cpu/data/TensorImpl.hpp b/include/aidge/backend/cpu/data/TensorImpl.hpp index 2115b660f..4f7079e59 100644 --- a/include/aidge/backend/cpu/data/TensorImpl.hpp +++ b/include/aidge/backend/cpu/data/TensorImpl.hpp @@ -55,7 +55,7 @@ public: T* dstT = static_cast<T *>(rawPtr(offset)); AIDGE_ASSERT(dstT < srcT || dstT >= srcT + length, "TensorImpl_cpu<{}>::copy(): overlapping copy is not supported", typeid(T).name()); - std::copy(srcT, srcT + length, dstT); + std::copy_n(srcT, length, dstT); } void copyCast(const void *src, const DataType srcDt, NbElts_t length, NbElts_t offset = 0) override final; diff --git a/include/aidge/graph/Connector.hpp b/include/aidge/graph/Connector.hpp index 599ca7d6d..ec59e1b38 100644 --- a/include/aidge/graph/Connector.hpp +++ b/include/aidge/graph/Connector.hpp @@ -11,10 +11,10 @@ #ifndef AIDGE_CORE_GRAPH_CONNECTOR_H_ #define AIDGE_CORE_GRAPH_CONNECTOR_H_ -#include <cassert> #include <memory> #include <vector> +#include "aidge/utils/ErrorHandling.hpp" #include "aidge/utils/Types.h" namespace Aidge { @@ -55,7 +55,7 @@ class Connector { public: Connector operator[](IOIndex_t index) { - assert((size() > 1) && "Cannot refer a slice of the output."); + AIDGE_ASSERT((size() > 1), "Cannot refer a slice of the output."); return Connector(mNode, index); } @@ -68,7 +68,7 @@ class Connector { private: Connector(std::shared_ptr<Node> node, IOIndex_t index) : mNode(node) { - assert((index != gk_IODefaultIndex) && (index < size()) && + AIDGE_ASSERT((index != gk_IODefaultIndex) && (index < size()), "Non-valid output index.\n"); mOutputId = index; } diff --git a/include/aidge/utils/Log.hpp b/include/aidge/utils/Log.hpp index d6851f1e4..bc99ab7c0 100644 --- a/include/aidge/utils/Log.hpp +++ b/include/aidge/utils/Log.hpp @@ -19,7 +19,6 @@ #include <fmt/ranges.h> #include "aidge/data/half_fmt.hpp" - #include "aidge/utils/Attributes.hpp" namespace Aidge { -- GitLab