diff --git a/aidge/_Core/include/data/Tensor.hpp b/aidge/_Core/include/data/Tensor.hpp index d6e8f30316ed34ef620dd6de8ce43b55f6bea535..1aaaff60aa8a2da481305e78a3b93071675015ea 100644 --- a/aidge/_Core/include/data/Tensor.hpp +++ b/aidge/_Core/include/data/Tensor.hpp @@ -139,7 +139,7 @@ class Tensor : public Data, : Data(Type), mDims({SIZE_0}), mDataType(NativeType<T>::type), - mImpl(Registrar<Tensor>::create({"ref_cpp", NativeType<T>::type})(*this)), + mImpl(Registrar<Tensor>::create({"cpu", NativeType<T>::type})(*this)), mSize(SIZE_0), mSizeM1(SIZE_0) { mImpl->copy(&arr.data[0], SIZE_0); @@ -149,7 +149,7 @@ class Tensor : public Data, constexpr Tensor &operator=(Array1D<T, SIZE_0> &&arr) { resize({SIZE_0}); if (!mImpl) { - mImpl = Registrar<Tensor>::create({"ref_cpp", NativeType<T>::type})(*this); + mImpl = Registrar<Tensor>::create({"cpu", NativeType<T>::type})(*this); } mImpl->copy(&arr.data[0], SIZE_0); return *this; @@ -159,7 +159,7 @@ class Tensor : public Data, : Data(Type), mDims({SIZE_0, SIZE_1}), mDataType(NativeType<T>::type), - mImpl(Registrar<Tensor>::create({"ref_cpp", NativeType<T>::type})(*this)), + mImpl(Registrar<Tensor>::create({"cpu", NativeType<T>::type})(*this)), mSize(SIZE_0 * SIZE_1), mSizeM1(SIZE_1) { mImpl->copy(&arr.data[0][0], SIZE_0 * SIZE_1); @@ -169,7 +169,7 @@ class Tensor : public Data, constexpr Tensor &operator=(Array2D<T, SIZE_0, SIZE_1> &&arr) { resize({SIZE_0, SIZE_1}); if (!mImpl) { - mImpl = Registrar<Tensor>::create({"ref_cpp", NativeType<T>::type})(*this); + mImpl = Registrar<Tensor>::create({"cpu", NativeType<T>::type})(*this); } mImpl->copy(&arr.data[0][0], SIZE_0 * SIZE_1); return *this; @@ -179,7 +179,7 @@ class Tensor : public Data, : Data(Type), mDims({SIZE_0, SIZE_1, SIZE_2}), mDataType(NativeType<T>::type), - mImpl(Registrar<Tensor>::create({"ref_cpp", NativeType<T>::type})(*this)), + mImpl(Registrar<Tensor>::create({"cpu", NativeType<T>::type})(*this)), mSize(SIZE_0 * SIZE_1 * SIZE_2), mSizeM1(SIZE_1 * SIZE_2) { mImpl->copy(&arr.data[0][0][0], SIZE_0 * SIZE_1 * SIZE_2); @@ -189,7 +189,7 @@ class Tensor : public Data, constexpr Tensor &operator=(Array3D<T, SIZE_0, SIZE_1, SIZE_2> &&arr) { resize({SIZE_0, SIZE_1, SIZE_2}); if (!mImpl) { - mImpl = Registrar<Tensor>::create({"ref_cpp", NativeType<T>::type})(*this); + mImpl = Registrar<Tensor>::create({"cpu", NativeType<T>::type})(*this); } mImpl->copy(&arr.data[0][0][0], SIZE_0 * SIZE_1 * SIZE_2); return *this; @@ -199,7 +199,7 @@ class Tensor : public Data, : Data(Type), mDims({SIZE_0, SIZE_1, SIZE_2, SIZE_3}), mDataType(NativeType<T>::type), - mImpl(Registrar<Tensor>::create({"ref_cpp", NativeType<T>::type})(*this)), + mImpl(Registrar<Tensor>::create({"cpu", NativeType<T>::type})(*this)), mSize(SIZE_0 * SIZE_1 * SIZE_2 * SIZE_3), mSizeM1(SIZE_1 * SIZE_2 * SIZE_3) { mImpl->copy(&arr.data[0][0][0][0], SIZE_0 * SIZE_1 * SIZE_2 * SIZE_3); @@ -209,7 +209,7 @@ class Tensor : public Data, constexpr Tensor &operator=(Array4D<T, SIZE_0, SIZE_1, SIZE_2, SIZE_3> &&arr) { resize({SIZE_0, SIZE_1, SIZE_2, SIZE_3}); if (!mImpl) { - mImpl = Registrar<Tensor>::create({"ref_cpp", NativeType<T>::type})(*this); + mImpl = Registrar<Tensor>::create({"cpu", NativeType<T>::type})(*this); } mImpl->copy(&arr.data[0][0][0][0], SIZE_0 * SIZE_1 * SIZE_2 * SIZE_3); return *this; diff --git a/aidge/_Core/python_binding/data/pybind_Tensor.cpp b/aidge/_Core/python_binding/data/pybind_Tensor.cpp index 7342b22536e4374807a0ab0ff5597292b2cee2f0..9b8a228c3fd1a6a2b3def591160b5dade509d23d 100644 --- a/aidge/_Core/python_binding/data/pybind_Tensor.cpp +++ b/aidge/_Core/python_binding/data/pybind_Tensor.cpp @@ -39,8 +39,8 @@ void addCtor(py::class_<Tensor, newTensor->resize(dims); // TODO : Find a better way to choose backend std::set<std::string> availableBackends = Tensor::getAvailableBackends(); - if (availableBackends.find("ref_cpp") != availableBackends.end()){ - newTensor->setBackend("ref_cpp"); + if (availableBackends.find("cpu") != availableBackends.end()){ + newTensor->setBackend("cpu"); newTensor->getImpl()->setRawPtr(static_cast<T*>(info.ptr)); }else{ printf("Warning : Could not use aidge_ref_cpp backend, verify you have `import aidge_ref_cpp`\n");