Summary: The .clang-tidy file is copied from the top-level LLVM source directory. Also fix warnings generated by clang-format: * Moved SimpleHostPlatformDevice.h so its header include guard could have the right format. * Changed signatures of methods taking llvm::Twine by value to take it by const ref instead. * Add "noexcept" to some move constructors and assignment operators. * Removed a bunch of places where single-statement loops and conditionals were surrounded with braces. (This was not found by the current clang-tidy, but with a local patch that I hope to upstream soon.) Reviewers: jlebar, jprice Subscribers: parallel_libs-commits Differential Revision: https://reviews.llvm.org/D24468 llvm-svn: 281374
38 lines
1.0 KiB
C++
38 lines
1.0 KiB
C++
//===-- Device.cpp - Device 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 Device class internals.
|
|
///
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "streamexecutor/Device.h"
|
|
|
|
#include <cassert>
|
|
|
|
#include "streamexecutor/PlatformDevice.h"
|
|
#include "streamexecutor/Stream.h"
|
|
|
|
#include "llvm/ADT/STLExtras.h"
|
|
|
|
namespace streamexecutor {
|
|
|
|
Device::Device(PlatformDevice *PDevice) : PDevice(PDevice) {}
|
|
|
|
Device::~Device() = default;
|
|
|
|
Expected<Stream> Device::createStream() {
|
|
Expected<const void *> MaybePlatformStream = PDevice->createStream();
|
|
if (!MaybePlatformStream)
|
|
return MaybePlatformStream.takeError();
|
|
return Stream(PDevice, *MaybePlatformStream);
|
|
}
|
|
|
|
} // namespace streamexecutor
|