C++ AMP is no longer working

Hi,

Switching from UE 4.9 (VS2013) to UE 4.10 (VS2015), both under Win10 64bit.

If I include “amp.h” compilation fails reporting this:

Error C2226 syntax error: unexpected
type 'DWORD’C:\Program Files
(x86)\Microsoft Visual Studio
14.0\VC\INCLUDE\concrt.h(63): error C2226: syntax error: unexpected type
‘DWORD’ TestAMP C:\Program Files
(x86)\Microsoft Visual Studio
14.0\VC\INCLUDE\concrt.h 63

It was working fine in 4.9 and is still working in other projects.

To reproduce the error simple create a new actor and paste this on the top:

#include "AllowWindowsPlatformTypes.h"
#include <amp.h>
#include "HideWindowsPlatformTypes.h"

C++ AMP is a library for GPGPU included in VS, everyone has it, so, trying this is super fast.

Thanks

Hey Pixel452-

I tested this and received the same error you mentioned however I did find that I did not receive this error when testing on an updated internal build. It appears that this is an issue with VS2015 so doing this should allow you to build your project if you force 2013 instead. If you’re using a source version of the engine you can force the engine to build in 2013 by passing -2013 as a command line argument when running GenerateProjectFiles.bat.

Cheers

Thank you so much, I will try to compile the 4.10 forcing VS2013 on another PC.
Can I expect to see this issue solved in the next release of UE?

If this is a VS2015 problem, can we say something more specific to the VS team to help them? But then, why the internal release works, sounds like there’s something going on in the code. I use AMP in other projects and haven’t had any issues so far.

Thanks again

With the number of tasks being worked on I can’t say for certain if a certain fix will be included or not. Are you using this in other 4.10 projects? If so does the setup match the steps you mentioned above (adding the includes in an actor class)

For other projects I meant outside UE, C++ AMP by itself works fine, it’s the combination with UE4 that creates the problem.

Is there any way to get the fix from github?

There is not a specific commit that fixed this issue. It is most likely something that changed in Visual Studio between 2013 and 2015 that affected the way that AMP is included in unreal projects.

Well, if I get the main branch I should be fine then?

Be aware that is not amp by itself that causes the problem, but “concrt.h”, this header is used by the PPL library also. The problem is present even if you use tasks :frowning: