<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/beignet.git/src/cl_kernel.c, branch runtime_dev</title>
<subtitle>gitlab.freedesktop.org: beignet/beignet.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/'/>
<entry>
<title>make Beignet as intermedia layer of CMRT</title>
<updated>2015-12-09T03:27:48+00:00</updated>
<author>
<name>Guo Yejun</name>
<email>yejun.guo@intel.com</email>
</author>
<published>2015-11-18T18:03:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=e2c46c88bd5bbd9f5762ba7ad3eaf00257ad114f'/>
<id>e2c46c88bd5bbd9f5762ba7ad3eaf00257ad114f</id>
<content type='text'>
CMRT is C for Media Runtime on Intel GPU, see https://github.com/01org/cmrt.
There is a request to make Beignet as intermedia layer of CMRT, in
other words, application programer write OpenCL APIs to execute the
CM kernel on GPU, the following shows the key code, and please refer
to the next patch of unit test for detail.

prog = clCreateProgramWithBinary("cm kernel");
clBuildProgram(prog);
kernel = clCreateKernel(prog, "kernel name");
image = clCreateImage();
clSetKernelArg(kernel, image);
clEnqueueNDRangeKernel(kernel);

Inside Beignet, once cm kernel is invoked, the following relative APIs
will be directly passed to CMRT library (libcmrt.so) which is loaded
via dlopen only when necessary. Since we use this simple method to
keep the code clean, OpenCL spec is not strictly followed, and cl_event
is not supported for this case.

v2: add comments about the cm queue in fuction cmrt_enqueue
Signed-off-by: Guo Yejun &lt;yejun.guo@intel.com&gt;
Reviewed-by: Yang Rong &lt;rong.r.yang@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
CMRT is C for Media Runtime on Intel GPU, see https://github.com/01org/cmrt.
There is a request to make Beignet as intermedia layer of CMRT, in
other words, application programer write OpenCL APIs to execute the
CM kernel on GPU, the following shows the key code, and please refer
to the next patch of unit test for detail.

prog = clCreateProgramWithBinary("cm kernel");
clBuildProgram(prog);
kernel = clCreateKernel(prog, "kernel name");
image = clCreateImage();
clSetKernelArg(kernel, image);
clEnqueueNDRangeKernel(kernel);

Inside Beignet, once cm kernel is invoked, the following relative APIs
will be directly passed to CMRT library (libcmrt.so) which is loaded
via dlopen only when necessary. Since we use this simple method to
keep the code clean, OpenCL spec is not strictly followed, and cl_event
is not supported for this case.

v2: add comments about the cm queue in fuction cmrt_enqueue
Signed-off-by: Guo Yejun &lt;yejun.guo@intel.com&gt;
Reviewed-by: Yang Rong &lt;rong.r.yang@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add extensions intel_accelerator and basic intel_motion_estimation.</title>
<updated>2015-11-10T04:22:18+00:00</updated>
<author>
<name>Chuanbo Weng</name>
<email>chuanbo.weng@intel.com</email>
</author>
<published>2015-11-06T03:27:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=6a3eddc4dd70c895c426f1f8231778eb98ea7ac3'/>
<id>6a3eddc4dd70c895c426f1f8231778eb98ea7ac3</id>
<content type='text'>
v2:
1. Just upload the first vme_state.
2. Remove duplicated code in check_opt1_extension.
3. Check image format before cl_gpgpu_bind_image_for_vme.
4. Fix error of getting mv. Because we suppose this kernel run in SIMD16
   mode, so dword 0 of grf 1 should be
   __gen_ocl_region(8,vme_result.s0), not
   __gen_ocl_region(0,vme_result.s1).

v3:
Return CL_IMAGE_FORMAT_NOT_SUPPORTED if image format is not the required
one.

v4:
Fix two conflicts after code rebase and wordaround a curbe related bug.

v6:
Treat simd8 and simd16 differently when getting mv.

