clang 24.0.0git
DeviceOffload.h
Go to the documentation of this file.
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.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_LIB_INTERPRETER_DEVICE_OFFLOAD_H
14#define LLVM_CLANG_LIB_INTERPRETER_DEVICE_OFFLOAD_H
15
16#include "IncrementalParser.h"
17#include "llvm/Support/FileSystem.h"
18#include "llvm/Support/VirtualFileSystem.h"
19
20namespace clang {
23class CodeGenOptions;
24class TargetOptions;
26
28
29public:
31 CompilerInstance &DeviceInstance, CompilerInstance &HostInstance,
32 IncrementalAction *DeviceAct,
34 llvm::Error &Err, std::list<PartialTranslationUnit> &PTUs);
35
36 // Generate PTX for the last PTU.
38
39 // Generate fatbinary contents in memory
40 llvm::Error GenerateFatbinary();
41
43
44protected:
49 CodeGenOptions &CodeGenOpts; // Intentionally a reference.
51};
52
53} // namespace clang
54
55#endif // LLVM_CLANG_LIB_INTERPRETER_DEVICE_OFFLOAD_H
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
A custom action enabling the incremental processing functionality.
llvm::SmallVector< char, 1024 > FatbinContent
llvm::SmallString< 1024 > PTXCode
IncrementalCUDADeviceParser(CompilerInstance &DeviceInstance, CompilerInstance &HostInstance, IncrementalAction *DeviceAct, llvm::IntrusiveRefCntPtr< llvm::vfs::InMemoryFileSystem > VFS, llvm::Error &Err, std::list< PartialTranslationUnit > &PTUs)
llvm::IntrusiveRefCntPtr< llvm::vfs::InMemoryFileSystem > VFS
llvm::Expected< llvm::StringRef > GeneratePTX()
const TargetOptions & TargetOpts
IncrementalParser(CompilerInstance &Instance, IncrementalAction *Act, llvm::Error &Err, std::list< PartialTranslationUnit > &PTUs)
std::list< PartialTranslationUnit > & PTUs
Options for controlling the target.
Top level wrappers for InstallAPI frontend operations.
The class keeps track of various objects created as part of processing incremental inputs.