[llvm] [Offload] `olLaunchHostFunction` (PR #152482)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 14 05:20:28 PDT 2025
================
@@ -1063,6 +1063,20 @@ struct AMDGPUStreamTy {
/// Indicate to spread data transfers across all available SDMAs
bool UseMultipleSdmaEngines;
+ /// Wrapper function for implementing host callbacks
+ static void CallbackWrapper(AMDGPUSignalTy *InputSignal,
+ AMDGPUSignalTy *OutputSignal,
+ void (*Callback)(void *), void *UserData) {
+ if (InputSignal)
+ if (auto Err = InputSignal->wait())
+ // Wait shouldn't report an error
+ reportFatalInternalError(std::move(Err));
----------------
jhuber6 wrote:
```suggestion
// The wait call will not error in this context.
if (InputSignal) {
if (auto Err = InputSignal->wait())
reportFatalInternalError(std::move(Err));
}
```
https://github.com/llvm/llvm-project/pull/152482
More information about the llvm-commits
mailing list