Signed-off-by: Guo Yejun &lt;yejun.guo@intel.com&gt;
Signed-off-by: Chuanbo Weng &lt;chuanbo.weng@intel.com&gt;
Reviewed-by: Ruiling Song &lt;ruiling.song@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
v2:
1. Just upload the first vme_state.
2. Remove duplicated code in check_opt1_extension.
3. Check image format before cl_gpgpu_bind_image_for_vme.
4. Fix error of getting mv. Because we suppose this kernel run in SIMD16
   mode, so dword 0 of grf 1 should be
   __gen_ocl_region(8,vme_result.s0), not
   __gen_ocl_region(0,vme_result.s1).

v3:
Return CL_IMAGE_FORMAT_NOT_SUPPORTED if image format is not the required
one.

v4:
Fix two conflicts after code rebase and wordaround a curbe related bug.

v6:
Treat simd8 and simd16 differently when getting mv.

Signed-off-by: Guo Yejun &lt;yejun.guo@intel.com&gt;
Signed-off-by: Chuanbo Weng &lt;chuanbo.weng@intel.com&gt;
Reviewed-by: Ruiling Song &lt;ruiling.song@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>GBE: fix kernel arguments uploading bug.</title>
<updated>2015-10-12T02:10:33+00:00</updated>
<author>
<name>Zhigang Gong</name>
<email>zhigang.gong@intel.com</email>
</author>
<published>2015-10-10T01:10:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=ad733c0efea62f92ab5f00cd09d03d36a524f87e'/>
<id>ad733c0efea62f92ab5f00cd09d03d36a524f87e</id>
<content type='text'>
After the curbe allocation refactor, not all kernel arguments
will be allocated unconditional. If some kernel arguments haven't
been used at all, the corresponding arguments will be ignored
at backend thus we may get a -1 offset. On the runtime driver
side, we need check this situation.

Signed-off-by: Zhigang Gong &lt;zhigang.gong@intel.com&gt;
Reviewed-by: "Yang, Rong R" &lt;rong.r.yang@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After the curbe allocation refactor, not all kernel arguments
will be allocated unconditional. If some kernel arguments haven't
been used at all, the corresponding arguments will be ignored
at backend thus we may get a -1 offset. On the runtime driver
side, we need check this situation.

Signed-off-by: Zhigang Gong &lt;zhigang.gong@intel.com&gt;
Reviewed-by: "Yang, Rong R" &lt;rong.r.yang@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>GBE: refactor curbe register allocation.</title>
<updated>2015-09-24T03:00:25+00:00</updated>
<author>
<name>Zhigang Gong</name>
<email>zhigang.gong@intel.com</email>
</author>
<published>2015-09-14T06:19:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=061d214a6fc2876a0e24e094f87f2a172984bc23'/>
<id>061d214a6fc2876a0e24e094f87f2a172984bc23</id>
<content type='text'>
The major motivation is to normalize the curbe payload's
allocation and prepare to use liveness information
to avoid unecessary payload register allocation and avoid
fragments when allocate curbe registers. For an example,
for GBE_CURBE_LOCAL_ID_Y/Z, many one dimention
kernels don't need them. But previous curbe allocation
occurs before the liveness interval computing, thus it
will allocate that curbe anyway. Altough it will be expired
soon but it still need us to prepare those payload at
host side. After this patch, this type of overhead
has been eliminated easily.

Another purpose is to eliminate the ugly curbe patch list
handling in backend. After this patch, the curbe register
handling is much cleaner than before.

Signed-off-by: Zhigang Gong &lt;zhigang.gong@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The major motivation is to normalize the curbe payload's
allocation and prepare to use liveness information
to avoid unecessary payload register allocation and avoid
fragments when allocate curbe registers. For an example,
for GBE_CURBE_LOCAL_ID_Y/Z, many one dimention
kernels don't need them. But previous curbe allocation
occurs before the liveness interval computing, thus it
will allocate that curbe anyway. Altough it will be expired
soon but it still need us to prepare those payload at
host side. After this patch, this type of overhead
has been eliminated easily.

Another purpose is to eliminate the ugly curbe patch list
handling in backend. After this patch, the curbe register
handling is much cleaner than before.

