[Openmp-commits] [PATCH] D109304: [OpenMP][libomptarget] Add __tgt_target_return_t enum for __tgt_target_XXX return int

Ye Luo via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Sep 7 19:32:39 PDT 2021


ye-luo added inline comments.


================
Comment at: openmp/libomptarget/src/interface.cpp:396
   handleTargetOutcome(rc == OFFLOAD_SUCCESS, loc);
-  return rc;
+  assert(rc == OFFLOAD_SUCCESS &&
+         "__tgt_target_teams_mapper unexpected failure!");
----------------
tianshilei1992 wrote:
> What is this for?
right now if rc != OFFLOAD_SUCCESS, handleTargetOutcome abort the execution. So once this assert line was reached, rc should be always OFFLOAD_SUCCESS and thus return OMP_TGT_SUCCESS is safe. If one day, the behavior of handleTargetOutcome changes, this assertion should catch unexpected inconsistency.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109304/new/

https://reviews.llvm.org/D109304



More information about the Openmp-commits mailing list