[Beignet] [PATCH] Generate most of the vector builtin functions automatically

Zhigang Gong zhigang.gong at linux.intel.com
Tue Jul 23 01:38:16 PDT 2013


On Tue, Jul 23, 2013 at 04:14:13PM +0800, He Junyan wrote:
> Good python script and decrease the ocl_std header file size a lot.
> 
> 1.There is a typo at backend/src/CMakeLists.txt,   set
> (ocl_blob_c_file ${GBE_SOURCE_DIR}/src/ocl_stdlib_str.c) should be
> .cpp
Thanks to report that, fixed.

> 2. ocl_vector.h seems to be generated every time in build but the
> ocl_as.h, ocl_convert.h  need to be updated using the
> update script. I think we can unify the manner here.
The difference here is due to that the ocl_as.h and ocl_convert.h are
generated by bash scripts which are relatively slow, so that it is not
suitable to do it every build.

The python scripts are much faster than bash script, so do it at each
build time (and actually it's only generated when dependency changed.)
If anybody are interested, you may change all the scripts things to
python latter. Then we can unify the behaviour a little bit here.

> 3. about the pch file, I think I need to do some investigation in
> clang to find the exactly not compatible args. I think now you can
> just use the pch when no buiding args passed, and once there are
> some extra buiding args, totally fallback to the old manner.
Agree. Before you find out all the possible combinations, we can
take this solution.

> 
> 
> 
> On 07/22/2013 04:46 PM, Zhigang Gong wrote:
> >On Fri, Jul 19, 2013 at 05:41:07PM +0800, Zhigang Gong wrote:
> >>Hi,
> >>
> >>As Beignet is using the SOA model, and we need to lower down all
> >>the vector builtin functions to the scalar version. This type of
> >>thing is ideal to use a script to generate all the code according
> >>to the OpenCL's spec. I just copy/paste most of the prototypes from
> >>the OpenCL spec and put them into builtin_vector_proto.def. Then
> >>I wrote a python script to parse the spec and generate all the
> >>vector inline functions and I removed all existing duplicate
> >>functions in ocl_stdlib.h.
> >>
> >>Now we have three parts of auto-generated code, the as/convert and
> >>this vector related functions. The amount of these three parts are
> >>much more than the other code in ocl_stdlib.h. To make the maintainance
> >>easier, I split the auto-generated code out of the ocl_stdlib.h, and
> >>refine the build process to generate one blob header file at build time.
> >>
> >>Then I also made a new patch based on Junyan's PCH patch to accelerate
> >>the cl kernel build speed.
> >>
> >>As this patchset is handling tons of those auto-generated code, the
> >>patch is relatively big. I just attached the compressed tar ball rather
> >>than embed them directly.
> >>
> >>Waiting for your comments. Thanks.
> >Sorry, that I sent the wrong attachment in last email.
> >Now correct it here.
> >
> >>_______________________________________________
> >>Beignet mailing list
> >>Beignet at lists.freedesktop.org
> >>http://lists.freedesktop.org/mailman/listinfo/beignet
> >
> >
> >_______________________________________________
> >Beignet mailing list
> >Beignet at lists.freedesktop.org
> >http://lists.freedesktop.org/mailman/listinfo/beignet
> 

> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet



More information about the Beignet mailing list