-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[SYCL] Add offload wrapping for SYCL kind. #147508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 13 commits
524da07
e19602e
eee8b0f
0669663
cefdefc
8d80041
262e39a
fee98af
53b5a95
c17682b
ad141aa
20e54a1
ca63663
f6e98a0
700fd4a
c636b33
5f1eee1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -13,6 +13,8 @@ | |||||||||
#include "llvm/IR/Module.h" | ||||||||||
#include "llvm/Support/Compiler.h" | ||||||||||
|
||||||||||
#include <string> | ||||||||||
|
||||||||||
namespace llvm { | ||||||||||
namespace offloading { | ||||||||||
using EntryArrayTy = std::pair<GlobalVariable *, GlobalVariable *>; | ||||||||||
|
@@ -52,6 +54,23 @@ LLVM_ABI llvm::Error wrapHIPBinary(llvm::Module &M, llvm::ArrayRef<char> Images, | |||||||||
EntryArrayTy EntryArray, | ||||||||||
llvm::StringRef Suffix = "", | ||||||||||
bool EmitSurfacesAndTextures = true); | ||||||||||
|
||||||||||
struct SYCLJITOptions { | ||||||||||
// Target/compiler specific options that are suggested to use to "compile" | ||||||||||
// program at runtime. | ||||||||||
Comment on lines
+59
to
+60
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit that can be addressed in follow-up pr, this comment might be clearer, these options arent really a suggestion, they must be passed to the gpu driver
Suggested change
|
||||||||||
std::string CompileOptions; | ||||||||||
// Target/compiler specific options that are suggested to use to "link" | ||||||||||
// program at runtime. | ||||||||||
std::string LinkOptions; | ||||||||||
}; | ||||||||||
|
||||||||||
/// Wraps OffloadBinaries in the given \p Buffers into the module \p M | ||||||||||
/// as global symbols and registers the images with the SYCL Runtime. | ||||||||||
/// \param Options Data that needs to be encoded for the later use in a runtime. | ||||||||||
maksimsab marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
LLVM_ABI llvm::Error | ||||||||||
wrapSYCLBinaries(llvm::Module &M, llvm::ArrayRef<char> Buffer, | ||||||||||
SYCLJITOptions Options = SYCLJITOptions()); | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit that can be addressed in follow-up: are there any cases where a caller wouldnt want to pass SYCLJitOptions? AOT mode? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, AOT mode is a case when it is too late to pass any options. |
||||||||||
|
||||||||||
} // namespace offloading | ||||||||||
} // namespace llvm | ||||||||||
|
||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,8 @@ LLVM_ABI StructType *getEntryTy(Module &M); | |
/// \param Data Extra data storage associated with the entry. | ||
/// \param SectionName The section this entry will be placed at. | ||
/// \param AuxAddr An extra pointer if needed. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we explain what this means more? when do we need it |
||
LLVM_ABI void | ||
/// \return The emitted global variable containing the offloading entry. | ||
LLVM_ABI GlobalVariable * | ||
emitOffloadingEntry(Module &M, object::OffloadKind Kind, Constant *Addr, | ||
StringRef Name, uint64_t Size, uint32_t Flags, | ||
uint64_t Data, Constant *AuxAddr = nullptr, | ||
|
Uh oh!
There was an error while loading. Please reload this page.