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

CudaSurface always disposes underlying volume #54

Closed HouseOfFinwe closed 6 years ago

HouseOfFinwe commented 6 years ago

The CudaSurface class disposes of the CudaArray3D even when an array is passed to the constructor. There should be a concept of ownership, much like you implemented for the CudaArray3D class, as there are instances when you don't want to dispose of the underlying volume when you no longer need the surface.

P.S. I digress, but please take a look at the suggestion I made in my "unified memory" post for how to make those classes generic without sacrificing performance.