Basically the question is how do I run gpgpu code in a Metro app. The library doesn’t need to be dedicated to computing, for example, using XNA’s hlsl (originally intended to render things) for general computing (XNA is not included in Metro, hence my problem). A default Metro library is preferred over a reference to a external one.
I realize that one may call core DirectX functions in C++, however, I am asking if it is possible to use the gpu in C# in a metro app.
I didn’t think it was possible, actually, but when looking for a link to prove its impossibility, I came up with references to SharpDX, which purports to being a managed DirectX wrapper that will also support Win8 Metro applications. See this SharpDX sample project, which includes a .hlsl file, to learn more.
This isn’t my area of expertise, so I have no idea whether this will even work; also, I have to wonder how they can do this and still allow the app to be certified for sale in the Store. But depending on your requirements, this might be something to check out.
(Note: the first link does claim that the “[n]ext version of SharpDX will provide assemblies that will be fully compatible and certified-ready for Win8 Metro style application,” so their intention is clear. My remark above about certification is just that it sounds like this would need to do interop I wasn’t aware is allowed in such apps, so they might be optimistic about it. I could be totally wrong, though.)