Skip to content
Snippets Groups Projects
Commit 48cb9e53 authored by Sam Yates's avatar Sam Yates Committed by Benjamin Cumming
Browse files

Bugfix: a[i]=b[i] for memory::device_vector (#541)

* Perform device-to-device copy when device_reference is assigned a device_reference.
parent c1a58409
No related branches found
No related tags found
No related merge requests found
...@@ -80,6 +80,10 @@ public: ...@@ -80,6 +80,10 @@ public:
return *this; return *this;
} }
device_reference& operator=(const device_reference& ref) {
cuda_memcpy_d2d(pointer_, ref.pointer_, sizeof(T));
}
operator T() const { operator T() const {
T tmp; T tmp;
cuda_memcpy_d2h(&tmp, pointer_, sizeof(T)); cuda_memcpy_d2h(&tmp, pointer_, sizeof(T));
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment