[Libclc-dev] Beignet wants to apply libclc

He Junyan junyan.he at inbox.com
Wed Sep 17 08:09:10 PDT 2014



On 三, 2014-09-17 at 06:57 -0700, Tom Stellard wrote:
> On Wed, Sep 17, 2014 at 03:44:51PM +0800, He Junyan wrote:
> > 
> > On 二, 2014-09-16 at 10:33 -0400, Tom Stellard wrote:
> > > On Tue, Sep 16, 2014 at 09:26:27PM +0800, He Junyan wrote:
> > > > hi,
> > > > 
> > > > I am a developer of Intel's open source CL stack, which name is Beignet.
> > > > We used to include all the CL built-ins in one huge header file and
> > > > compile it as a PCH.
> > > > We find some disadvantages of that manner and switched to the same
> > > > manner as libclc recently. We now have a internal lib, which play the
> > > > same role as the libclc, and we are attempting to apply the libclc to
> > > > replace it in the near future.
> > > > But I find some problems when I try to integrate the libclc:
> > > > 1. There is no support for Image related functions in it now. Is that on
> > > > your plan?
> > > 
> > > libclc only supports GPU targets and these targets require target-specific
> > > implementations of the image functions, which is why there are no
> > > generic image functions.  If you were to use libclc for Intel GPUs, you
> > > would need to implement your own target specific image functions.
> > > 
> > OK, get it. The image module is really specific for each vendor and some
> > of them do not want to expose the HW details to the public.
> > 
> 
> In the case of AMD, it's not because we don't want to expose HW details.
> We have already done this.  It's just that no one has had time to
> implement the builtins yet.
> 
> > > > 2. I find it is not compatible with OpenCL1.2, which Beignet must
> > > > support, are you going to implement it?
> > > 
> > > In what way is it not compatible?  The goal is to implement everything,
> > > but as far as I know no one has spent much time on OpenCL 1.2 features.
> > > 
> > The beignet has declared the full support for 1.2, but if we use clc, we
> > have to fallback to 1.1, this seems weird. 
> > So far as I know, there are really some changes for CL APIs between 1.1
> > and 1.2, but for the builtin functions and defines, the changes are not
> > so big. The major changes are: adding 1d image and sampler-less image
> > read functions, adding printf function, and adding extern and static
> > keyword support. And the image module is even not included in clc, so I
> > think this is not a big task to support 1.2, and I can do that job if
> > you do not mind.
> > 
> 
> Feel free to add any 1.2 features to libclc that you want.  As you say, I
> don't think there are many changes in the builtin library from 1.1 to 1.2.
> 
> As for extern and static, this is handled by clang and not libclc.  If you
> pass -cl-std=CL1.2 to clang, it should automatically enable these features.

really true, new clang version has supported it and I just found it
recently.

I now get it and will try to integrate intel's implementation into CLC

thanks for your information.

> 
> -Tom
> 
> 
> > > > 3. Because beignet as a backend does not completely follow the PTX or
> > > > NVPTX framework, it has a lot of internal implementations for the
> > > > builtin functions. We may need to add a lot of files for it, is that
> > > > acceptable?
> > > 
> > > Yes, if you are adding a new target with a lot of target specific
> > > implementations, then it is not a problem if there are a lot of files.
> > > 
> > OK, I will consider how to integrate our implementation and maximize the
> > use of the clc's code.
> > 
> > > -Tom
> > > 
> > > > 
> > > > 
> > > > Thanks
> > > > 
> > > > 
> > > > 
> > > > 
> > > > _______________________________________________
> > > > Libclc-dev mailing list
> > > > Libclc-dev at pcc.me.uk
> > > > http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev
> > 
> > 
> > 







More information about the Libclc-dev mailing list