def create_signature(retty, args):
    """
    Given the return type and arguments for a libdevice function, return the
    signature of the stub function used to call it from CUDA Python.
    """

    # Any pointer arguments should be part of the return type.
    return_types = [arg.ty for arg in args if arg.is_ptr]
    # If the return type is void, there is no point adding it to the list of
    # return types.
    if retty != void:
        return_types.insert(0, retty)

    if len(return_types) > 1:
        retty = Tuple(return_types)
    else:
        retty = return_types[0]

    argtypes = [arg.ty for arg in args if not arg.is_ptr]

    return signature(retty, *argtypes)

    Given the return type and arguments for a libdevice function, return the
    signature of the stub function used to call it from CUDA Python.
    
numba/cuda/libdevicefuncs.py