[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / lib / Interpreter / DeviceOffload.h
blobce4f218c94c79d90311ac10b936d9b4204a6663e
1 //===----------- DeviceOffload.h - Device Offloading ------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements classes required for offloading to CUDA devices.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_LIB_INTERPRETER_DEVICE_OFFLOAD_H
14 #define LLVM_CLANG_LIB_INTERPRETER_DEVICE_OFFLOAD_H
16 #include "IncrementalParser.h"
17 #include "llvm/Support/FileSystem.h"
18 #include "llvm/Support/VirtualFileSystem.h"
20 namespace clang {
22 class IncrementalCUDADeviceParser : public IncrementalParser {
23 public:
24 IncrementalCUDADeviceParser(
25 Interpreter &Interp, std::unique_ptr<CompilerInstance> Instance,
26 IncrementalParser &HostParser, llvm::LLVMContext &LLVMCtx,
27 llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> VFS,
28 llvm::Error &Err);
30 llvm::Expected<PartialTranslationUnit &>
31 Parse(llvm::StringRef Input) override;
33 // Generate PTX for the last PTU
34 llvm::Expected<llvm::StringRef> GeneratePTX();
36 // Generate fatbinary contents in memory
37 llvm::Error GenerateFatbinary();
39 ~IncrementalCUDADeviceParser();
41 protected:
42 IncrementalParser &HostParser;
43 int SMVersion;
44 llvm::SmallString<1024> PTXCode;
45 llvm::SmallVector<char, 1024> FatbinContent;
46 llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> VFS;
49 } // namespace clang
51 #endif // LLVM_CLANG_LIB_INTERPRETER_DEVICE_OFFLOAD_H