[cfe-dev] Class instance with address space

Jon Chesterfield via cfe-dev cfe-dev at lists.llvm.org
Tue Jan 21 19:51:01 PST 2020


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200122/e66e2536/attachment.html>


More information about the cfe-dev mailing list