On 08/07/2013 03:52 PM, Michele Scandale wrote:> > In the opencl specification is said that the four address spaces are > disjoint, so my conclusion of non aliasing with the others.In OpenCL 2.0, you can cast between the generic address space and global/local/private, so there's also that to consider.
On 2013-08-07, at 18:55 , Matt Arsenault <Matthew.Arsenault at amd.com> wrote:> On 08/07/2013 03:52 PM, Michele Scandale wrote: >> >> In the opencl specification is said that the four address spaces are disjoint, so my conclusion of non aliasing with the others. > In OpenCL 2.0, you can cast between the generic address space and global/local/private, so there's also that to consider.I believe this just means that there is a single equivalent of "void*" that can hold all kinds of pointers and address spaces. Casting forth and back must preserve the address space. If I read the standard correctly, the OpenCL compiler may also compile functions several times, once for each combination of address spaces. -erik -- Erik Schnetter <schnetter at gmail.com> http://www.perimeterinstitute.ca/personal/eschnetter/ My email is as private as my paper mail. I therefore support encrypting and signing email messages. Get my PGP key from http://pgp.mit.edu/.
On 08/08/2013 12:55 AM, Matt Arsenault wrote:> On 08/07/2013 03:52 PM, Michele Scandale wrote: >> >> In the opencl specification is said that the four address spaces are >> disjoint, so my conclusion of non aliasing with the others. > In OpenCL 2.0, you can cast between the generic address space and > global/local/private, so there's also that to consider. >Thanks for correction. My reference was the opencl 1.2 specification. Considering the case of OpenCL 2.0 IMO we would have another address space that contains the private, the global and the local address spaces. -Michele
It's not clear to me how this would work for targets that use the same physical address space for multiple language-specific address spaces. If a target maps both constant and global to address space 42 (for example), how would the optimizer differentiate between these two? On Wed, Aug 7, 2013 at 7:15 PM, Michele Scandale <michele.scandale at gmail.com> wrote:> On 08/08/2013 12:55 AM, Matt Arsenault wrote: > >> On 08/07/2013 03:52 PM, Michele Scandale wrote: >> >>> >>> In the opencl specification is said that the four address spaces are >>> disjoint, so my conclusion of non aliasing with the others. >>> >> In OpenCL 2.0, you can cast between the generic address space and >> global/local/private, so there's also that to consider. >> >> Thanks for correction. My reference was the opencl 1.2 specification. > > Considering the case of OpenCL 2.0 IMO we would have another address space > that contains the private, the global and the local address spaces. > > > -Michele > > ______________________________**_________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev> >-- Thanks, Justin Holewinski -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130807/8fefa6f6/attachment.html>
On 08/07/2013 04:07 PM, Erik Schnetter wrote:> On 2013-08-07, at 18:55 , Matt Arsenault <Matthew.Arsenault at amd.com> wrote: > >> On 08/07/2013 03:52 PM, Michele Scandale wrote: >>> In the opencl specification is said that the four address spaces are disjoint, so my conclusion of non aliasing with the others. >> In OpenCL 2.0, you can cast between the generic address space and global/local/private, so there's also that to consider. > > I believe this just means that there is a single equivalent of "void*" that can hold all kinds of pointers and address spaces. Casting forth and back must preserve the address space. If I read the standard correctly, the OpenCL compiler may also compile functions several times, once for each combination of address spaces. > > -erik >Allowing casts to the specific address spaces makes that not work in the general case. For example, a function like this could not simply be duplicated for each address space and have it still work: void foo(int* x, int is_local) { if (is_local) { local int* y = (local int*) x; // ... } else { global int* z = (global int*) z; // ... } }