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

Ruiling Song ruiling.song at intel.com
Sun May 25 19:07:15 PDT 2014


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..6f62b02 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;
+    #define 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..01520ed 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;
+    #define 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..02c83d0 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;
+    #define 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..02661d3 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;
+    #define GEN7_DOUBLE_EXEC_WIDTH  8
     /*! Push the current instruction state */
     void push(void);
     /*! Pop the latest pushed state */
-- 
1.7.10.4



More information about the Beignet mailing list