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 | |
| 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')
| -rw-r--r-- | parallel-libs/streamexecutor/examples/CUDASaxpy.cpp | 14 | ||||
| -rw-r--r-- | parallel-libs/streamexecutor/examples/HostSaxpy.cpp | 14 | 
2 files changed, 14 insertions, 14 deletions
| diff --git a/parallel-libs/streamexecutor/examples/CUDASaxpy.cpp b/parallel-libs/streamexecutor/examples/CUDASaxpy.cpp index 0fce5ed046b..6b2c59e5cd6 100644 --- a/parallel-libs/streamexecutor/examples/CUDASaxpy.cpp +++ b/parallel-libs/streamexecutor/examples/CUDASaxpy.cpp @@ -108,25 +108,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(ArraySize, 1, Kernel, A, X, Y) 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) | 

