[Openmp-commits] [openmp] f7c3c64 - [NFC][libomptarget]Remove TRUE, FALSE macros from option.h

Jon Chesterfield via Openmp-commits openmp-commits at lists.llvm.org
Sat Oct 26 17:31:25 PDT 2019


Author: Jon Chesterfield
Date: 2019-10-27T01:31:12+01:00
New Revision: f7c3c640af1fd5f750e6e89f022a7b1c93b3e64a

URL: https://github.com/llvm/llvm-project/commit/f7c3c640af1fd5f750e6e89f022a7b1c93b3e64a
DIFF: https://github.com/llvm/llvm-project/commit/f7c3c640af1fd5f750e6e89f022a7b1c93b3e64a.diff

LOG: [NFC][libomptarget]Remove TRUE,FALSE macros from option.h

Summary:
[NFC][libomptarget]Remove TRUE,FALSE macros from option.h
Subset of D69423. Patch series ends with removing option.h.

Reviewers: ABataev, jdoerfert, grokos

Subscribers: openmp-commits

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D69463

Added: 
    

Modified: 
    openmp/libomptarget/deviceRTLs/nvptx/src/cancel.cu
    openmp/libomptarget/deviceRTLs/nvptx/src/debug.h
    openmp/libomptarget/deviceRTLs/nvptx/src/libcall.cu
    openmp/libomptarget/deviceRTLs/nvptx/src/loop.cu
    openmp/libomptarget/deviceRTLs/nvptx/src/option.h
    openmp/libomptarget/deviceRTLs/nvptx/src/parallel.cu

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/deviceRTLs/nvptx/src/cancel.cu b/openmp/libomptarget/deviceRTLs/nvptx/src/cancel.cu
index 93fc5daa9433..bffe1b7e32be 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/src/cancel.cu
+++ b/openmp/libomptarget/deviceRTLs/nvptx/src/cancel.cu
@@ -16,12 +16,12 @@ EXTERN int32_t __kmpc_cancellationpoint(kmp_Ident *loc, int32_t global_tid,
                                         int32_t cancelVal) {
   PRINT(LD_IO, "call kmpc_cancellationpoint(cancel val %d)\n", (int)cancelVal);
   // disabled
-  return FALSE;
+  return 0;
 }
 
 EXTERN int32_t __kmpc_cancel(kmp_Ident *loc, int32_t global_tid,
                              int32_t cancelVal) {
   PRINT(LD_IO, "call kmpc_cancel(cancel val %d)\n", (int)cancelVal);
   // disabled
-  return FALSE;
+  return 0;
 }

diff  --git a/openmp/libomptarget/deviceRTLs/nvptx/src/debug.h b/openmp/libomptarget/deviceRTLs/nvptx/src/debug.h
index f2fcc1d8f52d..123c15161ca4 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/src/debug.h
+++ b/openmp/libomptarget/deviceRTLs/nvptx/src/debug.h
@@ -195,7 +195,7 @@ NOINLINE static void check(bool cond) { assert(cond); }
   }
 #else
 
-#define DON(_flag) (FALSE)
+#define DON(_flag) (0)
 #define PRINT0(flag, str)
 #define PRINT(flag, str, _args...)
 
@@ -247,7 +247,7 @@ NOINLINE static void check(bool cond) { assert(cond); }
 
 #else
 
-#define TON(_flag) (FALSE)
+#define TON(_flag) (0)
 #define ASSERT0(_flag, _cond, _str)
 #define ASSERT(_flag, _cond, _str, _args...)
 
@@ -279,7 +279,7 @@ NOINLINE static void check(bool cond) { assert(cond); }
 
 #else
 
-#define WON(_flag) (FALSE)
+#define WON(_flag) (0)
 #define WARNING0(_flag, _str)
 #define WARNING(_flag, _str, _args...)
 

diff  --git a/openmp/libomptarget/deviceRTLs/nvptx/src/libcall.cu b/openmp/libomptarget/deviceRTLs/nvptx/src/libcall.cu
index 9580d75963d5..20a22f425324 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/src/libcall.cu
+++ b/openmp/libomptarget/deviceRTLs/nvptx/src/libcall.cu
@@ -286,7 +286,7 @@ EXTERN void omp_get_partition_place_nums(int *place_nums) {
 }
 
 EXTERN int omp_get_cancellation(void) {
-  int rc = FALSE; // currently false only
+  int rc = 0;
   PRINT(LD_IO, "call omp_get_cancellation() returns %d\n", rc);
   return rc;
 }

diff  --git a/openmp/libomptarget/deviceRTLs/nvptx/src/loop.cu b/openmp/libomptarget/deviceRTLs/nvptx/src/loop.cu
index ee378460ac2d..39dfebd92fef 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/src/loop.cu
+++ b/openmp/libomptarget/deviceRTLs/nvptx/src/loop.cu
@@ -170,7 +170,7 @@ public:
       break;
     }
     default: {
-      ASSERT(LT_FUSSY, FALSE, "unknown schedtype %d", (int)schedtype);
+      ASSERT(LT_FUSSY, 0, "unknown schedtype %d", (int)schedtype);
       PRINT(LD_LOOP, "unknown schedtype %d, revert back to static chunk\n",
             (int)schedtype);
       ForStaticChunk(lastiter, lb, ub, stride, chunk, gtid,

diff  --git a/openmp/libomptarget/deviceRTLs/nvptx/src/option.h b/openmp/libomptarget/deviceRTLs/nvptx/src/option.h
index 3c0beaf62a19..37d1134f44bc 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/src/option.h
+++ b/openmp/libomptarget/deviceRTLs/nvptx/src/option.h
@@ -58,11 +58,5 @@
 
 #define INLINE __forceinline__ __device__
 #define NOINLINE __noinline__ __device__
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
 
 #endif

diff  --git a/openmp/libomptarget/deviceRTLs/nvptx/src/parallel.cu b/openmp/libomptarget/deviceRTLs/nvptx/src/parallel.cu
index 016ded8a543e..dc0c22c4319e 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/src/parallel.cu
+++ b/openmp/libomptarget/deviceRTLs/nvptx/src/parallel.cu
@@ -460,7 +460,7 @@ EXTERN void __kmpc_push_simd_limit(kmp_Ident *loc, int32_t tid,
 EXTERN void __kmpc_push_num_teams(kmp_Ident *loc, int32_t tid,
                                   int32_t num_teams, int32_t thread_limit) {
   PRINT(LD_IO, "call kmpc_push_num_teams %d\n", (int)num_teams);
-  ASSERT0(LT_FUSSY, FALSE,
+  ASSERT0(LT_FUSSY, 0,
           "should never have anything with new teams on device");
 }
 


        


More information about the Openmp-commits mailing list