Skip to content

Commit

Permalink
[OpenMP][NFC] Fix diagnostic warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jdoerfert committed Nov 28, 2023
1 parent 30fbe73 commit d2636dc
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions openmp/libomptarget/src/omptarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int32_t AsyncInfoTy::runPostProcessing() {

// Clear the vector up until the last known function, since post-processing
// procedures might add new procedures themselves.
const auto PrevBegin = PostProcessingFunctions.begin();
const auto *PrevBegin = PostProcessingFunctions.begin();
PostProcessingFunctions.erase(PrevBegin, PrevBegin + Size);

return OFFLOAD_SUCCESS;
Expand Down Expand Up @@ -297,8 +297,8 @@ void handleTargetOutcome(bool Success, ident_t *Loc) {
if (PM->RTLs.UsedRTLs.empty()) {
llvm::SmallVector<llvm::StringRef> Archs;
llvm::transform(PM->Images, std::back_inserter(Archs),
[](const auto &x) {
return !x.second.Arch ? "empty" : x.second.Arch;
[](const auto &X) {
return !X.second.Arch ? "empty" : X.second.Arch;
});
FAILURE_MESSAGE(
"No images found compatible with the installed hardware. ");
Expand Down Expand Up @@ -473,7 +473,7 @@ void *targetLockExplicit(void *HostPtr, size_t Size, int DeviceNum,
return NULL;
}

void *rc = NULL;
void *RC = NULL;

if (!deviceIsReady(DeviceNum)) {
DP("%s returns NULL ptr\n", Name);
Expand All @@ -492,16 +492,16 @@ void *targetLockExplicit(void *HostPtr, size_t Size, int DeviceNum,
DevicePtr = PM->Devices[DeviceNum].get();
}

int32_t err = 0;
int32_t Err = 0;
if (DevicePtr->RTL->data_lock) {
err = DevicePtr->RTL->data_lock(DeviceNum, HostPtr, Size, &rc);
if (err) {
Err = DevicePtr->RTL->data_lock(DeviceNum, HostPtr, Size, &RC);
if (Err) {
DP("Could not lock ptr %p\n", HostPtr);
return nullptr;
}
}
DP("%s returns device ptr " DPxMOD "\n", Name, DPxPTR(rc));
return rc;
DP("%s returns device ptr " DPxMOD "\n", Name, DPxPTR(RC));
return RC;
}

void targetUnlockExplicit(void *HostPtr, int DeviceNum, const char *Name) {
Expand Down Expand Up @@ -1264,7 +1264,7 @@ class PrivateArgumentManagerTy {

FirstPrivateArgInfoTy(int Index, void *HstPtr, uint32_t Size,
uint32_t Alignment, uint32_t Padding,
const map_var_info_t HstPtrName = nullptr)
map_var_info_t HstPtrName = nullptr)
: HstPtrBegin(reinterpret_cast<char *>(HstPtr)),
HstPtrEnd(HstPtrBegin + Size), Index(Index), Alignment(Alignment),
Size(Size), Padding(Padding), HstPtrName(HstPtrName) {}
Expand Down Expand Up @@ -1298,7 +1298,7 @@ class PrivateArgumentManagerTy {
/// Add a private argument
int addArg(void *HstPtr, int64_t ArgSize, int64_t ArgOffset,
bool IsFirstPrivate, void *&TgtPtr, int TgtArgsIndex,
const map_var_info_t HstPtrName = nullptr,
map_var_info_t HstPtrName = nullptr,
const bool AllocImmediately = false) {
// If the argument is not first-private, or its size is greater than a
// predefined threshold, we will allocate memory and issue the transfer
Expand Down Expand Up @@ -1385,7 +1385,7 @@ class PrivateArgumentManagerTy {
assert(FirstPrivateArgSize != 0 &&
"FirstPrivateArgSize is 0 but FirstPrivateArgInfo is empty");
FirstPrivateArgBuffer.resize(FirstPrivateArgSize, 0);
auto Itr = FirstPrivateArgBuffer.begin();
auto *Itr = FirstPrivateArgBuffer.begin();
// Copy all host data to this buffer
for (FirstPrivateArgInfoTy &Info : FirstPrivateArgInfo) {
// First pad the pointer as we (have to) pad it on the device too.
Expand Down Expand Up @@ -1725,10 +1725,10 @@ int target(ident_t *Loc, DeviceTy &Device, void *HostPtr,
/// and informing the record-replayer of whether to store the output
/// in some file.
int target_activate_rr(DeviceTy &Device, uint64_t MemorySize, void *VAddr,
bool isRecord, bool SaveOutput,
bool IsRecord, bool SaveOutput,
uint64_t &ReqPtrArgOffset) {
return Device.RTL->activate_record_replay(Device.DeviceID, MemorySize, VAddr,
isRecord, SaveOutput,
IsRecord, SaveOutput,
ReqPtrArgOffset);
}

Expand Down

0 comments on commit d2636dc

Please sign in to comment.