Optimization of cuda transfers between contexts.