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

George Rokos via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Sep 10 12:57:56 PDT 2021


grokos added a comment.

I had another look at this. It seems the assertion is just fine, we would return `SUCCESS` anyway right after `assert()`, so we are now double-checking that `SUCCESS` is indeed the correct value to return.



================
Comment at: openmp/libomptarget/src/interface.cpp:24-34
+/// return flags of __tgt_target_XXX public APIs
+enum __tgt_target_return_t : int {
+  /// successful offload executed on a target device
+  OMP_TGT_SUCCESS = 0,
+  /// offload may not execute on the requested target device
+  /// this scenario can be caused by the device not available or unsupported
+  /// as described in the Execution Model in the specifcation
----------------
This should be moved to `include/omptarget.h` - that's where we currently define `OFFLOAD_SUCCESS` and `OFFLOAD_FAIL`. `OMP_TGT_SUCCESS` and `OMP_TGT_FAIL` are the values which are checked to decided whether offloading has been successful or we should fallback to the host, so their definitions should reside in the header file that the outside world will include. Meanwhile, `OFFLOAD_SUCCESS` and `OFFLOAD_FAIL` are no longer used for inter-component communication, so we can move them to `private.h` or some new header file (do that as part of D109277).


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