def build_constructor_overloads(base_type, vty_name, num_elements, arglists, l):
    """
    For a given vector type, build a list of overloads for its constructor.
    """

    # TODO: speed up with memoization
    if num_elements == 0:
        arglists.append(l[:])

    for i in range(1, num_elements + 1):
        if i == 1:
            # For 1-element component, it can construct with either a
            # primitive type or other 1-element component.
            l.append(base_type)
            build_constructor_overloads(
                base_type, vty_name, num_elements - i, arglists, l
            )
            l.pop(-1)

            l.append(vector_types[f"{vty_name[:-1]}1"])
            build_constructor_overloads(
                base_type, vty_name, num_elements - i, arglists, l
            )
            l.pop(-1)
        else:
            l.append(vector_types[f"{vty_name[:-1]}{i}"])
            build_constructor_overloads(
                base_type, vty_name, num_elements - i, arglists, l
            )
            l.pop(-1)

    For a given vector type, build a list of overloads for its constructor.
    
numba/cuda/vector_types.py