Use name.Dispose();
- CudaDeviceVariable
is an IDisposable
.
This also means you can use this handy syntax:
using (var name = new CudaDeviceVariable(length))
{
// do the work
}
Question
I'm using C# with managedCuda lib. I allocate Memory on the GPU with this command: CudaDeviceVariable name = new CudaDeviceVariable(length); and it works fine. But I can not find the command to free it from the GPU.
thank you in advance =)
Solution
Use name.Dispose();
- CudaDeviceVariable
is an IDisposable
.
This also means you can use this handy syntax:
using (var name = new CudaDeviceVariable(length))
{
// do the work
}