[Openmp-commits] [openmp] b3335e8 - [Libomptarget][NFC] Clang format the AMDGPU plugin
Joseph Huber via Openmp-commits
openmp-commits at lists.llvm.org
Wed Aug 3 12:18:25 PDT 2022
Author: Joseph Huber
Date: 2022-08-03T15:18:16-04:00
New Revision: b3335e8ed71618804c39e5cdd19b163ecdc92c26
URL: https://github.com/llvm/llvm-project/commit/b3335e8ed71618804c39e5cdd19b163ecdc92c26
DIFF: https://github.com/llvm/llvm-project/commit/b3335e8ed71618804c39e5cdd19b163ecdc92c26.diff
LOG: [Libomptarget][NFC] Clang format the AMDGPU plugin
Summary:
A previous patch did not format the plugin again after making changes.
Ensure that libomptarget stays formatted.
Added:
Modified:
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
Removed:
################################################################################
diff --git a/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp b/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
index 6b95756f1d302..5e6524ea34fc4 100644
--- a/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
+++ b/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
@@ -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 ")"
More information about the Openmp-commits
mailing list