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

Minor update to match core changes

parent 23d46d9e
No related branches found
No related tags found
No related merge requests found
...@@ -103,7 +103,7 @@ class TensorImpl_cpu : public TensorImpl { ...@@ -103,7 +103,7 @@ class TensorImpl_cpu : public TensorImpl {
copy(src, length); copy(src, length);
} }
void copyToHost(void *dst, NbElts_t length) override { void copyToHost(void *dst, NbElts_t length) const override {
const T* src = static_cast<const T*>(rawPtr()); const T* src = static_cast<const T*>(rawPtr());
std::copy(static_cast<const T *>(src), static_cast<const T *>(src) + length, std::copy(static_cast<const T *>(src), static_cast<const T *>(src) + length,
static_cast<T *>(dst)); static_cast<T *>(dst));
...@@ -114,11 +114,21 @@ class TensorImpl_cpu : public TensorImpl { ...@@ -114,11 +114,21 @@ class TensorImpl_cpu : public TensorImpl {
return mData.data(); return mData.data();
}; };
const void *rawPtr() const override {
AIDGE_ASSERT(mData.size() == mTensor.size(), "accessing uninitialized const rawPtr");
return mData.data();
};
void *hostPtr() override { void *hostPtr() override {
lazyInit(mData); lazyInit(mData);
return mData.data(); return mData.data();
}; };
const void *hostPtr() const override {
AIDGE_ASSERT(mData.size() == mTensor.size(), "accessing uninitialized const hostPtr");
return mData.data();
};
void* getRaw(std::size_t idx){ void* getRaw(std::size_t idx){
return static_cast<void*>(static_cast<T *>(rawPtr()) + idx); return static_cast<void*>(static_cast<T *>(rawPtr()) + idx);
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment