Reputation: 2259
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 =)
Upvotes: 1
Views: 734
Reputation: 63732
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
}
Upvotes: 4