[Beignet] [PATCH] Disable error message output in release version.

Yang, Rong R rong.r.yang at intel.com
Tue Jul 2 20:01:40 PDT 2013


Release version build pass. Look good to me, thanks.

-----Original Message-----
From: beignet-bounces+rong.r.yang=intel.com at lists.freedesktop.org [mailto:beignet-bounces+rong.r.yang=intel.com at lists.freedesktop.org] On Behalf Of Ruiling Song
Sent: Tuesday, July 02, 2013 4:45 PM
To: beignet at lists.freedesktop.org
Cc: Song, Ruiling
Subject: [Beignet] [PATCH] Disable error message output in release version.

As piglit will got the error message we output to stderr and mark the case 'WARN'.
so, we disable the message to stderr, and use release version to run piglit.

also fix a minor compile fail under release version.

Signed-off-by: Ruiling Song <ruiling.song at intel.com>
---
 backend/src/llvm/llvm_gen_backend.cpp |    3 +--
 src/cl_utils.h                        |   24 ++++++++++++++++--------
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp
index 8385e21..1649edf 100644
--- a/backend/src/llvm/llvm_gen_backend.cpp
+++ b/backend/src/llvm/llvm_gen_backend.cpp
@@ -1823,10 +1823,9 @@ namespace gbe
 
   void GenWriter::emitAtomicInst(CallInst &I, CallSite &CS, ir::AtomicOps opcode) {
     CallSite::arg_iterator AI = CS.arg_begin(); -#if GBE_DEBUG
     CallSite::arg_iterator AE = CS.arg_end(); -#endif /* GBE_DEBUG */
     GBE_ASSERT(AI != AE);
+
     unsigned int llvmSpace = (*AI)->getType()->getPointerAddressSpace();
     const ir::AddressSpace addrSpace = addressSpaceLLVMToGen(llvmSpace);
     const ir::Register dst = this->getRegister(&I); diff --git a/src/cl_utils.h b/src/cl_utils.h index dfb1369..59b7a2b 100644
--- a/src/cl_utils.h
+++ b/src/cl_utils.h
@@ -39,14 +39,22 @@ struct JOIN(__,JOIN(__,__LINE__)) {                                 \
 }
 
 /* Throw errors */
-#define ERR(ERROR, ...)                                             \
-do {                                                                \
-  fprintf(stderr, "error in %s line %i\n", __FILE__, __LINE__);     \
-  fprintf(stderr, __VA_ARGS__);                                     \
-  fprintf(stderr, "\n");                                            \
-  err = ERROR;                                                      \
-  goto error;                                                       \
-} while (0)
+#ifdef NDEBUG
+  #define ERR(ERROR, ...)                                             \
+  do {                                                                \
+    err = ERROR;                                                      \
+    goto error;                                                       \
+  } while (0)
+#else
+  #define ERR(ERROR, ...)                                             \
+  do {                                                                \
+    fprintf(stderr, "error in %s line %i\n", __FILE__, __LINE__);     \
+    fprintf(stderr, __VA_ARGS__);                                     \
+    fprintf(stderr, "\n");                                            \
+    err = ERROR;                                                      \
+    goto error;                                                       \
+  } while (0)
+#endif
 
 #define DO_ALLOC_ERR                                                \
 do {                                                                \
--
1.7.9.5

_______________________________________________
Beignet mailing list
Beignet at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list