Add destructors to clean up GPU memory.