Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at testCSCudaBinoDll.Class1.TestCheckCudaDevice()
at testCSCudaBinoDll.Class1.Main(String args)
What do you think may be the problem of this error? Or how can I make it work?
PS: The c++ version of executable works well with the dll.
CUDA works with DLLs as long as they are not loaded dynamically, so this should work. Just remember to export your DLL functions as extern “C” and don’t use C++ features in the interface. Then you should be able to use them from C# just like you can from C++.
hmm… Still no luck. I think I am wrapping things in dll using the very primitve c langurage. From the output you will find out that the printf() works fine. The CUD_CHECK_DEVICE will fail claiming null pointer some where.
Is there any way we can force c# to ‘not’ dynamically load those dll but brute forth load them?