[Beignet] [PATCH 09/12] runtime: thread_ids not initialized after created.

xionghu.luo at intel.com xionghu.luo at intel.com
Thu May 5 16:11:52 UTC 2016


From: Luo Xionghu <xionghu.luo at intel.com>

Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
---
 src/cl_command_queue_gen7.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/cl_command_queue_gen7.c b/src/cl_command_queue_gen7.c
index 1921744..4caa7e7 100644
--- a/src/cl_command_queue_gen7.c
+++ b/src/cl_command_queue_gen7.c
@@ -69,8 +69,10 @@ cl_set_varying_payload(const cl_kernel ker,
   if (id_offset[2] >= 0)
     TRY_ALLOC(ids[2], (uint32_t*) alloca(sizeof(uint32_t)*thread_n*simd_sz));
   TRY_ALLOC(block_ips, (uint16_t*) alloca(sizeof(uint16_t)*thread_n*simd_sz));
-  if (tid_offset >= 0)
+  if (tid_offset >= 0) {
     TRY_ALLOC(thread_ids, (uint32_t*) alloca(sizeof(uint32_t)*thread_n));
+    memset(thread_ids, 0, sizeof(uint32_t)*thread_n);
+  }
   /* 0xffff means that the lane is inactivated */
   memset(block_ips, 0xff, sizeof(int16_t)*thread_n*simd_sz);
 
-- 
2.1.4



More information about the Beignet mailing list