From ea9395716ecc9923beb74b3af3df9f673364a76e Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Wed, 10 Feb 2021 14:16:18 -0600 Subject: [PATCH] [OpenMP][NFC] Clang format the libomptarget plugins Reviewed By: tianshilei1992 Differential Revision: https://reviews.llvm.org/D96445 --- .../libomptarget/plugins/generic-elf-64bit/src/rtl.cpp | 13 +++++-------- openmp/libomptarget/plugins/ve/src/rtl.cpp | 18 +++++++----------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/openmp/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp b/openmp/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp index 625518f..eb6ebc1 100644 --- a/openmp/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp +++ b/openmp/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp @@ -12,8 +12,8 @@ #include #include -#include #include +#include #include #include #include @@ -93,10 +93,7 @@ public: return &E.Table; } - RTLDeviceInfoTy(int32_t num_devices) { - - FuncGblEntries.resize(num_devices); - } + RTLDeviceInfoTy(int32_t num_devices) { FuncGblEntries.resize(num_devices); } ~RTLDeviceInfoTy() { // Close dynamic libraries @@ -230,7 +227,7 @@ __tgt_target_table *__tgt_rtl_load_binary(int32_t device_id, Elf64_Addr entries_addr = libInfo->l_addr + entries_offset; DP("Pointer to first entry to be loaded is (" DPxMOD ").\n", - DPxPTR(entries_addr)); + DPxPTR(entries_addr)); // Table of pointers to all the entries in the target. __tgt_offload_entry *entries_table = (__tgt_offload_entry *)entries_addr; @@ -245,7 +242,7 @@ __tgt_target_table *__tgt_rtl_load_binary(int32_t device_id, } DP("Entries table range is (" DPxMOD ")->(" DPxMOD ")\n", - DPxPTR(entries_begin), DPxPTR(entries_end)); + DPxPTR(entries_begin), DPxPTR(entries_end)); DeviceInfo.createOffloadTable(device_id, entries_begin, entries_end); elf_end(e); @@ -307,7 +304,7 @@ int32_t __tgt_rtl_run_target_team_region(int32_t device_id, void *tgt_entry_ptr, DP("Running entry point at " DPxMOD "...\n", DPxPTR(tgt_entry_ptr)); void (*entry)(void); - *((void**) &entry) = tgt_entry_ptr; + *((void **)&entry) = tgt_entry_ptr; ffi_call(&cif, entry, NULL, &args[0]); return OFFLOAD_SUCCESS; } diff --git a/openmp/libomptarget/plugins/ve/src/rtl.cpp b/openmp/libomptarget/plugins/ve/src/rtl.cpp index 284ee04..186247d 100644 --- a/openmp/libomptarget/plugins/ve/src/rtl.cpp +++ b/openmp/libomptarget/plugins/ve/src/rtl.cpp @@ -83,11 +83,8 @@ public: } else { DP("Found symbol %s successfully in target image (addr: %p)\n", SymbolName, reinterpret_cast(SymbolTargetAddr)); - Entry = { reinterpret_cast(SymbolTargetAddr), - i->name, - i->size, - i->flags, - 0 }; + Entry = {reinterpret_cast(SymbolTargetAddr), i->name, i->size, + i->flags, 0}; } T.push_back(Entry); @@ -178,7 +175,6 @@ static int target_run_function_wait(uint32_t DeviceID, uint64_t FuncAddr, return OFFLOAD_SUCCESS; } - // Return the number of available devices of the type supported by the // target RTL. int32_t __tgt_rtl_number_of_devices(void) { return DeviceInfo.NodeIds.size(); } @@ -353,8 +349,8 @@ void *__tgt_rtl_data_alloc(int32_t ID, int64_t Size, void *HostPtr) { DP("Allocate target memory: device=%d, target addr=%p, size=%" PRIu64 "\n", ID, reinterpret_cast(addr), Size); if (ret != 0) { - DP("veo_alloc_mem(%d, %p, %" PRIu64 ") failed with error code %d\n", - ID, reinterpret_cast(addr), Size, ret); + DP("veo_alloc_mem(%d, %p, %" PRIu64 ") failed with error code %d\n", ID, + reinterpret_cast(addr), Size, ret); return NULL; } @@ -390,7 +386,7 @@ int32_t __tgt_rtl_data_retrieve(int32_t ID, void *HostPtr, void *TargetPtr, // De-allocate the data referenced by target ptr on the device. In case of // success, return zero. Otherwise, return an error code. int32_t __tgt_rtl_data_delete(int32_t ID, void *TargetPtr) { - int ret = veo_free_mem(DeviceInfo.ProcHandles[ID], (uint64_t)TargetPtr); + int ret = veo_free_mem(DeviceInfo.ProcHandles[ID], (uint64_t)TargetPtr); if (ret != 0) { DP("veo_free_mem() failed with error code %d\n", ret); @@ -422,8 +418,8 @@ int32_t __tgt_rtl_run_target_team_region(int32_t ID, void *Entry, void **Args, ret = veo_args_set_u64(TargetArgs, i, (intptr_t)Args[i]); if (ret != 0) { - DP("veo_args_set_u64() has returned %d for argnum=%d and value %p\n", - ret, i, Args[i]); + DP("veo_args_set_u64() has returned %d for argnum=%d and value %p\n", ret, + i, Args[i]); return OFFLOAD_FAIL; } } -- 2.7.4