[cfe-dev] [OpenCL patch] kernel attributes implementation

Pekka Jääskeläinen pekka.jaaskelainen at tut.fi
Mon Jan 2 03:12:36 PST 2012


Hi Guy,

Could you change your patch to implement the attributes for
all targets like discussed below? Otherwise I have to soon
resubmit this work to make these features work for all
targets supported by pocl (which covers all "non-SIMT" LLVM targets
at the moment) which feels a bit like wasted rework.

I originally implemented the reqd_work_group_size attribute
as metadata for all targets (instead of the TCE target specific
implementation) which was rejected. But as the new discussion
didn't bring any reasons against having these attributes as
metadata by default, I'd propose resubmitting your patches with
generic implementation next to the opencl.kernels metadata.

The actual OpenCL implementations can ignore the spurious
metadata at will or convert it to intrinsics or whatever
is the best for the case. Certainly the harm should be
insignificant in such cases. The immediate benefit is that
these attributes can then be supported by (at least) the pocl
OpenCL implementation for all LLVM targets.

20.12.2011 13:12, Benyei, Guy kirjoitti:
> Hi Pekka,
>
> I agree that the right place to implement OpenCL specific metadata
> shouldn't be in target specific, since the attributes are not target
> specific. IMO, the right solution would be to implement this metadata
> in CodeGenFunction.cpp, next to the implementation of the
> "opencl.kernels" metadata.
>
> Anyway, I chosen to implement is for the TCE target only due to the
> fact that reqd_work_group_size is implemented in this target only. It
> can be changed, of course.
>
> Thanks Guy
>
> -----Original Message----- From: cfe-dev-bounces at cs.uiuc.edu
> [mailto:cfe-dev-bounces at cs.uiuc.edu] On Behalf Of Pekka J??skel?inen
> Sent: Tuesday, December 20, 2011 12:50 To: cfe-dev at cs.uiuc.edu
> Subject: Re: [cfe-dev] [OpenCL patch] kernel attributes
> implementation
>
> On 12/20/2011 11:18 AM, Benyei, Guy wrote:
>> I've implemented the handling of these new attributes in the TCE
>> target info, since reqd_work_group_size attribute is already
>> implemented there. I also use this target for testing.
>
> Thanks! :)
>
> There was some discussion about implementing these OpenCL C kernel
> attributes some time ago [1]. The discussion somehow died.
>
> The question raised there was why cannot we add these by default
> when compiling OpenCL? This would enable pocl [2] to support these
> OpenCL features for all LLVM targets. The OpenCL implementations that
> implement the attributes in some other way can just ignore the
> metadata (except the required work group size cannot be just ignored,
> AFAIK).
>
> [1]
> http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-December/046204.html
> [2] https://launchpad.net/pocl
>


-- 
Pekka Jääskeläinen




More information about the cfe-dev mailing list