diff options
| author | Jason Henline <jhen@google.com> | 2016-09-13 23:56:46 +0000 |
|---|---|---|
| committer | Jason Henline <jhen@google.com> | 2016-09-13 23:56:46 +0000 |
| commit | 16a5352121a39ce09cfc2dbaa4598207ffa0740c (patch) | |
| tree | 12bbb4840eed711122666423d700d9cbed1f85c2 /parallel-libs/streamexecutor/examples/HostSaxpy.cpp | |
| parent | 6d5a29489a7d3e323cd127f1ee4566b3ebd9f6c7 (diff) | |
| download | bcm5719-llvm-16a5352121a39ce09cfc2dbaa4598207ffa0740c.tar.gz bcm5719-llvm-16a5352121a39ce09cfc2dbaa4598207ffa0740c.zip | |
[SE] Platforms return Device values
Summary:
Platforms were returning Device pointers, but a Device is now basically
just a pointer to an underlying PlatformDevice, so we will now just pass
it around as a value.
Reviewers: jlebar
Subscribers: jprice, jlebar, parallel_libs-commits
Differential Revision: https://reviews.llvm.org/D24537
llvm-svn: 281422
Diffstat (limited to 'parallel-libs/streamexecutor/examples/HostSaxpy.cpp')
| -rw-r--r-- | parallel-libs/streamexecutor/examples/HostSaxpy.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/parallel-libs/streamexecutor/examples/HostSaxpy.cpp b/parallel-libs/streamexecutor/examples/HostSaxpy.cpp index 525c4453b01..5bcbcc898ce 100644 --- a/parallel-libs/streamexecutor/examples/HostSaxpy.cpp +++ b/parallel-libs/streamexecutor/examples/HostSaxpy.cpp @@ -62,25 +62,25 @@ int main() { if (Platform->getDeviceCount() == 0) { return EXIT_FAILURE; } - se::Device *Device = getOrDie(Platform->getDevice(0)); + se::Device Device = getOrDie(Platform->getDevice(0)); // Load the kernel onto the device. cg::SaxpyKernel Kernel = - getOrDie(Device->createKernel<cg::SaxpyKernel>(cg::SaxpyLoaderSpec)); + getOrDie(Device.createKernel<cg::SaxpyKernel>(cg::SaxpyLoaderSpec)); se::RegisteredHostMemory<float> RegisteredX = - getOrDie(Device->registerHostMemory<float>(HostX)); + getOrDie(Device.registerHostMemory<float>(HostX)); se::RegisteredHostMemory<float> RegisteredY = - getOrDie(Device->registerHostMemory<float>(HostY)); + getOrDie(Device.registerHostMemory<float>(HostY)); // Allocate memory on the device. se::GlobalDeviceMemory<float> X = - getOrDie(Device->allocateDeviceMemory<float>(ArraySize)); + getOrDie(Device.allocateDeviceMemory<float>(ArraySize)); se::GlobalDeviceMemory<float> Y = - getOrDie(Device->allocateDeviceMemory<float>(ArraySize)); + getOrDie(Device.allocateDeviceMemory<float>(ArraySize)); // Run operations on a stream. - se::Stream Stream = getOrDie(Device->createStream()); + se::Stream Stream = getOrDie(Device.createStream()); Stream.thenCopyH2D(RegisteredX, X) .thenCopyH2D(RegisteredY, Y) .thenLaunch(1, 1, Kernel, A, X, Y, ArraySize) |

