LLVM 22.0.0git
OffloadWrapper.h
Go to the documentation of this file.
1//===- OffloadWrapper.h --r-------------------------------------*- 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#ifndef LLVM_FRONTEND_OFFLOADING_OFFLOADWRAPPER_H
10#define LLVM_FRONTEND_OFFLOADING_OFFLOADWRAPPER_H
11
12#include "llvm/ADT/ArrayRef.h"
13#include "llvm/IR/Module.h"
15
16namespace llvm {
17namespace offloading {
18using EntryArrayTy = std::pair<GlobalVariable *, GlobalVariable *>;
19/// Wraps the input device images into the module \p M as global symbols and
20/// registers the images with the OpenMP Offloading runtime libomptarget.
21/// \param EntryArray Optional pair pointing to the `__start` and `__stop`
22/// symbols holding the `__tgt_offload_entry` array.
23/// \param Suffix An optional suffix appended to the emitted symbols.
24/// \param Relocatable Indicate if we need to change the offloading section to
25/// create a relocatable object.
28 EntryArrayTy EntryArray, llvm::StringRef Suffix = "",
29 bool Relocatable = false);
30
31/// Wraps the input fatbinary image into the module \p M as global symbols and
32/// registers the images with the CUDA runtime.
33/// \param EntryArray Optional pair pointing to the `__start` and `__stop`
34/// symbols holding the `__tgt_offload_entry` array.
35/// \param Suffix An optional suffix appended to the emitted symbols.
36/// \param EmitSurfacesAndTextures Whether to emit surface and textures
37/// registration code. It defaults to false.
40 EntryArrayTy EntryArray,
41 llvm::StringRef Suffix = "",
42 bool EmitSurfacesAndTextures = true);
43
44/// Wraps the input bundled image into the module \p M as global symbols and
45/// registers the images with the HIP runtime.
46/// \param EntryArray Optional pair pointing to the `__start` and `__stop`
47/// symbols holding the `__tgt_offload_entry` array.
48/// \param Suffix An optional suffix appended to the emitted symbols.
49/// \param EmitSurfacesAndTextures Whether to emit surface and textures
50/// registration code. It defaults to false.
52 EntryArrayTy EntryArray,
53 llvm::StringRef Suffix = "",
54 bool EmitSurfacesAndTextures = true);
55} // namespace offloading
56} // namespace llvm
57
58#endif // LLVM_FRONTEND_OFFLOADING_OFFLOADWRAPPER_H
#define LLVM_ABI
Definition: Compiler.h:213
Module.h This file contains the declarations for the Module class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
Lightweight error class with error context and mandatory checking.
Definition: Error.h:159
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
LLVM_ABI llvm::Error wrapOpenMPBinaries(llvm::Module &M, llvm::ArrayRef< llvm::ArrayRef< char > > Images, EntryArrayTy EntryArray, llvm::StringRef Suffix="", bool Relocatable=false)
Wraps the input device images into the module M as global symbols and registers the images with the O...
std::pair< GlobalVariable *, GlobalVariable * > EntryArrayTy
LLVM_ABI llvm::Error wrapHIPBinary(llvm::Module &M, llvm::ArrayRef< char > Images, EntryArrayTy EntryArray, llvm::StringRef Suffix="", bool EmitSurfacesAndTextures=true)
Wraps the input bundled image into the module M as global symbols and registers the images with the H...
LLVM_ABI llvm::Error wrapCudaBinary(llvm::Module &M, llvm::ArrayRef< char > Images, EntryArrayTy EntryArray, llvm::StringRef Suffix="", bool EmitSurfacesAndTextures=true)
Wraps the input fatbinary image into the module M as global symbols and registers the images with the...
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18