[Beignet] [PATCH 2/3] GBE: use the simd width environment variable if set.

Zhigang Gong zhigang.gong at linux.intel.com
Thu May 23 21:02:14 PDT 2013


If the user set OCL_SIMD_WIDTH to 8 or 16, we force the backend
to use it. Without this patch, the OCL_SIMD_WIDTH never have a
chance to take effect, as we always set the functions simdWidth
before we create a gen context.

Signed-off-by: Zhigang Gong <zhigang.gong at linux.intel.com>
---
 backend/src/backend/context.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/backend/src/backend/context.cpp b/backend/src/backend/context.cpp
index 474c36a..af1f579 100644
--- a/backend/src/backend/context.cpp
+++ b/backend/src/backend/context.cpp
@@ -271,7 +271,7 @@ namespace gbe
   ///////////////////////////////////////////////////////////////////////////
   // Generic Context (shared by the simulator and the HW context)
   ///////////////////////////////////////////////////////////////////////////
-  IVAR(OCL_SIMD_WIDTH, 8, 16, 32);
+  IVAR(OCL_SIMD_WIDTH, 8, 15, 16);
 
   Context::Context(const ir::Unit &unit, const std::string &name) :
     unit(unit), fn(*unit.getFunction(name)), name(name), liveness(NULL), dag(NULL)
@@ -280,12 +280,12 @@ namespace gbe
     this->liveness = GBE_NEW(ir::Liveness, const_cast<ir::Function&>(fn));
     this->dag = GBE_NEW(ir::FunctionDAG, *this->liveness);
     this->partitioner = GBE_NEW_NO_ARG(RegisterFilePartitioner);
-    if (fn.getSimdWidth() == 0)
+    if (fn.getSimdWidth() == 0 || OCL_SIMD_WIDTH != 15)
       this->simdWidth = nextHighestPowerOf2(OCL_SIMD_WIDTH);
     else
       this->simdWidth = fn.getSimdWidth();
-
   }
+
   Context::~Context(void) {
     GBE_SAFE_DELETE(this->partitioner);
     GBE_SAFE_DELETE(this->dag);
-- 
1.7.11.7



More information about the Beignet mailing list