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?
There are a few GPU options for C#, for direct access without reverting to P/Invoke or writing your own C++ wrappers:
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.
It is not an option. You'll have to P/Invoke a function in DLL that was generated by MASM or written in unmanaged C/C++, using inline assembly or intrinsics. Or use the C++/CLI compiler and generate mixed mode code with #pragma managed.
Beware that you now can no longer depend on the JIT compiler generating whatever platform code is suitable for the operating system. Use Project + Properties, Build tab, Platform Target to force the architecture to match your unmanaged code.
Look at CUDA for managed GPU code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With