Executing CPU/GPU instructions from managed code
.net, gpu
Solution
There are a few GPU options for C#, for direct access without reverting to P/Invoke or writing your own C++ wrappers:
- Brahma is quite interesting. It provides access to the GPU directly via a customized LINQ provider. The code includes some samples of highly computational methods run on the GPU, all written in C# via LINQ.
- SlimDX provides a nice .NET wrapper to all of the major DirectX functionality. With custom shaders, you can do computation on the GPU via DirectX. It also includes DX11 support, so you can use the compute shaders directly (if you have the hardware for it).
- You can access CUDA via CUDA.NET.
- You can use OpenCL via OpenCL.NET.
As for CPU instructions, this typically would require dropping to lower level native code with assembler instruction. Probably the most interesting completely managed (at least partially related) option would be to use Mono.Simd, which provides direct access to the SIMD instructions in the CPU from managed code when running on the Mono stack.
Problem
Taking into account the execute disable bit what is the recommended way of executing instructions against a native processor from a high level managed environment such as VB.NET 2008 or C#. In addition has anyone achieved similar in executing GPU instructions against a graphics processor?