[Beignet] [PATCH] Backend: Increase stack size for CHV device

Xiuli Pan xiuli.pan at intel.com
Fri Sep 9 05:38:20 UTC 2016


From: Pan Xiuli <xiuli.pan at intel.com>

CHV device have two kinds of EU numbers, this will make stack pointer
calculate wrong. Make it double for safe.

Signed-off-by: Pan Xiuli <xiuli.pan at intel.com>
---
 src/cl_command_queue_gen7.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/cl_command_queue_gen7.c b/src/cl_command_queue_gen7.c
index 6a9cf1f..d1186c2 100644
--- a/src/cl_command_queue_gen7.c
+++ b/src/cl_command_queue_gen7.c
@@ -25,6 +25,7 @@
 #include "cl_mem.h"
 #include "cl_utils.h"
 #include "cl_alloc.h"
+#include "cl_device_data.h"
 
 #include <assert.h>
 #include <stdio.h>
@@ -278,6 +279,9 @@ cl_bind_stack(cl_gpgpu gpgpu, cl_kernel ker)
    */
   if(cl_driver_get_ver(ctx->drv) == 75)
     stack_sz *= 4;
+  /* Because CHV has two kind of EU numbers, multiply stack size with 2 for safe. */
+  if(IS_CHERRYVIEW(device->device_id))
+    stack_sz *= 2;
   cl_gpgpu_set_stack(gpgpu, offset, stack_sz, BTI_PRIVATE);
 }
 
-- 
2.7.4



More information about the Beignet mailing list