'Push a context for the given GPU or create a new one if no context
exist for the given GPU.'

def push_context(self, gpu):

    if (self.context_stack.is_empty or (self.current_context.device != gpu)):
        ctx = self._get_or_create_context(gpu)
    else:
        ctx = self.current_context
    self.context_stack.push(ctx)
    return ctx
