[cfe-commits] [PATCH] OpenCL error for elements in a struct with different addr spaces

John McCall rjmccall at apple.com
Thu Jun 14 11:52:18 PDT 2012


On Jun 14, 2012, at 11:38 AM, John McCall wrote:
> On Jun 13, 2012, at 1:13 PM, Tanya Lattner wrote:
>> OpenCL does not allow elements of a struct to be in different address spaces. The attached patch checks for this and throws an error. It includes a test case.
>> 
>> Please review.
> 
> This is very strange.  Why does OpenCL allow elements of a struct to have an address space at all?  Is this just a way to say that the struct itself is always in some address space?

Oh, I see that my mail client is just screwing up the threading.

If the intent of OpenCL is that a struct with (e.g.) all-__local fields is implicitly __local itself, that's something that requires more careful support from the compiler.  I would much rather refuse to accept a construct that we don't support correctly than implement a restriction on it and then miscompile.

John.



More information about the cfe-commits mailing list