summaryrefslogtreecommitdiffstats
path: root/parallel-libs/streamexecutor/lib
diff options
context:
space:
mode:
Diffstat (limited to 'parallel-libs/streamexecutor/lib')
-rw-r--r--parallel-libs/streamexecutor/lib/Device.cpp4
-rw-r--r--parallel-libs/streamexecutor/lib/Stream.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/parallel-libs/streamexecutor/lib/Device.cpp b/parallel-libs/streamexecutor/lib/Device.cpp
index 4a5ec11997d..54f03849c68 100644
--- a/parallel-libs/streamexecutor/lib/Device.cpp
+++ b/parallel-libs/streamexecutor/lib/Device.cpp
@@ -27,7 +27,7 @@ Device::Device(PlatformDevice *PDevice) : PDevice(PDevice) {}
Device::~Device() = default;
-Expected<std::unique_ptr<Stream>> Device::createStream() {
+Expected<Stream> Device::createStream() {
Expected<std::unique_ptr<PlatformStreamHandle>> MaybePlatformStream =
PDevice->createStream();
if (!MaybePlatformStream) {
@@ -35,7 +35,7 @@ Expected<std::unique_ptr<Stream>> Device::createStream() {
}
assert((*MaybePlatformStream)->getDevice() == PDevice &&
"an executor created a stream with a different stored executor");
- return llvm::make_unique<Stream>(std::move(*MaybePlatformStream));
+ return Stream(std::move(*MaybePlatformStream));
}
} // namespace streamexecutor
diff --git a/parallel-libs/streamexecutor/lib/Stream.cpp b/parallel-libs/streamexecutor/lib/Stream.cpp
index 20a817c2715..e1fca58cc19 100644
--- a/parallel-libs/streamexecutor/lib/Stream.cpp
+++ b/parallel-libs/streamexecutor/lib/Stream.cpp
@@ -17,7 +17,8 @@
namespace streamexecutor {
Stream::Stream(std::unique_ptr<PlatformStreamHandle> PStream)
- : PDevice(PStream->getDevice()), ThePlatformStream(std::move(PStream)) {}
+ : PDevice(PStream->getDevice()), ThePlatformStream(std::move(PStream)),
+ ErrorMessageMutex(llvm::make_unique<llvm::sys::RWMutex>()) {}
Stream::~Stream() = default;
OpenPOWER on IntegriCloud