Skip to content

Commit 0440af0

Browse files
committed
address review comments
1 parent 0c29ac6 commit 0440af0

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

offload/include/OpenMP/InteropAPI.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ struct interop_attrs_t {
2828
bool inorder : 1;
2929
int reserved : 31;
3030

31-
/* Check if the supported attributes are compatible with the current
32-
attributes. Only if an attribute is supported can the value be true,
33-
otherwise it needs to be false
34-
*/
31+
/// Check if the supported attributes are compatible with the current
32+
/// attributes. Only if an attribute is supported can the value be true,
33+
/// otherwise it needs to be false
3534
bool checkSupportedOnly(interop_attrs_t supported) const {
3635
return supported.inorder || (!supported.inorder && !inorder);
3736
}
@@ -167,7 +166,7 @@ struct InteropTableEntry {
167166
}
168167
}
169168

170-
/* vector interface */
169+
/// vector interface
171170
int size() const { return Interops.size(); }
172171
iterator begin() { return Interops.begin(); }
173172
iterator end() { return Interops.end(); }
@@ -179,4 +178,6 @@ struct InteropTblTy
179178
void clear();
180179
};
181180

181+
void syncImplicitInterops(int gtid, void *event);
182+
182183
#endif // OMPTARGET_OPENMP_INTEROP_API_H

offload/libomptarget/OpenMP/API.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "rtl.h"
1717

1818
#include "OpenMP/InternalTypes.h"
19+
#include "OpenMP/InteropAPI.h"
1920
#include "OpenMP/Mapping.h"
2021
#include "OpenMP/OMPT/Interface.h"
2122
#include "OpenMP/omp.h"
@@ -684,7 +685,6 @@ EXTERN void *omp_get_mapped_ptr(const void *Ptr, int DeviceNum) {
684685
return TPR.TargetPointer;
685686
}
686687

687-
void syncImplicitInterops(int gtid, void *event);
688688
// This routine gets called from the Host RTL at sync points (taskwait, barrier,
689689
// ...) so we can synchronize the necessary objects from the offload side.
690690
EXTERN void __tgt_target_sync(ident_t *loc_ref, int gtid, void *current_task,

offload/libomptarget/OpenMP/InteropAPI.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,9 @@ omp_interop_val_t *__tgt_interop_get(ident_t *LocRef, int32_t InteropType,
227227

228228
auto DeviceOrErr = PM->getDevice(DeviceNum);
229229
if (!DeviceOrErr) {
230-
[[maybe_unused]] std::string ErrStr = toString(DeviceOrErr.takeError());
231230
DP("Couldn't find device %" PRId64
232231
" while constructing interop object: %s\n",
233-
DeviceNum, ErrStr.c_str());
232+
DeviceNum, toString(DeviceOrErr.takeError()).c_str());
234233
return omp_interop_none;
235234
}
236235
auto &Device = *DeviceOrErr;
@@ -280,18 +279,18 @@ omp_interop_val_t *__tgt_interop_get(ident_t *LocRef, int32_t InteropType,
280279

281280
int __tgt_interop_use(ident_t *LocRef, omp_interop_val_t *Interop,
282281
interop_ctx_t *Ctx, dep_pack_t *Deps) {
283-
bool nowait = Ctx->flags.nowait;
282+
bool Nowait = Ctx->flags.nowait;
284283
DP("Call to %s with interop " DPxMOD ", nowait %" PRId32 "\n", __func__,
285-
DPxPTR(Interop), nowait);
284+
DPxPTR(Interop), Nowait);
286285
if (OffloadPolicy::get(*PM).Kind == OffloadPolicy::DISABLED || !Interop)
287286
return OFFLOAD_FAIL;
288287

289288
if (Interop->interop_type == kmp_interop_type_targetsync) {
290289
if (Deps) {
291-
if (nowait) {
290+
if (Nowait) {
292291
DP("Warning: nowait flag on interop use with dependences not supported"
293292
"yet. Ignored\n");
294-
nowait = false;
293+
Nowait = false;
295294
}
296295

297296
__kmpc_omp_wait_deps(LocRef, Ctx->gtid, Deps->ndeps, Deps->deplist,
@@ -300,7 +299,7 @@ int __tgt_interop_use(ident_t *LocRef, omp_interop_val_t *Interop,
300299
}
301300

302301
if (Interop->async_info && Interop->async_info->Queue) {
303-
if (nowait)
302+
if (Nowait)
304303
Interop->asyncBarrier();
305304
else {
306305
Interop->flush();
@@ -333,16 +332,16 @@ int __tgt_interop_release(ident_t *LocRef, omp_interop_val_t *Interop,
333332
}
334333

335334
EXTERN int ompx_interop_add_completion_callback(omp_interop_val_t *Interop,
336-
ompx_interop_cb_t *cb,
337-
void *data) {
335+
ompx_interop_cb_t *CB,
336+
void *Data) {
338337
DP("Call to %s with interop " DPxMOD ", property callback " DPxMOD
339338
"and data " DPxMOD "\n",
340-
__func__, DPxPTR(Interop), DPxPTR(cb), DPxPTR(data));
339+
__func__, DPxPTR(Interop), DPxPTR(CB), DPxPTR(Data));
341340

342341
if (OffloadPolicy::get(*PM).Kind == OffloadPolicy::DISABLED || !Interop)
343342
return omp_irc_other;
344343

345-
Interop->addCompletionCb(cb, data);
344+
Interop->addCompletionCb(CB, Data);
346345

347346
return omp_irc_success;
348347
}
@@ -433,15 +432,15 @@ int32_t omp_interop_val_t::release() {
433432
return release(Device);
434433
}
435434

436-
void syncImplicitInterops(int gtid, void *event) {
435+
void syncImplicitInterops(int Gtid, void *Event) {
437436
if (PM->InteropTbl.size() == 0)
438437
return;
439438

440439
DP("target_sync: syncing interops for gtid %" PRId32 ", event " DPxMOD "\n",
441-
gtid, DPxPTR(event));
440+
Gtid, DPxPTR(Event));
442441

443442
for (auto iop : PM->InteropTbl) {
444-
if (iop->async_info && iop->async_info->Queue && iop->isOwnedBy(gtid) &&
443+
if (iop->async_info && iop->async_info->Queue && iop->isOwnedBy(Gtid) &&
445444
!iop->isClean()) {
446445

447446
iop->flush();

0 commit comments

Comments
 (0)