Skip to content

Commit

Permalink
[OpenMP] Resolve const cast issue introduced in D123446
Browse files Browse the repository at this point in the history
  • Loading branch information
jdoerfert committed Mar 28, 2023
1 parent 94d1453 commit 4d3f79f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion openmp/libomptarget/include/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ struct HostDataToTargetTy {
/// OFFLOAD_SUCCESS. The entry is locked for this operation.
template <typename CBTy> int foreachShadowPointerInfo(CBTy CB) const {
for (auto &It : States->ShadowPtrInfos)
if (CB(It) == OFFLOAD_FAIL)
if (CB(const_cast<ShadowPtrInfoTy &>(It)) == OFFLOAD_FAIL)
return OFFLOAD_FAIL;
return OFFLOAD_SUCCESS;
}
Expand Down
2 changes: 1 addition & 1 deletion openmp/libomptarget/src/omptarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ static int targetDataContiguous(ident_t *Loc, DeviceTy &Device, void *ArgsBase,
}
if (TPR.getEntry()) {
int Ret = TPR.getEntry()->foreachShadowPointerInfo(
[&](const ShadowPtrInfoTy &ShadowPtr) {
[&](ShadowPtrInfoTy &ShadowPtr) {
DP("Restoring original target pointer value " DPxMOD " for target "
"pointer " DPxMOD "\n",
DPxPTR(ShadowPtr.TgtPtrVal), DPxPTR(ShadowPtr.TgtPtrAddr));
Expand Down

0 comments on commit 4d3f79f

Please sign in to comment.