Signed-off-by: Zhigang Gong &lt;zhigang.gong@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix clGetKernelArgInfo fail on piglit</title>
<updated>2015-09-02T05:49:50+00:00</updated>
<author>
<name>Pan Xiuli</name>
<email>xiuli.pan@intel.com</email>
</author>
<published>2015-08-31T03:04:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=030d5224a4f57afa599c47777c2150436035540b'/>
<id>030d5224a4f57afa599c47777c2150436035540b</id>
<content type='text'>
1.Change the code for null param_value
2.Add the return value check for build option "-cl-kernel-arg-info"
3.Correct one return value typo

Signed-off-by: Pan Xiuli &lt;xiuli.pan@intel.com&gt;
Reviewed-by: "Yang, Rong R" &lt;rong.r.yang@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1.Change the code for null param_value
2.Add the return value check for build option "-cl-kernel-arg-info"
3.Correct one return value typo

Signed-off-by: Pan Xiuli &lt;xiuli.pan@intel.com&gt;
Reviewed-by: "Yang, Rong R" &lt;rong.r.yang@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>runtime: fix a conformance bug in cl_get_kernel_arg_info.</title>
<updated>2015-03-18T07:35:06+00:00</updated>
<author>
<name>Zhigang Gong</name>
<email>zhigang.gong@intel.com</email>
</author>
<published>2015-03-18T07:06:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=dbd0677d8571c0fa808d2cfe1bf5cc53e306c35a'/>
<id>dbd0677d8571c0fa808d2cfe1bf5cc53e306c35a</id>
<content type='text'>
Accordying to OpenCL 1.2 Rev 17:
"CL_KERNEL_ARG_TYPE_CONST is returned if the argument is a pointer and the referenced type is declared with the restrict or const qualifier. For
example, a kernel argument declared as global int const *x returns CL_KERNEL_ARG_TYPE_CONST but a kernel argument declared as global int *
const x does not."

So only need to return CL_KERNEL_ARG_TYPE_CONST for pointer arguments.

Signed-off-by: Zhigang Gong &lt;zhigang.gong@intel.com&gt;
Tested-by: "Weng, Chuanbo" &lt;chuanbo.weng@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Accordying to OpenCL 1.2 Rev 17:
"CL_KERNEL_ARG_TYPE_CONST is returned if the argument is a pointer and the referenced type is declared with the restrict or const qualifier. For
example, a kernel argument declared as global int const *x returns CL_KERNEL_ARG_TYPE_CONST but a kernel argument declared as global int *
const x does not."

So only need to return CL_KERNEL_ARG_TYPE_CONST for pointer arguments.

Signed-off-by: Zhigang Gong &lt;zhigang.gong@intel.com&gt;
Tested-by: "Weng, Chuanbo" &lt;chuanbo.weng@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fix min_max_read_image_args and min_max_parameter_size issue.</title>
<updated>2014-12-25T06:22:46+00:00</updated>
<author>
<name>Luo Xionghu</name>
<email>xionghu.luo@intel.com</email>
</author>
<published>2014-12-25T02:25:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=9022dc9fa1e6cbc02bb27a65478387049f7e727f'/>
<id>9022dc9fa1e6cbc02bb27a65478387049f7e727f</id>
<content type='text'>
this patch revert fb4bced99b7c08d0d43386abf33448860fb7fc41 as the spec
defined the min_max_parameter_size's min value is 1024;
the BTI_MAX_NUM and btiBase could be 130 because of 128 images with 1
const surface and 1 private surface.

v2: add BTI_MAX_READ_IMAGE_ARGS and BTI_MAX_WRITE_IMAGE_ARGS in backend.
change the BTI_MAX_ID to 253. the image numbers will be calculated in
later patch and check its limitation.

Signed-off-by: Luo Xionghu &lt;xionghu.luo@intel.com&gt;
Reviewed-by: Zhigang Gong &lt;zhigang.gong@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this patch revert fb4bced99b7c08d0d43386abf33448860fb7fc41 as the spec
defined the min_max_parameter_size's min value is 1024;
the BTI_MAX_NUM and btiBase could be 130 because of 128 images with 1
const surface and 1 private surface.

