summaryrefslogtreecommitdiffstats
path: root/parallel-libs/streamexecutor/lib
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
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')
-rw-r--r--parallel-libs/streamexecutor/lib/CMakeLists.txt4
-rw-r--r--parallel-libs/streamexecutor/lib/Executor.cpp (renamed from parallel-libs/streamexecutor/lib/StreamExecutor.cpp)17
-rw-r--r--parallel-libs/streamexecutor/lib/Kernel.cpp6
-rw-r--r--parallel-libs/streamexecutor/lib/PlatformInterfaces.cpp2
-rw-r--r--parallel-libs/streamexecutor/lib/Stream.cpp4
-rw-r--r--parallel-libs/streamexecutor/lib/unittests/KernelTest.cpp18
-rw-r--r--parallel-libs/streamexecutor/lib/unittests/StreamTest.cpp15
7 files changed, 32 insertions, 34 deletions
diff --git a/parallel-libs/streamexecutor/lib/CMakeLists.txt b/parallel-libs/streamexecutor/lib/CMakeLists.txt
index b7f7c278b18..7f5cb201956 100644
--- a/parallel-libs/streamexecutor/lib/CMakeLists.txt
+++ b/parallel-libs/streamexecutor/lib/CMakeLists.txt
@@ -6,12 +6,12 @@ add_library(
add_library(
streamexecutor
$<TARGET_OBJECTS:utils>
+ Executor.cpp
Kernel.cpp
KernelSpec.cpp
PackedKernelArgumentArray.cpp
PlatformInterfaces.cpp
- Stream.cpp
- StreamExecutor.cpp)
+ Stream.cpp)
target_link_libraries(streamexecutor ${llvm_libs})
if(STREAM_EXECUTOR_UNIT_TESTS)
diff --git a/parallel-libs/streamexecutor/lib/StreamExecutor.cpp b/parallel-libs/streamexecutor/lib/Executor.cpp
index 33e7096f51d..f103a76a4d9 100644
--- a/parallel-libs/streamexecutor/lib/StreamExecutor.cpp
+++ b/parallel-libs/streamexecutor/lib/Executor.cpp
@@ -1,4 +1,4 @@
-//===-- StreamExecutor.cpp - StreamExecutor implementation ----------------===//
+//===-- Executor.cpp - Executor implementation ----------------------------===//
//
// The LLVM Compiler Infrastructure
//
@@ -8,11 +8,11 @@
//===----------------------------------------------------------------------===//
///
/// \file
-/// Implementation of StreamExecutor class internals.
+/// Implementation of Executor class internals.
///
//===----------------------------------------------------------------------===//
-#include "streamexecutor/StreamExecutor.h"
+#include "streamexecutor/Executor.h"
#include <cassert>
@@ -23,18 +23,17 @@
namespace streamexecutor {
-StreamExecutor::StreamExecutor(PlatformStreamExecutor *PlatformExecutor)
- : PlatformExecutor(PlatformExecutor) {}
+Executor::Executor(PlatformExecutor *PExecutor) : PExecutor(PExecutor) {}
-StreamExecutor::~StreamExecutor() = default;
+Executor::~Executor() = default;
-Expected<std::unique_ptr<Stream>> StreamExecutor::createStream() {
+Expected<std::unique_ptr<Stream>> Executor::createStream() {
Expected<std::unique_ptr<PlatformStreamHandle>> MaybePlatformStream =
- PlatformExecutor->createStream();
+ PExecutor->createStream();
if (!MaybePlatformStream) {
return MaybePlatformStream.takeError();
}
- assert((*MaybePlatformStream)->getExecutor() == PlatformExecutor &&
+ assert((*MaybePlatformStream)->getExecutor() == PExecutor &&
"an executor created a stream with a different stored executor");
return llvm::make_unique<Stream>(std::move(*MaybePlatformStream));
}
diff --git a/parallel-libs/streamexecutor/lib/Kernel.cpp b/parallel-libs/streamexecutor/lib/Kernel.cpp
index 3c3ec20674f..9e99e91ef91 100644
--- a/parallel-libs/streamexecutor/lib/Kernel.cpp
+++ b/parallel-libs/streamexecutor/lib/Kernel.cpp
@@ -13,14 +13,14 @@
//===----------------------------------------------------------------------===//
#include "streamexecutor/Kernel.h"
+#include "streamexecutor/Executor.h"
#include "streamexecutor/PlatformInterfaces.h"
-#include "streamexecutor/StreamExecutor.h"
#include "llvm/DebugInfo/Symbolize/Symbolize.h"
namespace streamexecutor {
-KernelBase::KernelBase(StreamExecutor *ParentExecutor, const std::string &Name,
+KernelBase::KernelBase(Executor *ParentExecutor, const std::string &Name,
const std::string &DemangledName,
std::unique_ptr<KernelInterface> Implementation)
: ParentExecutor(ParentExecutor), Name(Name), DemangledName(DemangledName),
@@ -28,7 +28,7 @@ KernelBase::KernelBase(StreamExecutor *ParentExecutor, const std::string &Name,
KernelBase::~KernelBase() = default;
-Expected<KernelBase> KernelBase::create(StreamExecutor *ParentExecutor,
+Expected<KernelBase> KernelBase::create(Executor *ParentExecutor,
const MultiKernelLoaderSpec &Spec) {
auto MaybeImplementation = ParentExecutor->getKernelImplementation(Spec);
if (!MaybeImplementation) {
diff --git a/parallel-libs/streamexecutor/lib/PlatformInterfaces.cpp b/parallel-libs/streamexecutor/lib/PlatformInterfaces.cpp
index 527c0a934bd..e0ae644e548 100644
--- a/parallel-libs/streamexecutor/lib/PlatformInterfaces.cpp
+++ b/parallel-libs/streamexecutor/lib/PlatformInterfaces.cpp
@@ -18,6 +18,6 @@ namespace streamexecutor {
PlatformStreamHandle::~PlatformStreamHandle() = default;
-PlatformStreamExecutor::~PlatformStreamExecutor() = default;
+PlatformExecutor::~PlatformExecutor() = default;
} // namespace streamexecutor
diff --git a/parallel-libs/streamexecutor/lib/Stream.cpp b/parallel-libs/streamexecutor/lib/Stream.cpp
index adfef5fbbe1..40f52f9b63d 100644
--- a/parallel-libs/streamexecutor/lib/Stream.cpp
+++ b/parallel-libs/streamexecutor/lib/Stream.cpp
@@ -17,8 +17,8 @@
namespace streamexecutor {
Stream::Stream(std::unique_ptr<PlatformStreamHandle> PStream)
- : PlatformExecutor(PStream->getExecutor()),
- ThePlatformStream(std::move(PStream)) {}
+ : PExecutor(PStream->getExecutor()), ThePlatformStream(std::move(PStream)) {
+}
Stream::~Stream() = default;
diff --git a/parallel-libs/streamexecutor/lib/unittests/KernelTest.cpp b/parallel-libs/streamexecutor/lib/unittests/KernelTest.cpp
index 9974e994023..b5ee8a0cbfc 100644
--- a/parallel-libs/streamexecutor/lib/unittests/KernelTest.cpp
+++ b/parallel-libs/streamexecutor/lib/unittests/KernelTest.cpp
@@ -14,10 +14,10 @@
#include <cassert>
+#include "streamexecutor/Executor.h"
#include "streamexecutor/Kernel.h"
#include "streamexecutor/KernelSpec.h"
#include "streamexecutor/PlatformInterfaces.h"
-#include "streamexecutor/StreamExecutor.h"
#include "llvm/ADT/STLExtras.h"
@@ -27,7 +27,7 @@ namespace {
namespace se = ::streamexecutor;
-// A StreamExecutor that returns a dummy KernelInterface.
+// An Executor that returns a dummy KernelInterface.
//
// During construction it creates a unique_ptr to a dummy KernelInterface and it
// also stores a separate copy of the raw pointer that is stored by that
@@ -39,11 +39,11 @@ namespace se = ::streamexecutor;
// object. The raw pointer copy can then be used to identify the unique_ptr in
// its new location (by comparing the raw pointer with unique_ptr::get), to
// verify that the unique_ptr ended up where it was supposed to be.
-class MockStreamExecutor : public se::StreamExecutor {
+class MockExecutor : public se::Executor {
public:
- MockStreamExecutor()
- : se::StreamExecutor(nullptr),
- Unique(llvm::make_unique<se::KernelInterface>()), Raw(Unique.get()) {}
+ MockExecutor()
+ : se::Executor(nullptr), Unique(llvm::make_unique<se::KernelInterface>()),
+ Raw(Unique.get()) {}
// Moves the unique pointer into the returned se::Expected instance.
//
@@ -51,7 +51,7 @@ public:
// out.
se::Expected<std::unique_ptr<se::KernelInterface>>
getKernelImplementation(const se::MultiKernelLoaderSpec &) override {
- assert(Unique && "MockStreamExecutor getKernelImplementation should not be "
+ assert(Unique && "MockExecutor getKernelImplementation should not be "
"called more than once");
return std::move(Unique);
}
@@ -79,10 +79,10 @@ TYPED_TEST_CASE(GetImplementationTest, GetImplementationTypes);
// Tests that the kernel create functions properly fetch the implementation
// pointers for the kernel objects they construct from the passed-in
-// StreamExecutor objects.
+// Executor objects.
TYPED_TEST(GetImplementationTest, SetImplementationDuringCreate) {
se::MultiKernelLoaderSpec Spec;
- MockStreamExecutor MockExecutor;
+ MockExecutor MockExecutor;
auto MaybeKernel = TypeParam::create(&MockExecutor, Spec);
EXPECT_TRUE(static_cast<bool>(MaybeKernel));
diff --git a/parallel-libs/streamexecutor/lib/unittests/StreamTest.cpp b/parallel-libs/streamexecutor/lib/unittests/StreamTest.cpp
index 3d7128720cf..6ef21833108 100644
--- a/parallel-libs/streamexecutor/lib/unittests/StreamTest.cpp
+++ b/parallel-libs/streamexecutor/lib/unittests/StreamTest.cpp
@@ -14,11 +14,11 @@
#include <cstring>
+#include "streamexecutor/Executor.h"
#include "streamexecutor/Kernel.h"
#include "streamexecutor/KernelSpec.h"
#include "streamexecutor/PlatformInterfaces.h"
#include "streamexecutor/Stream.h"
-#include "streamexecutor/StreamExecutor.h"
#include "gtest/gtest.h"
@@ -26,14 +26,14 @@ namespace {
namespace se = ::streamexecutor;
-/// Mock PlatformStreamExecutor that performs asynchronous memcpy operations by
+/// Mock PlatformExecutor that performs asynchronous memcpy operations by
/// ignoring the stream argument and calling std::memcpy on device memory
/// handles.
-class MockPlatformStreamExecutor : public se::PlatformStreamExecutor {
+class MockPlatformExecutor : public se::PlatformExecutor {
public:
- ~MockPlatformStreamExecutor() override {}
+ ~MockPlatformExecutor() override {}
- std::string getName() const override { return "MockPlatformStreamExecutor"; }
+ std::string getName() const override { return "MockPlatformExecutor"; }
se::Expected<std::unique_ptr<se::PlatformStreamHandle>>
createStream() override {
@@ -70,8 +70,7 @@ public:
StreamTest()
: DeviceA(se::GlobalDeviceMemory<int>::makeFromElementCount(HostA, 10)),
DeviceB(se::GlobalDeviceMemory<int>::makeFromElementCount(HostB, 10)),
- Stream(llvm::make_unique<se::PlatformStreamHandle>(&PlatformExecutor)) {
- }
+ Stream(llvm::make_unique<se::PlatformStreamHandle>(&PExecutor)) {}
protected:
// Device memory is backed by host arrays.
@@ -83,7 +82,7 @@ protected:
// Host memory to be used as actual host memory.
int Host[10];
- MockPlatformStreamExecutor PlatformExecutor;
+ MockPlatformExecutor PExecutor;
se::Stream Stream;
};
OpenPOWER on IntegriCloud