diff options
author | Guo Yejun <yejun.guo@intel.com> | 2015-04-21 11:41:07 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2015-04-24 10:31:33 +0800 |
commit | 325e1e8e3aa2495081c77c4a129fc5743816e52d (patch) | |
tree | 85fea1f03f8d0065e81c6ba9e757c34d647adf66 /src | |
parent | 5c6220a21dc64c2165c81ae499cf7236093da1b2 (diff) |
add simd level function __gen_ocl_get_simd_id
uint __gen_ocl_get_simd_id();
return value ranges from 0 to simdsize - 1
V2: use function sel.selReg to refine code
V3: correct the uniform condition in liveness.cpp
Signed-off-by: Guo Yejun <yejun.guo@intel.com>
Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/cl_command_queue_gen7.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cl_command_queue_gen7.c b/src/cl_command_queue_gen7.c index 4adbd2b2..e27a2112 100644 --- a/src/cl_command_queue_gen7.c +++ b/src/cl_command_queue_gen7.c @@ -210,6 +210,14 @@ cl_curbe_fill(cl_kernel ker, UPLOAD(GBE_CURBE_WORK_DIM, work_dim); #undef UPLOAD + /* __gen_ocl_get_simd_id needs it */ + if ((offset = interp_kernel_get_curbe_offset(ker->opaque, GBE_CURBE_LANE_ID, 0)) >= 0) { + const uint32_t simd_sz = interp_kernel_get_simd_width(ker->opaque); + uint32_t *laneid = (uint32_t *) (ker->curbe + offset); + int32_t i; + for (i = 0; i < (int32_t) simd_sz; ++i) laneid[i] = i; + } + /* Write identity for the stack pointer. This is required by the stack pointer * computation in the kernel */ |