Skip to content
Snippets Groups Projects
Commit 7e453033 authored by Maxence Naud's avatar Maxence Naud
Browse files

change cassert for AIDGE_ASSERT in utils.cpp

parent de79126e
No related branches found
No related tags found
1 merge request!11version 0.1.0
Pipeline #43340 passed
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
* *
********************************************************************************/ ********************************************************************************/
#include <cassert>
#include <opencv2/core.hpp> // cv::Mat, cv::split #include <opencv2/core.hpp> // cv::Mat, cv::split
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
...@@ -23,6 +22,7 @@ ...@@ -23,6 +22,7 @@
#include "aidge/backend/cpu/data/TensorImpl.hpp" #include "aidge/backend/cpu/data/TensorImpl.hpp"
#include "aidge/backend/opencv/data/TensorImpl.hpp" #include "aidge/backend/opencv/data/TensorImpl.hpp"
#include "aidge/data/Data.hpp" #include "aidge/data/Data.hpp"
#include "aidge/utils/ErrorHandling.hpp"
#include "aidge/utils/Types.h" // DimSize_t #include "aidge/utils/Types.h" // DimSize_t
static Aidge::DataType CVtoAidge(const int matDepth) { static Aidge::DataType CVtoAidge(const int matDepth) {
...@@ -96,7 +96,7 @@ void Aidge::convert(const cv::Mat& mat, void* data, std::size_t offset) ...@@ -96,7 +96,7 @@ void Aidge::convert(const cv::Mat& mat, void* data, std::size_t offset)
std::shared_ptr<Aidge::Tensor> Aidge::convertCpu(std::shared_ptr<Aidge::Tensor> tensorOpencv){ std::shared_ptr<Aidge::Tensor> Aidge::convertCpu(std::shared_ptr<Aidge::Tensor> tensorOpencv){
// Assert the tensorOpencv is backend Opencv // Assert the tensorOpencv is backend Opencv
assert(std::strcmp(tensorOpencv->getImpl()->backend().c_str(), "opencv") == 0 && "Cannot convert tensor backend from opencv to cpu : tensor is not backend opencv."); AIDGE_ASSERT(tensorOpencv->getImpl()->backend() == "opencv", "Cannot convert tensor backend from opencv to cpu : tensor is not backend opencv.");
// Create a tensor backend cpu from the dimensions of the tensor backend opencv // Create a tensor backend cpu from the dimensions of the tensor backend opencv
std::shared_ptr<Aidge::Tensor> tensorCpu = std::make_shared<Aidge::Tensor>(tensorOpencv->dims()); std::shared_ptr<Aidge::Tensor> tensorCpu = std::make_shared<Aidge::Tensor>(tensorOpencv->dims());
......
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