[Beignet] [PATCH] GBE: Make compatible with old gcc version.

Yang, Rong R rong.r.yang at intel.com
Fri May 23 00:57:18 PDT 2014


Build error:
libgbe.a(gen75_context.cpp.o): In function `gbe::Gen75Context::getScratchSize()':
/home/champson/temp/beignet/backend/src/./backend/gen75_context.hpp:48: undefined reference to `gbe::Gen75Context::GEN75_SCRATCH_SIZE'
collect2: error: ld returned 1 exit status

-----Original Message-----
From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Ruiling Song
Sent: Friday, May 23, 2014 3:44 PM
To: beignet at lists.freedesktop.org
Cc: Song, Ruiling
Subject: [Beignet] [PATCH] GBE: Make compatible with old gcc version.

Signed-off-by: Ruiling Song <ruiling.song at intel.com>
---
 backend/src/backend/gen75_context.hpp |    2 +-
 backend/src/backend/gen75_encoder.hpp |    2 +-
 backend/src/backend/gen_context.hpp   |    2 +-
 backend/src/backend/gen_encoder.hpp   |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/backend/src/backend/gen75_context.hpp b/backend/src/backend/gen75_context.hpp
index 291e260..8cc90be 100644
--- a/backend/src/backend/gen75_context.hpp
+++ b/backend/src/backend/gen75_context.hpp
@@ -37,7 +37,7 @@ namespace gbe
             : GenContext(unit, name, deviceID, relaxMath) {
     };
     /*! device's max srcatch buffer size */
-    const int GEN75_SCRATCH_SIZE = 2 * KB * KB;
+    const static int GEN75_SCRATCH_SIZE = 2 * KB * KB;
     /*! Emit the per-lane stack pointer computation */
     virtual void emitStackPointer(void);
     /*! Align the scratch size to the device's scratch unit size */ diff --git a/backend/src/backend/gen75_encoder.hpp b/backend/src/backend/gen75_encoder.hpp
index 60dea7b..9b23eab 100644
--- a/backend/src/backend/gen75_encoder.hpp
+++ b/backend/src/backend/gen75_encoder.hpp
@@ -32,7 +32,7 @@ namespace gbe
   {
   public:
     /*! exec width of the double data type */    
-    const int GEN75_DOUBLE_EXEC_WIDTH = 4;
+    const static int GEN75_DOUBLE_EXEC_WIDTH = 4;
     virtual ~Gen75Encoder(void) { }
 
     Gen75Encoder(uint32_t simdWidth, uint32_t gen, uint32_t deviceID) diff --git a/backend/src/backend/gen_context.hpp b/backend/src/backend/gen_context.hpp
index 4a08ed7..0ceddd0 100644
--- a/backend/src/backend/gen_context.hpp
+++ b/backend/src/backend/gen_context.hpp
@@ -65,7 +65,7 @@ namespace gbe
     /*! Release everything needed */
     virtual ~GenContext(void);
     /*! device's max srcatch buffer size */
-    const int GEN7_SCRATCH_SIZE = 12 * KB;
+    const static int GEN7_SCRATCH_SIZE = 12 * KB;
     /*! Start new code generation with specific parameters */
     void startNewCG(uint32_t simdWidth, uint32_t reservedSpillRegs, bool limitRegisterPressure);
     /*! Target device ID*/
diff --git a/backend/src/backend/gen_encoder.hpp b/backend/src/backend/gen_encoder.hpp
index 627a311..e72d0f6 100644
--- a/backend/src/backend/gen_encoder.hpp
+++ b/backend/src/backend/gen_encoder.hpp
@@ -71,7 +71,7 @@ namespace gbe
     /*! Size of the stack (should be large enough) */
     enum { MAX_STATE_NUM = 16 };
     /*! gen7 exec width of the double data type */
-    const int GEN7_DOUBLE_EXEC_WIDTH = 8;
+    const static int GEN7_DOUBLE_EXEC_WIDTH = 8;
     /*! Push the current instruction state */
     void push(void);
     /*! Pop the latest pushed state */
--
1.7.10.4

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


More information about the Beignet mailing list