kunzmi / managedCuda

ManagedCUDA aims an easy integration of NVidia's CUDA in .net applications written in C#, Visual Basic or any other .net language.
Other
440 stars 79 forks source link

CudaContext created with #101

Closed dje-dev closed 3 years ago

dje-dev commented 3 years ago

I believe there may be a bug with this method. If called with createNew=false, the code calls cuCtxGetCurrent and returns the context if found. The problem is that the returned context might happen to be on a different deviceId from the one requested, in which case the returned CudaContext is incorrect.

    public CudaContext(int deviceId, bool createNew)
kunzmi commented 3 years ago

Hi, you're right, I was testing this only on a single device machine where, obviously, this cannot happen. I'll look into it as soon as I'll find a bit of time. (while I also realized that I never pushed any CUDA updates to the repository...)

kunzmi commented 3 years ago

Fixed in latest commit