[llvm] [Offload] Add MPI Proxy Plugin (PR #114574)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 3 09:02:36 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions c,cpp,h -- offload/plugins-nextgen/mpi/event_system/EventSystem.cpp offload/plugins-nextgen/mpi/event_system/EventSystem.h offload/plugins-nextgen/mpi/src/ProxyDevice.cpp offload/plugins-nextgen/mpi/src/RemotePluginManager.cpp offload/plugins-nextgen/mpi/src/RemotePluginManager.h offload/plugins-nextgen/mpi/src/rtl.cpp offload/include/omptarget.h offload/libomptarget/PluginManager.cpp offload/libomptarget/omptarget.cpp offload/plugins-nextgen/common/include/PluginInterface.h offload/plugins-nextgen/host/src/rtl.cpp offload/test/api/omp_device_managed_memory.c offload/test/api/omp_device_managed_memory_alloc.c offload/test/api/omp_host_call.c offload/test/mapping/target_derefence_array_pointrs.cpp offload/test/mapping/target_has_device_addr.c offload/test/mapping/target_uses_allocator.c offload/test/offloading/bug64959.c offload/test/offloading/struct_mapping_with_pointers.cpp offload/test/offloading/target_critical_region.cpp offload/test/offloading/thread_limit.c offload/test/sanitizer/kernel_crash.c offload/test/sanitizer/kernel_crash_async.c offload/test/sanitizer/kernel_crash_many.c offload/test/sanitizer/kernel_crash_single.c offload/test/sanitizer/kernel_trap.c offload/test/sanitizer/kernel_trap.cpp offload/test/sanitizer/kernel_trap_async.c offload/test/sanitizer/kernel_trap_many.c
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/offload/plugins-nextgen/mpi/event_system/EventSystem.h b/offload/plugins-nextgen/mpi/event_system/EventSystem.h
index a62eb8bc8..fce1cf5f0 100644
--- a/offload/plugins-nextgen/mpi/event_system/EventSystem.h
+++ b/offload/plugins-nextgen/mpi/event_system/EventSystem.h
@@ -177,14 +177,10 @@ struct EventTy {
}
/// Set Event Type
- void setEventType(EventTypeTy EType) {
- EventType = EType;
- }
+ void setEventType(EventTypeTy EType) { EventType = EType; }
/// Get the Event Type
- EventTypeTy getEventType() const {
- return EventType;
- }
+ EventTypeTy getEventType() const { return EventType; }
/// Execution handling.
/// Resume the coroutine execution up until the next suspension point.
@@ -340,9 +336,8 @@ EventTy allocateBuffer(MPIRequestManagerTy RequestManager, int64_t Size,
int32_t Kind, void **Buffer);
EventTy deleteBuffer(MPIRequestManagerTy RequestManager, void *Buffer,
int32_t Kind);
-EventTy submit(MPIRequestManagerTy RequestManager, void *TgtPtr,
- void *HstPtr, int64_t Size,
- __tgt_async_info *AsyncInfoPtr);
+EventTy submit(MPIRequestManagerTy RequestManager, void *TgtPtr, void *HstPtr,
+ int64_t Size, __tgt_async_info *AsyncInfoPtr);
EventTy retrieve(MPIRequestManagerTy RequestManager, int64_t Size, void *HstPtr,
void *TgtPtr, __tgt_async_info *AsyncInfoPtr);
EventTy localExchange(MPIRequestManagerTy RequestManager, void *SrcPtr,
@@ -505,7 +500,7 @@ public:
template <class EventFuncTy, typename... ArgsTy>
requires std::invocable<EventFuncTy, MPIRequestManagerTy, ArgsTy...>
EventTy NotificationEvent(EventFuncTy EventFunc, EventTypeTy EventType,
- int DstDeviceID, ArgsTy... Args);
+ int DstDeviceID, ArgsTy... Args);
/// Creates a new event.
///
@@ -549,8 +544,9 @@ public:
template <class EventFuncTy, typename... ArgsTy>
requires std::invocable<EventFuncTy, MPIRequestManagerTy, ArgsTy...>
-EventTy EventSystemTy::NotificationEvent(EventFuncTy EventFunc, EventTypeTy EventType,
- int DstDeviceID, ArgsTy... Args) {
+EventTy EventSystemTy::NotificationEvent(EventFuncTy EventFunc,
+ EventTypeTy EventType, int DstDeviceID,
+ ArgsTy... Args) {
// Create event MPI request manager.
const int EventTag = createNewEventTag();
auto &EventComm = getNewEventComm(EventTag);
@@ -564,18 +560,18 @@ EventTy EventSystemTy::NotificationEvent(EventFuncTy EventFunc, EventTypeTy Even
// Send new event notification.
int EventNotificationInfo[] = {static_cast<int>(EventType), EventTag,
- RemoteDeviceId};
+ RemoteDeviceId};
MPI_Request NotificationRequest = MPI_REQUEST_NULL;
int MPIError = MPI_Isend(EventNotificationInfo, 3, MPI_INT, RemoteRank,
- static_cast<int>(ControlTagsTy::EVENT_REQUEST),
- GateThreadComm, &NotificationRequest);
+ static_cast<int>(ControlTagsTy::EVENT_REQUEST),
+ GateThreadComm, &NotificationRequest);
if (MPIError != MPI_SUCCESS)
co_return createError("MPI failed during event notification with error %d",
MPIError);
MPIRequestManagerTy RequestManager(EventComm, EventTag, RemoteRank,
- RemoteDeviceId, {NotificationRequest});
+ RemoteDeviceId, {NotificationRequest});
RequestManager.EventType = EventNotificationInfo[0];
@@ -583,10 +579,8 @@ EventTy EventSystemTy::NotificationEvent(EventFuncTy EventFunc, EventTypeTy Even
Event.setEventType(EventType);
co_return (co_await Event);
-
}
-
template <class EventFuncTy, typename... ArgsTy>
requires std::invocable<EventFuncTy, MPIRequestManagerTy, ArgsTy...>
EventTy EventSystemTy::createEvent(EventFuncTy EventFunc, EventTypeTy EventType,
``````````
</details>
https://github.com/llvm/llvm-project/pull/114574
More information about the llvm-commits
mailing list