def make_pipeline_state(type: PipelineUserType, stages: int):
    """
    Creates a pipeline state. Producers are assumed to start with an empty buffer and have a flipped phase bit of 1.
    """
    if type is PipelineUserType.Producer:
        # return PipelineStateSimple(stages, Int32(1 << 16))
        return PipelineStateSimple(stages, Int32(stages))
    elif type is PipelineUserType.Consumer:
        return PipelineStateSimple(stages, Int32(0))
    else:
        assert (
            False
        ), "Error: invalid PipelineUserType specified for make_pipeline_state."

    Creates a pipeline state. Producers are assumed to start with an empty buffer and have a flipped phase bit of 1.
    
flash_attn/cute/pipeline.py