v2: add BTI_MAX_READ_IMAGE_ARGS and BTI_MAX_WRITE_IMAGE_ARGS in backend.
change the BTI_MAX_ID to 253. the image numbers will be calculated in
later patch and check its limitation.

Signed-off-by: Luo Xionghu &lt;xionghu.luo@intel.com&gt;
Reviewed-by: Zhigang Gong &lt;zhigang.gong@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>GBE: switch to CLANG native sampler_t.</title>
<updated>2014-12-18T07:42:17+00:00</updated>
<author>
<name>Zhigang Gong</name>
<email>zhigang.gong@intel.com</email>
</author>
<published>2014-12-12T10:16:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=45ca4e85389e7063ced6ae469a4f29c8181abe04'/>
<id>45ca4e85389e7063ced6ae469a4f29c8181abe04</id>
<content type='text'>
CLANG has sampler_t support since LLVM 3.3, let's switch to that type
rather than the old hacky way. One major problem is the sampler static
checking. As Gen platform has some hardware restrication and if the
sampler value is a const defined at kernel side, we need to use the
value to optimize the code path. Now the sampler_t becomes an obaque
type now, the CLANG doesn't support any arithmatic operations on it.
So we have to introduce a new pass to do this optimization.

v2:
fix comments.

Signed-off-by: Zhigang Gong &lt;zhigang.gong@intel.com&gt;
Reviewed-by: "Yang, Rong R" &lt;rong.r.yang@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
CLANG has sampler_t support since LLVM 3.3, let's switch to that type
rather than the old hacky way. One major problem is the sampler static
checking. As Gen platform has some hardware restrication and if the
sampler value is a const defined at kernel side, we need to use the
value to optimize the code path. Now the sampler_t becomes an obaque
type now, the CLANG doesn't support any arithmatic operations on it.
So we have to introduce a new pass to do this optimization.

v2:
fix comments.

Signed-off-by: Zhigang Gong &lt;zhigang.gong@intel.com&gt;
Reviewed-by: "Yang, Rong R" &lt;rong.r.yang@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>License: adjust all license version to LGPL v2.1+.</title>
<updated>2014-11-11T02:18:02+00:00</updated>
<author>
<name>Zhigang Gong</name>
<email>zhigang.gong@intel.com</email>
</author>
<published>2014-11-05T09:22:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=436253de8a1b7a6851a09ebbba92cb065ce4282f'/>
<id>436253de8a1b7a6851a09ebbba92cb065ce4282f</id>
<content type='text'>
To make the license statement consistent to each other, adjust
all license versions to v2.1+. Thus beignet should have a pure
LGPL v2.1+ license.

Signed-off-by: Zhigang Gong &lt;zhigang.gong@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To make the license statement consistent to each other, adjust
all license versions to v2.1+. Thus beignet should have a pure
LGPL v2.1+ license.

Signed-off-by: Zhigang Gong &lt;zhigang.gong@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fix piglit get kernel info FUNCTION ATTRIBUTE fail.</title>
<updated>2014-09-12T08:42:56+00:00</updated>
<author>
<name>Luo</name>
<email>xionghu.luo@intel.com</email>
</author>
<published>2014-09-12T03:53:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=a6ca297b403e3b729eb13bc5425ac7f64bacdab3'/>
<id>a6ca297b403e3b729eb13bc5425ac7f64bacdab3</id>
<content type='text'>
the backend need return the kernel FUNCTION ATTRIBUTE message to the
clGetKernelInfo.
there are 3 kind of function attribute so far, vec_type_hint parameter
is not available to return due to llvm lack of such info.

Signed-off-by: Luo &lt;xionghu.luo@intel.com&gt;
Reviewed-by: Zhigang Gong &lt;zhigang.gong@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the backend need return the kernel FUNCTION ATTRIBUTE message to the
clGetKernelInfo.
there are 3 kind of function attribute so far, vec_type_hint parameter
is not available to return due to llvm lack of such info.

Signed-off-by: Luo &lt;xionghu.luo@intel.com&gt;
Reviewed-by: Zhigang Gong &lt;zhigang.gong@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
