Skip to content

Commit e4f4022

Browse files
committed
[Libomptarget][NFC] Fix linting warnings in the plugins
Summary: Fix some linting warnings present in the plugins.
1 parent b1a5ee1 commit e4f4022

File tree

5 files changed

+26
-29
lines changed

5 files changed

+26
-29
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ struct AMDGPUStreamTy {
12461246
AMDGPUSignalTy *OutputSignals[2] = {};
12471247
if (auto Err = SignalManager.getResources(/*Num=*/2, OutputSignals))
12481248
return Err;
1249-
for (auto Signal : OutputSignals) {
1249+
for (auto *Signal : OutputSignals) {
12501250
Signal->reset();
12511251
Signal->increaseUseCount();
12521252
}
@@ -1312,7 +1312,7 @@ struct AMDGPUStreamTy {
13121312
AMDGPUSignalTy *OutputSignals[2] = {};
13131313
if (auto Err = SignalManager.getResources(/*Num=*/2, OutputSignals))
13141314
return Err;
1315-
for (auto Signal : OutputSignals) {
1315+
for (auto *Signal : OutputSignals) {
13161316
Signal->reset();
13171317
Signal->increaseUseCount();
13181318
}

openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ struct AMDGPUImplicitArgsTyCOV4 {
5353
uint8_t Unused[56];
5454
};
5555

56-
uint32_t getImplicitArgsSize(uint16_t Version) {
56+
inline uint32_t getImplicitArgsSize(uint16_t Version) {
5757
return Version < ELF::ELFABIVERSION_AMDGPU_HSA_V5
5858
? sizeof(AMDGPUImplicitArgsTyCOV4)
5959
: sizeof(AMDGPUImplicitArgsTy);
@@ -173,44 +173,44 @@ class KernelInfoReader {
173173
if (!V.first.isString())
174174
return Error::success();
175175

176-
const auto isKey = [](const msgpack::DocNode &DK, StringRef SK) {
176+
const auto IsKey = [](const msgpack::DocNode &DK, StringRef SK) {
177177
return DK.getString() == SK;
178178
};
179179

180-
const auto getSequenceOfThreeInts = [](msgpack::DocNode &DN,
180+
const auto GetSequenceOfThreeInts = [](msgpack::DocNode &DN,
181181
uint32_t *Vals) {
182182
assert(DN.isArray() && "MsgPack DocNode is an array node");
183183
auto DNA = DN.getArray();
184184
assert(DNA.size() == 3 && "ArrayNode has at most three elements");
185185

186-
int i = 0;
186+
int I = 0;
187187
for (auto DNABegin = DNA.begin(), DNAEnd = DNA.end(); DNABegin != DNAEnd;
188188
++DNABegin) {
189-
Vals[i++] = DNABegin->getUInt();
189+
Vals[I++] = DNABegin->getUInt();
190190
}
191191
};
192192

193-
if (isKey(V.first, ".name")) {
193+
if (IsKey(V.first, ".name")) {
194194
KernelName = V.second.toString();
195-
} else if (isKey(V.first, ".sgpr_count")) {
195+
} else if (IsKey(V.first, ".sgpr_count")) {
196196
KernelData.SGPRCount = V.second.getUInt();
197-
} else if (isKey(V.first, ".sgpr_spill_count")) {
197+
} else if (IsKey(V.first, ".sgpr_spill_count")) {
198198
KernelData.SGPRSpillCount = V.second.getUInt();
199-
} else if (isKey(V.first, ".vgpr_count")) {
199+
} else if (IsKey(V.first, ".vgpr_count")) {
200200
KernelData.VGPRCount = V.second.getUInt();
201-
} else if (isKey(V.first, ".vgpr_spill_count")) {
201+
} else if (IsKey(V.first, ".vgpr_spill_count")) {
202202
KernelData.VGPRSpillCount = V.second.getUInt();
203-
} else if (isKey(V.first, ".private_segment_fixed_size")) {
203+
} else if (IsKey(V.first, ".private_segment_fixed_size")) {
204204
KernelData.PrivateSegmentSize = V.second.getUInt();
205-
} else if (isKey(V.first, ".group_segement_fixed_size")) {
205+
} else if (IsKey(V.first, ".group_segement_fixed_size")) {
206206
KernelData.GroupSegmentList = V.second.getUInt();
207-
} else if (isKey(V.first, ".reqd_workgroup_size")) {
208-
getSequenceOfThreeInts(V.second, KernelData.RequestedWorkgroupSize);
209-
} else if (isKey(V.first, ".workgroup_size_hint")) {
210-
getSequenceOfThreeInts(V.second, KernelData.WorkgroupSizeHint);
211-
} else if (isKey(V.first, ".wavefront_size")) {
207+
} else if (IsKey(V.first, ".reqd_workgroup_size")) {
208+
GetSequenceOfThreeInts(V.second, KernelData.RequestedWorkgroupSize);
209+
} else if (IsKey(V.first, ".workgroup_size_hint")) {
210+
GetSequenceOfThreeInts(V.second, KernelData.WorkgroupSizeHint);
211+
} else if (IsKey(V.first, ".wavefront_size")) {
212212
KernelData.WavefronSize = V.second.getUInt();
213-
} else if (isKey(V.first, ".max_flat_workgroup_size")) {
213+
} else if (IsKey(V.first, ".max_flat_workgroup_size")) {
214214
KernelData.MaxFlatWorkgroupSize = V.second.getUInt();
215215
}
216216

@@ -273,9 +273,10 @@ class KernelInfoReader {
273273

274274
/// Reads the AMDGPU specific metadata from the ELF file and propagates the
275275
/// KernelInfoMap
276-
Error readAMDGPUMetaDataFromImage(MemoryBufferRef MemBuffer,
277-
StringMap<KernelMetaDataTy> &KernelInfoMap,
278-
uint16_t &ELFABIVersion) {
276+
inline Error
277+
readAMDGPUMetaDataFromImage(MemoryBufferRef MemBuffer,
278+
StringMap<KernelMetaDataTy> &KernelInfoMap,
279+
uint16_t &ELFABIVersion) {
279280
Error Err = Error::success(); // Used later as out-parameter
280281

281282
auto ELFOrError = object::ELF64LEFile::create(MemBuffer.getBuffer());

openmp/libomptarget/plugins-nextgen/common/include/JIT.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
#include <functional>
2727
#include <memory>
28-
#include <shared_mutex>
2928
#include <string>
3029

3130
struct __tgt_device_image;

openmp/libomptarget/plugins-nextgen/common/src/Utils/ELF.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212

1313
#include "Utils/ELF.h"
1414

15-
#include "Shared/APITypes.h"
16-
#include "Shared/Debug.h"
17-
1815
#include "llvm/BinaryFormat/Magic.h"
1916
#include "llvm/Object/Binary.h"
2017
#include "llvm/Object/ELFObjectFile.h"

openmp/libomptarget/plugins-nextgen/cuda/src/rtl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ struct CUDADeviceTy : public GenericDeviceTy {
728728

729729
// If there is already pending work on the stream it could be waiting for
730730
// someone to check the RPC server.
731-
if (auto RPCServer = getRPCServer()) {
731+
if (auto *RPCServer = getRPCServer()) {
732732
CUresult Res = cuStreamQuery(Stream);
733733
while (Res == CUDA_ERROR_NOT_READY) {
734734
if (auto Err = RPCServer->runServer(*this))
@@ -1088,7 +1088,7 @@ struct CUDADeviceTy : public GenericDeviceTy {
10881088
}
10891089

10901090
// Sort the created array to be in priority order.
1091-
llvm::sort(Funcs, [=](auto x, auto y) { return x.second < y.second; });
1091+
llvm::sort(Funcs, [=](auto X, auto Y) { return X.second < Y.second; });
10921092

10931093
// Allocate a buffer to store all of the known constructor / destructor
10941094
// functions in so we can iterate them on the device.

0 commit comments

Comments
 (0)