[Libomptarget][NFC] Clang format the AMDGPU plugin
authorJoseph Huber <jhuber6@vols.utk.edu>
Wed, 3 Aug 2022 19:17:30 +0000 (15:17 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Wed, 3 Aug 2022 19:18:16 +0000 (15:18 -0400)
Summary:
A previous patch did not format the plugin again after making changes.
Ensure that libomptarget stays formatted.

openmp/libomptarget/plugins/amdgpu/src/rtl.cpp

index 6b95756..5e6524e 100644 (file)
@@ -1131,7 +1131,7 @@ int32_t dataRetrieve(int32_t DeviceId, void *HstPtr, void *TgtPtr, int64_t Size,
      (long long unsigned)(Elf64_Addr)HstPtr);
 
   Err = DeviceInfo().freesignalpoolMemcpyD2H(HstPtr, TgtPtr, (size_t)Size,
-                                           DeviceId);
+                                             DeviceId);
 
   if (Err != HSA_STATUS_SUCCESS) {
     DP("Error when copying data from device to host. Pointers: "
@@ -1495,8 +1495,8 @@ int32_t runRegionLocked(int32_t DeviceId, void *TgtEntryPtr, void **TgtArgs,
         // under a multiple reader lock, not a writer lock.
         static pthread_mutex_t HostcallInitLock = PTHREAD_MUTEX_INITIALIZER;
         pthread_mutex_lock(&HostcallInitLock);
-        uint64_t Buffer = hostrpc_assign_buffer(DeviceInfo().HSAAgents[DeviceId],
-                                                Queue, DeviceId);
+        uint64_t Buffer = hostrpc_assign_buffer(
+            DeviceInfo().HSAAgents[DeviceId], Queue, DeviceId);
         pthread_mutex_unlock(&HostcallInitLock);
         if (!Buffer) {
           DP("hostrpc_assign_buffer failed, gpu would dereference null and "
@@ -1858,7 +1858,7 @@ struct DeviceEnvironment {
         }
 
         return DeviceInfo().freesignalpoolMemcpyH2D(StatePtr, &HostDeviceEnv,
-                                                  StatePtrSize, DeviceId);
+                                                    StatePtrSize, DeviceId);
       }
     }
     return HSA_STATUS_SUCCESS;
@@ -2114,7 +2114,8 @@ int32_t __tgt_rtl_init_device(int DeviceId) {
 
   if (print_kernel_trace & STARTUP_DETAILS)
     DP("Device#%-2d CU's: %2d %s\n", DeviceId,
-       DeviceInfo().ComputeUnits[DeviceId], DeviceInfo().GPUName[DeviceId].c_str());
+       DeviceInfo().ComputeUnits[DeviceId],
+       DeviceInfo().GPUName[DeviceId].c_str());
 
   // Query attributes to determine number of threads/block and blocks/grid.
   uint16_t WorkgroupMaxDim[3];
@@ -2126,7 +2127,8 @@ int32_t __tgt_rtl_init_device(int DeviceId) {
        RTLDeviceInfoTy::DefaultNumTeams);
   } else if (WorkgroupMaxDim[0] <= RTLDeviceInfoTy::HardTeamLimit) {
     DeviceInfo().GroupsPerDevice[DeviceId] = WorkgroupMaxDim[0];
-    DP("Using %d ROCm blocks per grid\n", DeviceInfo().GroupsPerDevice[DeviceId]);
+    DP("Using %d ROCm blocks per grid\n",
+       DeviceInfo().GroupsPerDevice[DeviceId]);
   } else {
     DeviceInfo().GroupsPerDevice[DeviceId] = RTLDeviceInfoTy::HardTeamLimit;
     DP("Max ROCm blocks per grid %d exceeds the hard team limit %d, capping "
@@ -2281,8 +2283,9 @@ __tgt_target_table *__tgt_rtl_load_binary_locked(int32_t DeviceId,
     return NULL;
 
   {
-    auto Env = DeviceEnvironment(DeviceId, DeviceInfo().NumberOfDevices,
-                                 DeviceInfo().Env.DynamicMemSize, Image, ImgSize);
+    auto Env =
+        DeviceEnvironment(DeviceId, DeviceInfo().NumberOfDevices,
+                          DeviceInfo().Env.DynamicMemSize, Image, ImgSize);
 
     auto &KernelInfo = DeviceInfo().KernelInfoTable[DeviceId];
     auto &SymbolInfo = DeviceInfo().SymbolInfoTable[DeviceId];
@@ -2439,8 +2442,8 @@ __tgt_target_table *__tgt_rtl_load_binary_locked(int32_t DeviceId,
         // If unified memory is present any target link variables
         // can access host addresses directly. There is no longer a
         // need for device copies.
-        Err = DeviceInfo().freesignalpoolMemcpyH2D(Varptr, E->addr, sizeof(void *),
-                                                 DeviceId);
+        Err = DeviceInfo().freesignalpoolMemcpyH2D(Varptr, E->addr,
+                                                   sizeof(void *), DeviceId);
         if (Err != HSA_STATUS_SUCCESS)
           DP("Error when copying USM\n");
         DP("Copy linked variable host address (" DPxMOD ")"