[SE] Make Stream movable

Summary:
The example code makes it clear that this is a much better design
decision.

Reviewers: jlebar

Subscribers: jprice, parallel_libs-commits

Differential Revision: https://reviews.llvm.org/D24142

llvm-svn: 280397
This commit is contained in:
Jason Henline
2016-09-01 18:35:37 +00:00
parent 22d36c167e
commit e9a12f1175
5 changed files with 17 additions and 14 deletions

View File

@@ -121,13 +121,13 @@ int main() {
getOrDie(Device->allocateDeviceMemory<float>(ArraySize));
// Run operations on a stream.
std::unique_ptr<se::Stream> Stream = getOrDie(Device->createStream());
Stream->thenCopyH2D<float>(HostX, X)
se::Stream Stream = getOrDie(Device->createStream());
Stream.thenCopyH2D<float>(HostX, X)
.thenCopyH2D<float>(HostY, Y)
.thenLaunch(ArraySize, 1, *Kernel, A, X, Y)
.thenCopyD2H<float>(X, HostX);
// Wait for the stream to complete.
se::dieIfError(Stream->blockHostUntilDone());
se::dieIfError(Stream.blockHostUntilDone());
// Process output data in HostX.
std::vector<float> ExpectedX = {4, 47, 90, 133};