Skip to content
Snippets Groups Projects
Commit 5ace21a4 authored by Maxence Naud's avatar Maxence Naud Committed by Maxence Naud
Browse files

Add member function 'Tensor::backend' to check the backend in Tensor

parent b4569cbe
No related branches found
No related tags found
No related merge requests found
...@@ -348,6 +348,10 @@ public: ...@@ -348,6 +348,10 @@ public:
return newTensor; return newTensor;
} }
const std::string backend() const {
return hasImpl() ? getImpl()->backend() : "";
}
/** /**
* @brief Set the backend of the Tensor associated implementation. If there * @brief Set the backend of the Tensor associated implementation. If there
* was no previous implementation set, data will be allocated, but it will * was no previous implementation set, data will be allocated, but it will
...@@ -410,8 +414,8 @@ public: ...@@ -410,8 +414,8 @@ public:
* @brief Get the Impl object * @brief Get the Impl object
* @return constexpr const std::shared_ptr<TensorImpl>& * @return constexpr const std::shared_ptr<TensorImpl>&
*/ */
constexpr const std::shared_ptr<TensorImpl> &getImpl() const { return mImpl; } constexpr const std::shared_ptr<TensorImpl>& getImpl() const noexcept { return mImpl; }
constexpr std::size_t getImplOffset() const { return mImplOffset; } constexpr std::size_t getImplOffset() const noexcept { return mImplOffset; }
/** /**
* @brief Set the Impl object * @brief Set the Impl object
......
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