[OpenCL] change default address space of pointers in CL2.0 mode

Anastasia Stulova anastasia.stulova at arm.com
Mon Nov 17 10:41:36 PST 2014

Hi Pekka,

With the current proposed change it seems to be difficult to have kernel
function parameters handled differently. I might need to change the
implementation completely. Also I now see that an error has to be added in
case kernel parameter has a generic address space.

Perhaps, I will try to rework this change!

One of the difficulty is that Clang currently treats private address space
just the same as if no address space qualifier was specified. That makes it
difficult to find a right place to handle the default address space
behaviour, because information becomes unavailable early on.

I will see if I can do some sort of reparsing. Or another way could be to
introduce private as an explicit address space in Clang, such that we can
distinguish clearly at any step whether the qualifier was explicitly
provided or not. But I believe it might affect a lot of code because Clang
relies on this behaviour in some cases. 


-----Original Message-----
From: Pekka Jääskeläinen [mailto:pekka.jaaskelainen at tut.fi] 
Sent: 12 November 2014 09:34
To: Anastasia Stulova; cfe-commits at cs.uiuc.edu
Subject: Re: [OpenCL] change default address space of pointers in CL2.0 mode


What about kernel functions? They should not allow the generic address
space. Is the check for this going to be in another patch?

If not, could this have a test for the kernel function special case as well?
Now it tests only helper/device functions.

Should it also test the default AS of function local pointer variables?
Now only function argument pointers are tested.

On 11/11/2014 08:27 PM, Anastasia Stulova wrote:
> Hello,
> This patch mainly implement the following requirement from OpenCLv2.0 C
spec s6.5:
> “Pointers that are declared without pointing to a named address space 
> point to the generic address space.”
> Note,  that a named address space is any of those that existed in the 
> previous standards, i. e. __global, __local,  __private, or __constant.
> This patch depends on the change submitted previously:
> https://www.mail-archive.com/cfe-commits@cs.uiuc.edu/msg109232.html
> Thanks,
> Anastasia
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits


More information about the cfe-commits mailing list