Skip to content
Snippets Groups Projects
Commit 8c0d482f authored by Olivier BICHLER's avatar Olivier BICHLER
Browse files

Improved error messages

parent c7870178
No related branches found
No related tags found
2 merge requests!152Update Aidge export to take a graph view has an argument instead of a...,!127Improved errors
Pipeline #46836 passed
...@@ -51,7 +51,7 @@ public: ...@@ -51,7 +51,7 @@ public:
const T* srcT = static_cast<const T *>(src); const T* srcT = static_cast<const T *>(src);
T* dstT = static_cast<T *>(rawPtr(offset)); T* dstT = static_cast<T *>(rawPtr(offset));
AIDGE_ASSERT(length <= mData.size() || length <= mNbElts, "copy length is above capacity"); AIDGE_ASSERT(length <= mData.size() || length <= mNbElts, "TensorImpl_cpu<{}>::copy(): copy length ({}) is above capacity ({})", typeid(T).name(), length, mNbElts);
AIDGE_ASSERT(dstT < srcT || dstT >= srcT + length, "overlapping copy is not supported"); AIDGE_ASSERT(dstT < srcT || dstT >= srcT + length, "overlapping copy is not supported");
std::copy(srcT, srcT + length, dstT); std::copy(srcT, srcT + length, dstT);
} }
...@@ -70,7 +70,7 @@ public: ...@@ -70,7 +70,7 @@ public:
void copyToHost(void *dst, NbElts_t length, NbElts_t offset = 0) const override final { void copyToHost(void *dst, NbElts_t length, NbElts_t offset = 0) const override final {
const T* src = static_cast<const T*>(rawPtr(offset)); const T* src = static_cast<const T*>(rawPtr(offset));
AIDGE_ASSERT(length <= mData.size() || length <= mNbElts, "copy length is above capacity"); AIDGE_ASSERT(length <= mData.size() || length <= mNbElts, "TensorImpl_cpu<{}>::copyToHost(): copy length ({}) is above capacity ({})", typeid(T).name(), length, mNbElts);
std::copy(src, src + length, static_cast<T *>(dst)); std::copy(src, src + length, static_cast<T *>(dst));
} }
......
...@@ -53,7 +53,7 @@ void Aidge::TensorImpl_cpu<T>::copyCast(const void *src, const Aidge::DataType s ...@@ -53,7 +53,7 @@ void Aidge::TensorImpl_cpu<T>::copyCast(const void *src, const Aidge::DataType s
} }
T* dstT = static_cast<T *>(rawPtr(offset)); T* dstT = static_cast<T *>(rawPtr(offset));
AIDGE_ASSERT(length <= mData.size() || length <= mNbElts, "copy length is above capacity"); AIDGE_ASSERT(length <= mData.size() || length <= mNbElts, "TensorImpl_cpu<{}>::copyCast(): copy length ({}) is above capacity ({})", typeid(T).name(), length, mNbElts);
switch (srcDt) switch (srcDt)
{ {
case DataType::Float64: case DataType::Float64:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment