Skip to content

Commit 9aa95fe

Browse files
committed
fix in AMD plugin and getters to pass test from llvm#161434
1 parent 6090c32 commit 9aa95fe

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

offload/libomptarget/OpenMP/InteropAPI.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void *getProperty<void *>(omp_interop_val_t &InteropVal,
124124
case omp_ipr_device_context:
125125
return InteropVal.device_info.Context;
126126
case omp_ipr_targetsync:
127-
return InteropVal.async_info->Queue;
127+
return InteropVal.async_info ? InteropVal.async_info->Queue : nullptr;
128128
default:;
129129
}
130130
getTypeMismatch(Property, Err);
@@ -167,7 +167,6 @@ bool getPropertyCheck(omp_interop_val_t **InteropPtr,
167167
omp_interop_property_t property_id, \
168168
int *err) { \
169169
omp_interop_val_t *interop_val = (omp_interop_val_t *)interop; \
170-
assert((interop_val)->interop_type == kmp_interop_type_targetsync); \
171170
if (!getPropertyCheck(&interop_val, property_id, err)) { \
172171
return (RETURN_TYPE)(0); \
173172
} \

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2716,7 +2716,7 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
27162716
int32_t NumPrefers,
27172717
interop_spec_t *Prefers) override {
27182718
// TODO: update once targetsync is supported
2719-
if (InteropType != kmp_interop_type_target)
2719+
if (InteropType == kmp_interop_type_target)
27202720
return interop_spec_t{tgt_fr_hsa, {false, 0}, 0};
27212721
return interop_spec_t{tgt_fr_none, {false, 0}, 0};
27222722
}

0 commit comments

Comments
 (0)