Skip to content

Commit b645d58

Browse files
committed
Minor format/stylistic changes.
1 parent 5d72174 commit b645d58

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

offload/libomptarget/interface.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,12 @@ targetData(ident_t *Loc, int64_t DeviceId, int32_t ArgNum, void **ArgsBase,
168168

169169
// Only allocate AttachInfo for targetDataBegin
170170
AttachInfoTy *AttachInfo = nullptr;
171-
if (TargetDataFunction == targetDataBegin) {
171+
if (TargetDataFunction == targetDataBegin)
172172
AttachInfo = new AttachInfoTy();
173-
}
174173

175174
Rc = TargetDataFunction(Loc, *DeviceOrErr, ArgNum, ArgsBase, Args, ArgSizes,
176-
ArgTypes, ArgNames, ArgMappers, AsyncInfo,
177-
AttachInfo, false /*FromMapper=*/);
175+
ArgTypes, ArgNames, ArgMappers, AsyncInfo, AttachInfo,
176+
/*FromMapper=*/false);
178177

179178
if (Rc == OFFLOAD_SUCCESS) {
180179
// Process deferred ATTACH entries BEFORE synchronization

offload/libomptarget/omptarget.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,8 @@ static int performPointerAttachment(DeviceTy &Device, AsyncInfoTy &AsyncInfo,
496496
// Device.submitData(..., /*InOrder=*/IsFirstAttachEntry)
497497
// Where the boolean InOrder being true means that this submission should
498498
// wait for prior memory submissions to finish.
499-
int SubmitResult =
500-
Device.submitData(TgtPtrAddr, DataBuffer, HstPtrSize, AsyncInfo,
501-
PtrTPR.getEntry());
499+
int SubmitResult = Device.submitData(TgtPtrAddr, DataBuffer, HstPtrSize,
500+
AsyncInfo, PtrTPR.getEntry());
502501

503502
AsyncInfo.addPostProcessingFunction([DataBuffer]() -> int {
504503
delete[] DataBuffer;
@@ -678,10 +677,10 @@ int targetDataBegin(ident_t *Loc, DeviceTy &Device, int32_t ArgNum,
678677
}
679678

680679
if (ArgTypes[I] & OMP_TGT_MAPTYPE_PTR_AND_OBJ && !IsHostPtr) {
681-
int Ret = performPointerAttachment(Device, AsyncInfo,
682-
(void **)PointerHstPtrBegin, HstPtrBase, HstPtrBegin,
683-
(void **)PointerTgtPtrBegin, TgtPtrBegin,
684-
sizeof(void *), PointerTpr);
680+
int Ret = performPointerAttachment(
681+
Device, AsyncInfo, (void **)PointerHstPtrBegin, HstPtrBase,
682+
HstPtrBegin, (void **)PointerTgtPtrBegin, TgtPtrBegin, sizeof(void *),
683+
PointerTpr);
685684
if (Ret != OFFLOAD_SUCCESS)
686685
return OFFLOAD_FAIL;
687686
}
@@ -783,8 +782,9 @@ int processAttachEntries(DeviceTy &Device, AttachInfoTy &AttachInfo,
783782
IsAttachAlways ? "yes" : "no");
784783

785784
// Lambda to perform target pointer lookup and validation
786-
auto LookupTargetPointer = [&](void *Ptr, int64_t Size, const char *PtrType)
787-
-> std::optional<TargetPointerResultTy> {
785+
auto LookupTargetPointer =
786+
[&](void *Ptr, int64_t Size,
787+
const char *PtrType) -> std::optional<TargetPointerResultTy> {
788788
// ATTACH map-type does not change ref-count, or do any allocation
789789
// We just need to do a lookup for the pointer/pointee.
790790
TargetPointerResultTy TPR = Device.getMappingInfo().getTgtPtrBegin(

0 commit comments

Comments
 (0)