[llvm] [clang] [llvm][frontend][offloading] Move clang-linker-wrapper/OffloadWrapper.* to llvm/Frontend/Offloading (PR #78057)
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Sun Jan 14 09:58:14 PST 2024
================
@@ -568,32 +590,45 @@ void createRegisterFatbinFunction(Module &M, GlobalVariable *FatbinDesc,
} // namespace
-Error wrapOpenMPBinaries(Module &M, ArrayRef<ArrayRef<char>> Images) {
- GlobalVariable *Desc = createBinDesc(M, Images);
+Error OffloadWrapper::wrapOpenMPBinaries(
+ Module &M, ArrayRef<ArrayRef<char>> Images,
+ std::optional<EntryArrayTy> EntryArray) const {
+ GlobalVariable *Desc = createBinDesc(
+ M, Images,
+ EntryArray
+ ? *EntryArray
+ : offloading::getOffloadEntryArray(M, "omp_offloading_entries"),
+ Suffix);
if (!Desc)
return createStringError(inconvertibleErrorCode(),
"No binary descriptors created.");
- createRegisterFunction(M, Desc);
- createUnregisterFunction(M, Desc);
+ createRegisterFunction(M, Desc, Suffix);
+ createUnregisterFunction(M, Desc, Suffix);
return Error::success();
}
-Error wrapCudaBinary(Module &M, ArrayRef<char> Image) {
- GlobalVariable *Desc = createFatbinDesc(M, Image, /* IsHIP */ false);
+Error OffloadWrapper::wrapCudaBinary(
+ Module &M, ArrayRef<char> Image,
+ std::optional<EntryArrayTy> EntryArray) const {
+ GlobalVariable *Desc = createFatbinDesc(M, Image, /* IsHIP */ false, Suffix);
if (!Desc)
return createStringError(inconvertibleErrorCode(),
"No fatinbary section created.");
- createRegisterFatbinFunction(M, Desc, /* IsHIP */ false);
+ createRegisterFatbinFunction(M, Desc, /* IsHIP */ false, EntryArray, Suffix,
+ EmitSurfacesAndTextures);
return Error::success();
}
-Error wrapHIPBinary(Module &M, ArrayRef<char> Image) {
- GlobalVariable *Desc = createFatbinDesc(M, Image, /* IsHIP */ true);
+Error OffloadWrapper::wrapHIPBinary(
+ Module &M, ArrayRef<char> Image,
+ std::optional<EntryArrayTy> EntryArray) const {
+ GlobalVariable *Desc = createFatbinDesc(M, Image, /* IsHIP */ true, Suffix);
if (!Desc)
return createStringError(inconvertibleErrorCode(),
"No fatinbary section created.");
- createRegisterFatbinFunction(M, Desc, /* IsHIP */ true);
+ createRegisterFatbinFunction(M, Desc, /* IsHIP */ true, EntryArray, Suffix,
----------------
jhuber6 wrote:
Can you fix these comments while you're at it? LLVM inline comments should be `/*IsHIP=*/`
https://github.com/llvm/llvm-project/pull/78057
More information about the cfe-commits
mailing list