[cfe-dev] Class instance with address space

Jon Chesterfield via cfe-dev cfe-dev at lists.llvm.org
Wed Jan 22 07:40:10 PST 2020


Hi Bevin,

Thanks for the link! I like the approach, though the complexity makes me
nervous. I think that's more power than my immediate problems require.

An offline discussion suggested exposing the opencl qualifiers (e.g.
__local) for other languages. I haven't written the patch yet but am
cautiously optimistic.

Jon

On Wed, 22 Jan 2020, 14:50 Bevin Hansson, <bevin.hansson at ericsson.com>
wrote:

> Hi Jon,
>
> There's currently no way to qualify a method with an arbitrary address
> space. There is a work-in-progress patch on it:
>
> https://reviews.llvm.org/D57464
>
> and I have an experimental local patch that tries to alleviate some issues
> with the patch above, but it doesn't really work. Parsing this pattern
> properly is unfortunately rather difficult. There's also no real syntax
> support in C++ for qualified constructors/destructors, which is another
> problem.
>
> / Bevin
> On 2020-01-22 04:51, Jon Chesterfield via cfe-dev wrote:
>
> C++ source, compiled as clang++ --target=amdgcn-amd-amdhsa
>
> struct t
> {
>   int v;
> };
> __attribute__((address_space(3))) t d;
>
> // error: no matching constructor for initialization of
> '__attribute__((address_space(3)))
>
> with  t() : v(0) {}, same error
>
> with  t() __attribute__((address_space(3))) : v(0) {},
> // error: function type may not be qualified with an address space
>
> How should I be spelling this? I'm essentially trying to replicate cuda's
> __shared__. Ideally I'd like implicit conversions to a and from an int
> which is not address space qualified, but right now I'm stuck on the
> constructor.
>
> Thanks,
>
> Jon
>
> _______________________________________________
> cfe-dev mailing listcfe-dev at lists.llvm.orghttps://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200122/6bba20fb/attachment.html>


More information about the cfe-dev mailing list