[Openmp-commits] [PATCH] D109277: [OpenMP][libomptarget] Change internal return status to enum type

Ye Luo via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sat Sep 4 13:04:44 PDT 2021


ye-luo created this revision.
Herald added subscribers: guansong, yaxunl.
ye-luo requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: openmp-commits, sstefan1.
Herald added a project: OpenMP.

Return status will be expanded beyond success/failure.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109277

Files:
  openmp/libomptarget/include/omptarget.h


Index: openmp/libomptarget/include/omptarget.h
===================================================================
--- openmp/libomptarget/include/omptarget.h
+++ openmp/libomptarget/include/omptarget.h
@@ -20,14 +20,17 @@
 
 #include <SourceInfo.h>
 
-#define OFFLOAD_SUCCESS (0)
-#define OFFLOAD_FAIL (~0)
-
 #define OFFLOAD_DEVICE_DEFAULT -1
 
 // Don't format out enums and structs.
 // clang-format off
 
+/// return error status
+enum __tgt_error : int32_t {
+  OFFLOAD_SUCCESS = 0,
+  OFFLOAD_FAIL = ~0
+};
+
 /// Data attributes for each data reference used in an OpenMP target region.
 enum tgt_map_type {
   // No flags


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109277.370757.patch
Type: text/x-patch
Size: 630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210904/9732db87/attachment.bin>


More information about the Openmp-commits mailing list