I saw Daniel Moth's talk at BUILD and was very impressed. I was delighted to learn that I can use AMP from a Metro app. However, it's been many years since I've done any C++ coding and I think the path of least resistance for me would be to code my Metro app in C#/XAML and make calls to AMP via P/Invoke. Traditionally I believe this is done via a C++ DLL that contains the functionality and then a P/Invoke call into that DLL from your C# code. Is this the same approach for Metro apps? I will be passing only 1D arrays of primitive types from C# (Bytes, Floats, Bools).
Lastly, could someone point me to a little tutorial that illustrates this P/Invoke approach? Thank you in advance.
You still need to write some C++ code: C++ AMP algorithm itself and a thin wrapper to get your data in and out. There is a new better way than P/Invoke of interop between C++ and C# - use WinRT types. See "Using the Windows Runtime from C++" TOOL-532T_Sutter BUILD presentation for an overview.
- แก้ไขโดย pauljurczak 18 กันยายน 2554 16:09
We just posted a tutorial and a sample on how to use C++ AMP from C# using P/Invoke: http://blogs.msdn.com/b/pfxteam/archive/2011/09/21/10214538.aspx
In the upcoming days, we also plan to post an article on how to use the new WinRT approach to invoke C++ AMP code from C#.
- เสนอเป็นคำตอบโดย DanielMothMicrosoft, Owner 21 กันยายน 2554 22:57