Skip to content

Commit 07594d0

Browse files
committed
address reviews
1 parent 506169f commit 07594d0

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

offload/libomptarget/OpenMP/InteropAPI.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,15 @@ void __tgt_interop_init(ident_t *LocRef, int32_t Gtid,
364364
omp_interop_val_t *&InteropPtr, int32_t InteropType,
365365
int32_t DeviceId, int32_t Ndeps,
366366
kmp_depend_info_t *DepList, int32_t HaveNowait) {
367+
constexpr int32_t old_kmp_interop_type_targetsync = 2;
367368
interop_ctx_t Ctx = {0, {false, (bool)HaveNowait, 0}, Gtid};
368369
dep_pack_t Deps = {Ndeps, 0, DepList, nullptr};
369-
InteropPtr = __tgt_interop_get(LocRef, InteropType == 2 ? 1 : 0, DeviceId, 0,
370-
nullptr, &Ctx, Ndeps ? &Deps : nullptr);
370+
InteropPtr =
371+
__tgt_interop_get(LocRef,
372+
InteropType == old_kmp_interop_type_targetsync
373+
? kmp_interop_type_targetsync
374+
: kmp_interop_type_target,
375+
DeviceId, 0, nullptr, &Ctx, Ndeps ? &Deps : nullptr);
371376
}
372377

373378
void __tgt_interop_use(ident_t *LocRef, int32_t Gtid,

offload/plugins-nextgen/amdgpu/src/rtl.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2738,9 +2738,8 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
27382738
}
27392739

27402740
Error releaseInterop(omp_interop_val_t *Interop) override {
2741-
if (!Interop)
2742-
return Plugin::success();
2743-
delete Interop;
2741+
if (Interop)
2742+
delete Interop;
27442743
return Plugin::success();
27452744
}
27462745

offload/plugins-nextgen/cuda/src/rtl.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,8 +942,7 @@ struct CUDADeviceTy : public GenericDeviceTy {
942942
if (auto Err = setContext())
943943
return Err;
944944
CUstream Stream;
945-
if (auto Err = CUDAStreamManager.getResource(
946-
*reinterpret_cast<CUstream *>(&Stream)))
945+
if (auto Err = CUDAStreamManager.getResource(Stream))
947946
return Err;
948947

949948
Ret->async_info->Queue = Stream;

0 commit comments

Comments
 (0)