C++ AMP

Hi.

New here. Tried searching for any discussions about C++ AMP but did
not find anything.
I am wondering if there are any plans or projects by anyone to support
C++ AMP extensions through Clang?

rahul

Not currently. There is much work to be done outside of AMP on Windows, so until we make headway there, it doesn’t make much sense to look at AMP specifically.

Hi.

New here. Tried searching for any discussions about C++ AMP but did
not find anything.
I am wondering if there are any plans or projects by anyone to support
C++ AMP extensions through Clang?

Not currently. There is much work to be done outside of AMP on Windows, so until we make headway there, it doesn’t make much sense to look at AMP specifically.

C++AMP would be useful on non-Windows platforms, so I don’t think there needs to be any dependency between the two.

I agree. This was my response (which I forgot to send to list earlier):

Thanks for the response! I am more interested in looking at AMP on
Linux or OSX actually. Looking at AMP's specification, it should be
possible to implement most of it on top of OpenCL, except the Direct3D
specific bits that are optional in the spec anyway. I guess I will
keep a lookout for such projects in the future.

thanks,
Rahul

I see no particular reason to aim to support AMP only on Windows.
Personally, I would be more interested in a Linux implementation.

John Bytheway

>
> Hi.
>
> New here. Tried searching for any discussions about C++ AMP but
> did not find anything.
> I am wondering if there are any plans or projects by anyone to
> support C++ AMP extensions through Clang?
>
>
> Not currently. There is much work to be done outside of AMP on
> Windows, so until we make headway there, it doesn't make much sense
> to look at AMP specifically.

I see no particular reason to aim to support AMP only on Windows.
Personally, I would be more interested in a Linux implementation.

Out of curiosity, what does 'supporting AMP' mean in this context.
Aside from the tile_static storage-class specifier and the
restrict(amp) clause, is the rest of it just a template library, or
would other frontend modifications be necessary?

-Hal

Out of curiosity, what does ‘supporting AMP’ mean in this context.
Aside from the tile_static storage-class specifier and the
restrict(amp) clause, is the rest of it just a template library, or
would other frontend modifications be necessary?

AMP defines a set of rules for functions decorated with restrict(amp) clause. I would think checking for those rules is frontend’s job. Now, most of those rules arise because AMP is targeting DirectX. If the Linux version is targeting OpenCL, then some of those rules could go away, but I would still think some work has to be done in the frontend for checking target compatibility.

Manjunath

    Hi.

    New here. Tried searching for any discussions about C++ AMP but
did not find anything.
    I am wondering if there are any plans or projects by anyone to
support C++ AMP extensions through Clang?

Not currently. There is much work to be done outside of AMP on
Windows, so until we make headway there, it doesn't make much sense
to look at AMP specifically.

I see no particular reason to aim to support AMP only on Windows.
Personally, I would be more interested in a Linux implementation.

Out of curiosity, what does 'supporting AMP' mean in this context.

I presume it means implementing the specification:
<http://download.microsoft.com/download/4/0/E/40EA02D8-23A7-4BD2-AD3A-0BFFFB640F28/CppAMPLanguageAndProgrammingModel.pdf>

Aside from the tile_static storage-class specifier and the
restrict(amp) clause, is the rest of it just a template library, or
would other frontend modifications be necessary?

I see some classes use __declspec(property(get)), which is a bit silly.
It looks like the spec is also assuming sizeof(long)==4, which could be
a problem.

John Bytheway

We're in discussion with MS about supporting C++ AMP and thoughts/feedback/suggestions are greatly welcomed. We're still on the fence about it, but if you think it would be useful we want to know.

sizeof(long)==4 - I wonder if this is a byproduct of MS using LLP64

Hi,

   Hi.

   New here. Tried searching for any discussions about C++ AMP but
did not find anything.
   I am wondering if there are any plans or projects by anyone to
support C++ AMP extensions through Clang?

Not currently. There is much work to be done outside of AMP on
Windows, so until we make headway there, it doesn't make much sense
to look at AMP specifically.

I see no particular reason to aim to support AMP only on Windows.
Personally, I would be more interested in a Linux implementation.

Out of curiosity, what does 'supporting AMP' mean in this context.

I presume it means implementing the specification:
<http://download.microsoft.com/download/4/0/E/40EA02D8-23A7-4BD2-AD3A-0BFFFB640F28/CppAMPLanguageAndProgrammingModel.pdf>

We are planning to implement a subset of C++AMP targetting OpenCL on Linux. Obviously minus the MS specific stuff in the specification.

Aside from the tile_static storage-class specifier and the
restrict(amp) clause, is the rest of it just a template library, or
would other frontend modifications be necessary?

I see some classes use __declspec(property(get)), which is a bit silly.
It looks like the spec is also assuming sizeof(long)==4, which could be
a problem.

There are some parts of the spec that lead to FE changes.

For a simplified example, suppose we have a greatly simplified container class myarray that is holds a GPU-side array (which is an OpenCL buffer underneath). Now, the only permitted way in C++AMP to pass it from host to the GPU side is to enclose the object in a functor that is passed to parallel_for_each.

  On the host-side, myarray is defined like: class myarray { cl_mem p; }

  On the GPU side, the cl_mem has to be converted to a __global pointer through clSetKernelArg before it can be used inside the kernel.

This implies that
1) myarray would somehow look different on the GPU side like: class myarray { __global T *p; } and,
2) one way to make it work is to serialize the myarray through a series of clSetKernelArgs and then reconstructed on the device side using the GPU-side declaration using the arguments of the kernel. Now this would mean some form of automatic serialization/deserialization code being generated by clang for such a functor class, as this involves introspecting arbitrary functor given by the user and AFAIK it cannot be done with just templates in C++.

Regards,
Ray