Pergunta

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

Foi útil?

Solução

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
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top