Files
clang-p2996/parallel-libs/streamexecutor/lib/Executor.cpp
Jason Henline a91dc70b18 [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
2016-08-16 18:18:32 +00:00

42 lines
1.3 KiB
C++

//===-- 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