def METHOD_NAME(
    output: DeferredArray, input: DeferredArray, argsort: bool, stable: bool
) -> None:
    task = output.context.create_auto_task(CuNumericOpCode.SORT)
    uses_unbound_output = output.runtime.num_procs > 1 and input.ndim == 1
    task.add_input(input.base)
    if uses_unbound_output:
        unbound = output.runtime.create_unbound_thunk(
            dtype=output.base.type, ndim=1
        )
        task.add_output(unbound.base)
    else:
        task.add_output(output.base)
        task.add_alignment(output.base, input.base)
    if output.runtime.num_gpus > 1:
        task.add_nccl_communicator()
    elif output.runtime.num_gpus == 0 and output.runtime.num_procs > 1:
        task.add_cpu_communicator()
    task.add_scalar_arg(argsort, ty.bool_)  # return indices flag
    task.add_scalar_arg(input.base.shape, (ty.int64,))
    task.add_scalar_arg(stable, ty.bool_)
    task.execute()
    if uses_unbound_output:
        output.base = unbound.base
        output.numpy_array = None