summaryrefslogtreecommitdiffstats
path: root/parallel-libs/streamexecutor/lib/Executor.cpp
diff options
context:
space:
mode:
authorJason Henline <jhen@google.com>2016-08-16 18:18:32 +0000
committerJason Henline <jhen@google.com>2016-08-16 18:18:32 +0000
commita91dc70b18dd129761b66c1b76cbe64f54cd2eb1 (patch)
treedcf6d82e7fe839a990e720b231193ee7fc71066f /parallel-libs/streamexecutor/lib/Executor.cpp
parent1d01a793042d3d0566b009915529ab4559ea72a9 (diff)
downloadbcm5719-llvm-a91dc70b18dd129761b66c1b76cbe64f54cd2eb1.tar.gz
bcm5719-llvm-a91dc70b18dd129761b66c1b76cbe64f54cd2eb1.zip
[StreamExecutor] Rename StreamExecutor to Executor
Summary: No functional changes just renaming this class for better readability. Reviewers: jlebar Subscribers: jprice, parallel_libs-commits Differential Revision: https://reviews.llvm.org/D23574 llvm-svn: 278833
Diffstat (limited to 'parallel-libs/streamexecutor/lib/Executor.cpp')
-rw-r--r--parallel-libs/streamexecutor/lib/Executor.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/parallel-libs/streamexecutor/lib/Executor.cpp b/parallel-libs/streamexecutor/lib/Executor.cpp
new file mode 100644
index 00000000000..f103a76a4d9
--- /dev/null
+++ b/parallel-libs/streamexecutor/lib/Executor.cpp
@@ -0,0 +1,41 @@
+//===-- Executor.cpp - Executor implementation ----------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// Implementation of Executor class internals.
+///
+//===----------------------------------------------------------------------===//
+
+#include "streamexecutor/Executor.h"
+
+#include <cassert>
+
+#include "streamexecutor/PlatformInterfaces.h"
+#include "streamexecutor/Stream.h"
+
+#include "llvm/ADT/STLExtras.h"
+
+namespace streamexecutor {
+
+Executor::Executor(PlatformExecutor *PExecutor) : PExecutor(PExecutor) {}
+
+Executor::~Executor() = default;
+
+Expected<std::unique_ptr<Stream>> Executor::createStream() {
+ Expected<std::unique_ptr<PlatformStreamHandle>> MaybePlatformStream =
+ PExecutor->createStream();
+ if (!MaybePlatformStream) {
+ return MaybePlatformStream.takeError();
+ }
+ assert((*MaybePlatformStream)->getExecutor() == PExecutor &&
+ "an executor created a stream with a different stored executor");
+ return llvm::make_unique<Stream>(std::move(*MaybePlatformStream));
+}
+
+} // namespace streamexecutor
OpenPOWER on IntegriCloud