blob: 8ced35d20663f9f722268c6b48de363391928634 [file] [log] [blame]
//===-- Platform.h - The Platform class -------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// The Platform class which represents a platform such as CUDA or OpenCL.
///
/// This is an abstract base class that will be overridden by each specific
/// platform.
///
//===----------------------------------------------------------------------===//
#ifndef STREAMEXECUTOR_PLATFORM_H
#define STREAMEXECUTOR_PLATFORM_H
#include "streamexecutor/Error.h"
namespace streamexecutor {
class Device;
class Platform {
public:
virtual ~Platform();
/// Gets the number of devices available for this platform.
virtual size_t getDeviceCount() const = 0;
/// Gets a Device with the given index for this platform.
virtual Expected<Device> getDevice(size_t DeviceIndex) = 0;
};
} // namespace streamexecutor
#endif // STREAMEXECUTOR_PLATFORM_H