문제

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 =)

도움이 되었습니까?

해결책

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
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top