Skip to content
Snippets Groups Projects
Commit 4a725553 authored by Thibault Allenet's avatar Thibault Allenet
Browse files

Update TensorImpl constructor to take the tensor dimensions instead of the number of elements.

parent 3025e25c
No related branches found
No related tags found
No related merge requests found
...@@ -69,12 +69,13 @@ private: ...@@ -69,12 +69,13 @@ private:
public: public:
static constexpr const char *Backend = "cuda"; static constexpr const char *Backend = "cuda";
TensorImpl_cuda(DeviceIdx_t device, NbElts_t length) : TensorImpl(Backend, device, length), mDataOwner(nullptr, cudaDelete) {} TensorImpl_cuda(DeviceIdx_t device, std::vector<DimSize_t> dims) : TensorImpl(Backend, device, dims), mDataOwner(nullptr, cudaDelete) {}
bool operator==(const TensorImpl &otherImpl) const override final; bool operator==(const TensorImpl &otherImpl) const override final;
static std::shared_ptr<TensorImpl_cuda> create(DeviceIdx_t device, NbElts_t length) { static std::shared_ptr<TensorImpl_cuda> create(DeviceIdx_t device, std::vector<DimSize_t> dims) {
return std::make_shared<TensorImpl_cuda<T>>(device, length); return std::make_shared<TensorImpl_cuda<T>>(device, dims);
} }
// native interface // native interface
......
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