[SE] Rename PlatformInterfaces to PlatformDevice
authorJason Henline <jhen@google.com>
Tue, 6 Sep 2016 19:27:00 +0000 (19:27 +0000)
committerJason Henline <jhen@google.com>
Tue, 6 Sep 2016 19:27:00 +0000 (19:27 +0000)
Summary:
The only interface that we ever plan to have in this file is
PlatformDevice, so it makes sense to rename the file to reflect that.

Reviewers: jprice

Subscribers: parallel_libs-commits

Differential Revision: https://reviews.llvm.org/D24269

llvm-svn: 280737

parallel-libs/streamexecutor/include/streamexecutor/Device.h
parallel-libs/streamexecutor/include/streamexecutor/PlatformDevice.h [moved from parallel-libs/streamexecutor/include/streamexecutor/PlatformInterfaces.h with 88% similarity]
parallel-libs/streamexecutor/include/streamexecutor/Stream.h
parallel-libs/streamexecutor/lib/CMakeLists.txt
parallel-libs/streamexecutor/lib/Device.cpp
parallel-libs/streamexecutor/lib/Kernel.cpp
parallel-libs/streamexecutor/lib/PlatformDevice.cpp [moved from parallel-libs/streamexecutor/lib/PlatformInterfaces.cpp with 72% similarity]
parallel-libs/streamexecutor/lib/unittests/DeviceTest.cpp
parallel-libs/streamexecutor/lib/unittests/PackedKernelArgumentArrayTest.cpp
parallel-libs/streamexecutor/lib/unittests/SimpleHostPlatformDevice.h
parallel-libs/streamexecutor/lib/unittests/StreamTest.cpp

index 0ee2b2f..e431a45 100644 (file)
@@ -18,7 +18,7 @@
 #include <type_traits>
 
 #include "streamexecutor/KernelSpec.h"
-#include "streamexecutor/PlatformInterfaces.h"
+#include "streamexecutor/PlatformDevice.h"
 #include "streamexecutor/Utils/Error.h"
 
 namespace streamexecutor {
@@ -1,4 +1,4 @@
-//===-- PlatformInterfaces.h - Interfaces to platform impls -----*- C++ -*-===//
+//===-- PlatformDevice.h - PlatformDevice class -----------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,20 +8,16 @@
 //===----------------------------------------------------------------------===//
 ///
 /// \file
-/// Interfaces to platform-specific implementations.
+/// Declaration of the PlatformDevice class.
 ///
-/// The general pattern is that the functions in these interfaces take raw
-/// handle types as parameters. This means that these types and functions are
-/// not intended for public use. Instead, corresponding methods in public types
-/// like Stream, StreamExecutor, and Kernel use C++ templates to create
-/// type-safe public interfaces. Those public functions do the type-unsafe work
-/// of extracting raw handles from their arguments and forwarding those handles
-/// to the methods defined in this file in the proper format.
+/// Each specific platform such as CUDA or OpenCL must subclass PlatformDevice
+/// and override streamexecutor::Platform::getDevice to return an instance of
+/// their PlatformDevice subclass.
 ///
 //===----------------------------------------------------------------------===//
 
-#ifndef STREAMEXECUTOR_PLATFORMINTERFACES_H
-#define STREAMEXECUTOR_PLATFORMINTERFACES_H
+#ifndef STREAMEXECUTOR_PLATFORMDEVICE_H
+#define STREAMEXECUTOR_PLATFORMDEVICE_H
 
 #include "streamexecutor/DeviceMemory.h"
 #include "streamexecutor/Kernel.h"
@@ -33,9 +29,6 @@ namespace streamexecutor {
 
 /// Raw executor methods that must be implemented by each platform.
 ///
-/// This class defines the platform interface that supports executing work on a
-/// device.
-///
 /// The public Device and Stream classes have the type-safe versions of the
 /// functions in this interface.
 class PlatformDevice {
@@ -184,4 +177,4 @@ public:
 
 } // namespace streamexecutor
 
-#endif // STREAMEXECUTOR_PLATFORMINTERFACES_H
+#endif // STREAMEXECUTOR_PLATFORMDEVICE_H
index 48dcf32..ac57354 100644 (file)
@@ -38,7 +38,7 @@
 #include "streamexecutor/Kernel.h"
 #include "streamexecutor/LaunchDimensions.h"
 #include "streamexecutor/PackedKernelArgumentArray.h"
-#include "streamexecutor/PlatformInterfaces.h"
+#include "streamexecutor/PlatformDevice.h"
 #include "streamexecutor/Utils/Error.h"
 
 #include "llvm/ADT/Optional.h"
index 79ae5c7..8c3ac02 100644 (file)
@@ -12,7 +12,7 @@ add_library(
     KernelSpec.cpp
     PackedKernelArgumentArray.cpp
     Platform.cpp
-    PlatformInterfaces.cpp
+    PlatformDevice.cpp
     PlatformManager.cpp
     Stream.cpp)
 target_link_libraries(streamexecutor ${llvm_libs})
index 0d81fb7..260c1ba 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <cassert>
 
-#include "streamexecutor/PlatformInterfaces.h"
+#include "streamexecutor/PlatformDevice.h"
 #include "streamexecutor/Stream.h"
 
 #include "llvm/ADT/STLExtras.h"
index 6130537..55a8351 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "streamexecutor/Device.h"
 #include "streamexecutor/Kernel.h"
-#include "streamexecutor/PlatformInterfaces.h"
+#include "streamexecutor/PlatformDevice.h"
 
 #include "llvm/DebugInfo/Symbolize/Symbolize.h"
 
@@ -1,4 +1,4 @@
-//===-- PlatformInterfaces.cpp - Platform interface implementations -------===//
+//===-- PlatformDevice.cpp - Platform interface implementations -----------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,11 +8,11 @@
 //===----------------------------------------------------------------------===//
 ///
 /// \file
-/// Implementation file for PlatformInterfaces.h.
+/// Implementation file for PlatformDevice.h.
 ///
 //===----------------------------------------------------------------------===//
 
-#include "streamexecutor/PlatformInterfaces.h"
+#include "streamexecutor/PlatformDevice.h"
 
 namespace streamexecutor {
 
index 593f1d1..08f870d 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "SimpleHostPlatformDevice.h"
 #include "streamexecutor/Device.h"
-#include "streamexecutor/PlatformInterfaces.h"
+#include "streamexecutor/PlatformDevice.h"
 
 #include "gtest/gtest.h"
 
index 3fe2563..dd6d0e1 100644 (file)
@@ -16,7 +16,7 @@
 #include "streamexecutor/Device.h"
 #include "streamexecutor/DeviceMemory.h"
 #include "streamexecutor/PackedKernelArgumentArray.h"
-#include "streamexecutor/PlatformInterfaces.h"
+#include "streamexecutor/PlatformDevice.h"
 
 #include "llvm/ADT/Twine.h"
 
index b54b31d..5c59530 100644 (file)
@@ -20,7 +20,7 @@
 #include <cstdlib>
 #include <cstring>
 
-#include "streamexecutor/PlatformInterfaces.h"
+#include "streamexecutor/PlatformDevice.h"
 
 namespace streamexecutor {
 namespace test {
index 3a0f4e6..6559854 100644 (file)
@@ -18,7 +18,7 @@
 #include "streamexecutor/Device.h"
 #include "streamexecutor/Kernel.h"
 #include "streamexecutor/KernelSpec.h"
-#include "streamexecutor/PlatformInterfaces.h"
+#include "streamexecutor/PlatformDevice.h"
 #include "streamexecutor/Stream.h"
 
 #include "gtest/gtest.h"