mirror of
https://github.com/intel/llvm.git
synced 2026-01-31 07:04:56 +08:00
[Libomptarget][NFC] Fix linting warnings in the plugins
Summary: Fix some linting warnings present in the plugins.
This commit is contained in:
@@ -1246,7 +1246,7 @@ public:
|
||||
AMDGPUSignalTy *OutputSignals[2] = {};
|
||||
if (auto Err = SignalManager.getResources(/*Num=*/2, OutputSignals))
|
||||
return Err;
|
||||
for (auto Signal : OutputSignals) {
|
||||
for (auto *Signal : OutputSignals) {
|
||||
Signal->reset();
|
||||
Signal->increaseUseCount();
|
||||
}
|
||||
@@ -1312,7 +1312,7 @@ public:
|
||||
AMDGPUSignalTy *OutputSignals[2] = {};
|
||||
if (auto Err = SignalManager.getResources(/*Num=*/2, OutputSignals))
|
||||
return Err;
|
||||
for (auto Signal : OutputSignals) {
|
||||
for (auto *Signal : OutputSignals) {
|
||||
Signal->reset();
|
||||
Signal->increaseUseCount();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ struct AMDGPUImplicitArgsTyCOV4 {
|
||||
uint8_t Unused[56];
|
||||
};
|
||||
|
||||
uint32_t getImplicitArgsSize(uint16_t Version) {
|
||||
inline uint32_t getImplicitArgsSize(uint16_t Version) {
|
||||
return Version < ELF::ELFABIVERSION_AMDGPU_HSA_V5
|
||||
? sizeof(AMDGPUImplicitArgsTyCOV4)
|
||||
: sizeof(AMDGPUImplicitArgsTy);
|
||||
@@ -173,44 +173,44 @@ private:
|
||||
if (!V.first.isString())
|
||||
return Error::success();
|
||||
|
||||
const auto isKey = [](const msgpack::DocNode &DK, StringRef SK) {
|
||||
const auto IsKey = [](const msgpack::DocNode &DK, StringRef SK) {
|
||||
return DK.getString() == SK;
|
||||
};
|
||||
|
||||
const auto getSequenceOfThreeInts = [](msgpack::DocNode &DN,
|
||||
const auto GetSequenceOfThreeInts = [](msgpack::DocNode &DN,
|
||||
uint32_t *Vals) {
|
||||
assert(DN.isArray() && "MsgPack DocNode is an array node");
|
||||
auto DNA = DN.getArray();
|
||||
assert(DNA.size() == 3 && "ArrayNode has at most three elements");
|
||||
|
||||
int i = 0;
|
||||
int I = 0;
|
||||
for (auto DNABegin = DNA.begin(), DNAEnd = DNA.end(); DNABegin != DNAEnd;
|
||||
++DNABegin) {
|
||||
Vals[i++] = DNABegin->getUInt();
|
||||
Vals[I++] = DNABegin->getUInt();
|
||||
}
|
||||
};
|
||||
|
||||
if (isKey(V.first, ".name")) {
|
||||
if (IsKey(V.first, ".name")) {
|
||||
KernelName = V.second.toString();
|
||||
} else if (isKey(V.first, ".sgpr_count")) {
|
||||
} else if (IsKey(V.first, ".sgpr_count")) {
|
||||
KernelData.SGPRCount = V.second.getUInt();
|
||||
} else if (isKey(V.first, ".sgpr_spill_count")) {
|
||||
} else if (IsKey(V.first, ".sgpr_spill_count")) {
|
||||
KernelData.SGPRSpillCount = V.second.getUInt();
|
||||
} else if (isKey(V.first, ".vgpr_count")) {
|
||||
} else if (IsKey(V.first, ".vgpr_count")) {
|
||||
KernelData.VGPRCount = V.second.getUInt();
|
||||
} else if (isKey(V.first, ".vgpr_spill_count")) {
|
||||
} else if (IsKey(V.first, ".vgpr_spill_count")) {
|
||||
KernelData.VGPRSpillCount = V.second.getUInt();
|
||||
} else if (isKey(V.first, ".private_segment_fixed_size")) {
|
||||
} else if (IsKey(V.first, ".private_segment_fixed_size")) {
|
||||
KernelData.PrivateSegmentSize = V.second.getUInt();
|
||||
} else if (isKey(V.first, ".group_segement_fixed_size")) {
|
||||
} else if (IsKey(V.first, ".group_segement_fixed_size")) {
|
||||
KernelData.GroupSegmentList = V.second.getUInt();
|
||||
} else if (isKey(V.first, ".reqd_workgroup_size")) {
|
||||
getSequenceOfThreeInts(V.second, KernelData.RequestedWorkgroupSize);
|
||||
} else if (isKey(V.first, ".workgroup_size_hint")) {
|
||||
getSequenceOfThreeInts(V.second, KernelData.WorkgroupSizeHint);
|
||||
} else if (isKey(V.first, ".wavefront_size")) {
|
||||
} else if (IsKey(V.first, ".reqd_workgroup_size")) {
|
||||
GetSequenceOfThreeInts(V.second, KernelData.RequestedWorkgroupSize);
|
||||
} else if (IsKey(V.first, ".workgroup_size_hint")) {
|
||||
GetSequenceOfThreeInts(V.second, KernelData.WorkgroupSizeHint);
|
||||
} else if (IsKey(V.first, ".wavefront_size")) {
|
||||
KernelData.WavefronSize = V.second.getUInt();
|
||||
} else if (isKey(V.first, ".max_flat_workgroup_size")) {
|
||||
} else if (IsKey(V.first, ".max_flat_workgroup_size")) {
|
||||
KernelData.MaxFlatWorkgroupSize = V.second.getUInt();
|
||||
}
|
||||
|
||||
@@ -273,9 +273,10 @@ private:
|
||||
|
||||
/// Reads the AMDGPU specific metadata from the ELF file and propagates the
|
||||
/// KernelInfoMap
|
||||
Error readAMDGPUMetaDataFromImage(MemoryBufferRef MemBuffer,
|
||||
StringMap<KernelMetaDataTy> &KernelInfoMap,
|
||||
uint16_t &ELFABIVersion) {
|
||||
inline Error
|
||||
readAMDGPUMetaDataFromImage(MemoryBufferRef MemBuffer,
|
||||
StringMap<KernelMetaDataTy> &KernelInfoMap,
|
||||
uint16_t &ELFABIVersion) {
|
||||
Error Err = Error::success(); // Used later as out-parameter
|
||||
|
||||
auto ELFOrError = object::ELF64LEFile::create(MemBuffer.getBuffer());
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <shared_mutex>
|
||||
#include <string>
|
||||
|
||||
struct __tgt_device_image;
|
||||
|
||||
@@ -12,9 +12,6 @@
|
||||
|
||||
#include "Utils/ELF.h"
|
||||
|
||||
#include "Shared/APITypes.h"
|
||||
#include "Shared/Debug.h"
|
||||
|
||||
#include "llvm/BinaryFormat/Magic.h"
|
||||
#include "llvm/Object/Binary.h"
|
||||
#include "llvm/Object/ELFObjectFile.h"
|
||||
|
||||
@@ -728,7 +728,7 @@ struct CUDADeviceTy : public GenericDeviceTy {
|
||||
|
||||
// If there is already pending work on the stream it could be waiting for
|
||||
// someone to check the RPC server.
|
||||
if (auto RPCServer = getRPCServer()) {
|
||||
if (auto *RPCServer = getRPCServer()) {
|
||||
CUresult Res = cuStreamQuery(Stream);
|
||||
while (Res == CUDA_ERROR_NOT_READY) {
|
||||
if (auto Err = RPCServer->runServer(*this))
|
||||
@@ -1088,7 +1088,7 @@ private:
|
||||
}
|
||||
|
||||
// Sort the created array to be in priority order.
|
||||
llvm::sort(Funcs, [=](auto x, auto y) { return x.second < y.second; });
|
||||
llvm::sort(Funcs, [=](auto X, auto Y) { return X.second < Y.second; });
|
||||
|
||||
// Allocate a buffer to store all of the known constructor / destructor
|
||||
// functions in so we can iterate them on the device.
|
||||
|
||||
Reference in New Issue
Block a user