#include <type_traits>
#include "streamexecutor/KernelSpec.h"
-#include "streamexecutor/PlatformInterfaces.h"
+#include "streamexecutor/PlatformDevice.h"
#include "streamexecutor/Utils/Error.h"
namespace streamexecutor {
-//===-- PlatformInterfaces.h - Interfaces to platform impls -----*- C++ -*-===//
+//===-- PlatformDevice.h - PlatformDevice class -----------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
//===----------------------------------------------------------------------===//
///
/// \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"
/// 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 {
} // namespace streamexecutor
-#endif // STREAMEXECUTOR_PLATFORMINTERFACES_H
+#endif // STREAMEXECUTOR_PLATFORMDEVICE_H
#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"
KernelSpec.cpp
PackedKernelArgumentArray.cpp
Platform.cpp
- PlatformInterfaces.cpp
+ PlatformDevice.cpp
PlatformManager.cpp
Stream.cpp)
target_link_libraries(streamexecutor ${llvm_libs})
#include <cassert>
-#include "streamexecutor/PlatformInterfaces.h"
+#include "streamexecutor/PlatformDevice.h"
#include "streamexecutor/Stream.h"
#include "llvm/ADT/STLExtras.h"
#include "streamexecutor/Device.h"
#include "streamexecutor/Kernel.h"
-#include "streamexecutor/PlatformInterfaces.h"
+#include "streamexecutor/PlatformDevice.h"
#include "llvm/DebugInfo/Symbolize/Symbolize.h"
-//===-- PlatformInterfaces.cpp - Platform interface implementations -------===//
+//===-- PlatformDevice.cpp - Platform interface implementations -----------===//
//
// The LLVM Compiler Infrastructure
//
//===----------------------------------------------------------------------===//
///
/// \file
-/// Implementation file for PlatformInterfaces.h.
+/// Implementation file for PlatformDevice.h.
///
//===----------------------------------------------------------------------===//
-#include "streamexecutor/PlatformInterfaces.h"
+#include "streamexecutor/PlatformDevice.h"
namespace streamexecutor {
#include "SimpleHostPlatformDevice.h"
#include "streamexecutor/Device.h"
-#include "streamexecutor/PlatformInterfaces.h"
+#include "streamexecutor/PlatformDevice.h"
#include "gtest/gtest.h"
#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"
#include <cstdlib>
#include <cstring>
-#include "streamexecutor/PlatformInterfaces.h"
+#include "streamexecutor/PlatformDevice.h"
namespace streamexecutor {
namespace test {
#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"