Index: parallel-libs/trunk/streamexecutor/include/streamexecutor/Device.h =================================================================== --- parallel-libs/trunk/streamexecutor/include/streamexecutor/Device.h +++ parallel-libs/trunk/streamexecutor/include/streamexecutor/Device.h @@ -161,19 +161,19 @@ } template - Error synchronousCopyD2H(GlobalDeviceMemory Src, + Error synchronousCopyD2H(const GlobalDeviceMemory &Src, llvm::MutableArrayRef Dst, size_t ElementCount) { return synchronousCopyD2H(Src.asSlice(), Dst, ElementCount); } template - Error synchronousCopyD2H(GlobalDeviceMemory Src, + Error synchronousCopyD2H(const GlobalDeviceMemory &Src, llvm::MutableArrayRef Dst) { return synchronousCopyD2H(Src.asSlice(), Dst); } template - Error synchronousCopyD2H(GlobalDeviceMemory Src, T *Dst, + Error synchronousCopyD2H(const GlobalDeviceMemory &Src, T *Dst, size_t ElementCount) { return synchronousCopyD2H(Src.asSlice(), Dst, ElementCount); } @@ -216,18 +216,18 @@ } template - Error synchronousCopyH2D(llvm::ArrayRef Src, GlobalDeviceMemory Dst, + Error synchronousCopyH2D(llvm::ArrayRef Src, GlobalDeviceMemory &Dst, size_t ElementCount) { return synchronousCopyH2D(Src, Dst.asSlice(), ElementCount); } template - Error synchronousCopyH2D(llvm::ArrayRef Src, GlobalDeviceMemory Dst) { + Error synchronousCopyH2D(llvm::ArrayRef Src, GlobalDeviceMemory &Dst) { return synchronousCopyH2D(Src, Dst.asSlice()); } template - Error synchronousCopyH2D(T *Src, GlobalDeviceMemory Dst, + Error synchronousCopyH2D(T *Src, GlobalDeviceMemory &Dst, size_t ElementCount) { return synchronousCopyH2D(Src, Dst.asSlice(), ElementCount); } @@ -265,39 +265,39 @@ } template - Error synchronousCopyD2D(GlobalDeviceMemory Src, + Error synchronousCopyD2D(const GlobalDeviceMemory &Src, GlobalDeviceMemorySlice Dst, size_t ElementCount) { return synchronousCopyD2D(Src.asSlice(), Dst, ElementCount); } template - Error synchronousCopyD2D(GlobalDeviceMemory Src, + Error synchronousCopyD2D(const GlobalDeviceMemory &Src, GlobalDeviceMemorySlice Dst) { return synchronousCopyD2D(Src.asSlice(), Dst); } template Error synchronousCopyD2D(GlobalDeviceMemorySlice Src, - GlobalDeviceMemory Dst, size_t ElementCount) { + GlobalDeviceMemory &Dst, size_t ElementCount) { return synchronousCopyD2D(Src, Dst.asSlice(), ElementCount); } template Error synchronousCopyD2D(GlobalDeviceMemorySlice Src, - GlobalDeviceMemory Dst) { + GlobalDeviceMemory &Dst) { return synchronousCopyD2D(Src, Dst.asSlice()); } template - Error synchronousCopyD2D(GlobalDeviceMemory Src, GlobalDeviceMemory Dst, - size_t ElementCount) { + Error synchronousCopyD2D(const GlobalDeviceMemory &Src, + GlobalDeviceMemory &Dst, size_t ElementCount) { return synchronousCopyD2D(Src.asSlice(), Dst.asSlice(), ElementCount); } template - Error synchronousCopyD2D(GlobalDeviceMemory Src, - GlobalDeviceMemory Dst) { + Error synchronousCopyD2D(const GlobalDeviceMemory &Src, + GlobalDeviceMemory &Dst) { return synchronousCopyD2D(Src.asSlice(), Dst.asSlice()); } Index: parallel-libs/trunk/streamexecutor/include/streamexecutor/DeviceMemory.h =================================================================== --- parallel-libs/trunk/streamexecutor/include/streamexecutor/DeviceMemory.h +++ parallel-libs/trunk/streamexecutor/include/streamexecutor/DeviceMemory.h @@ -192,7 +192,7 @@ size_t getElementCount() const { return getByteCount() / sizeof(ElemT); } /// Converts this memory object into a slice. - GlobalDeviceMemorySlice asSlice() { + GlobalDeviceMemorySlice asSlice() const { return GlobalDeviceMemorySlice(*this); } Index: parallel-libs/trunk/streamexecutor/include/streamexecutor/Stream.h =================================================================== --- parallel-libs/trunk/streamexecutor/include/streamexecutor/Stream.h +++ parallel-libs/trunk/streamexecutor/include/streamexecutor/Stream.h @@ -164,20 +164,22 @@ } template - Stream &thenCopyD2H(GlobalDeviceMemory Src, llvm::MutableArrayRef Dst, - size_t ElementCount) { + Stream &thenCopyD2H(const GlobalDeviceMemory &Src, + llvm::MutableArrayRef Dst, size_t ElementCount) { thenCopyD2H(Src.asSlice(), Dst, ElementCount); return *this; } template - Stream &thenCopyD2H(GlobalDeviceMemory Src, llvm::MutableArrayRef Dst) { + Stream &thenCopyD2H(const GlobalDeviceMemory &Src, + llvm::MutableArrayRef Dst) { thenCopyD2H(Src.asSlice(), Dst); return *this; } template - Stream &thenCopyD2H(GlobalDeviceMemory Src, T *Dst, size_t ElementCount) { + Stream &thenCopyD2H(const GlobalDeviceMemory &Src, T *Dst, + size_t ElementCount) { thenCopyD2H(Src.asSlice(), Dst, ElementCount); return *this; } @@ -221,20 +223,20 @@ } template - Stream &thenCopyH2D(llvm::ArrayRef Src, GlobalDeviceMemory Dst, + Stream &thenCopyH2D(llvm::ArrayRef Src, GlobalDeviceMemory &Dst, size_t ElementCount) { thenCopyH2D(Src, Dst.asSlice(), ElementCount); return *this; } template - Stream &thenCopyH2D(llvm::ArrayRef Src, GlobalDeviceMemory Dst) { + Stream &thenCopyH2D(llvm::ArrayRef Src, GlobalDeviceMemory &Dst) { thenCopyH2D(Src, Dst.asSlice()); return *this; } template - Stream &thenCopyH2D(T *Src, GlobalDeviceMemory Dst, size_t ElementCount) { + Stream &thenCopyH2D(T *Src, GlobalDeviceMemory &Dst, size_t ElementCount) { thenCopyH2D(Src, Dst.asSlice(), ElementCount); return *this; } @@ -272,42 +274,43 @@ } template - Stream &thenCopyD2D(GlobalDeviceMemory Src, GlobalDeviceMemorySlice Dst, - size_t ElementCount) { + Stream &thenCopyD2D(const GlobalDeviceMemory &Src, + GlobalDeviceMemorySlice Dst, size_t ElementCount) { thenCopyD2D(Src.asSlice(), Dst, ElementCount); return *this; } template - Stream &thenCopyD2D(GlobalDeviceMemory Src, + Stream &thenCopyD2D(const GlobalDeviceMemory &Src, GlobalDeviceMemorySlice Dst) { thenCopyD2D(Src.asSlice(), Dst); return *this; } template - Stream &thenCopyD2D(GlobalDeviceMemorySlice Src, GlobalDeviceMemory Dst, - size_t ElementCount) { + Stream &thenCopyD2D(GlobalDeviceMemorySlice Src, + GlobalDeviceMemory &Dst, size_t ElementCount) { thenCopyD2D(Src, Dst.asSlice(), ElementCount); return *this; } template Stream &thenCopyD2D(GlobalDeviceMemorySlice Src, - GlobalDeviceMemory Dst) { + GlobalDeviceMemory &Dst) { thenCopyD2D(Src, Dst.asSlice()); return *this; } template - Stream &thenCopyD2D(GlobalDeviceMemory Src, GlobalDeviceMemory Dst, - size_t ElementCount) { + Stream &thenCopyD2D(const GlobalDeviceMemory &Src, + GlobalDeviceMemory &Dst, size_t ElementCount) { thenCopyD2D(Src.asSlice(), Dst.asSlice(), ElementCount); return *this; } template - Stream &thenCopyD2D(GlobalDeviceMemory Src, GlobalDeviceMemory Dst) { + Stream &thenCopyD2D(const GlobalDeviceMemory &Src, + GlobalDeviceMemory &Dst) { thenCopyD2D(Src.asSlice(), Dst.asSlice()); return *this; }