o
    Y۷i                     @  s~  d Z ddlmZ ddlmZ ddlmZ er<ddlm	Z	m
Z
mZmZ ddlmZmZmZmZ ddlmZ dd	lmZmZ ed
e er9dddZdddZdddZdddZdddZdddZdddZdd d!Zdd"d#Zdd&d'Z dd)d*Z!dd0d1Z"dd2d3Z#dd5d6Z$dd8d9Z%dd;d<Z&dd>d?Z'dd@dAZ(ddCdDZ)ddFdGZ*ddIdJZ+ddLdMZ,ddOdPZ-ddRdSZ.ddUdVZ/ddXdYZ0dd[d\Z1dd]d^Z2dd`daZ3ddcddZ4ddfdgZ5ddidjZ6ddldmZ7ddodpZ8ddrdsZ9ddtduZ:ddwdxZ;ddzd{Z<dd|d}Z=dddZ>dddZ?dddZ@dddZAdddZBdddZCdddZDdddZEdddZFdddZGg dZHdS )z FFI API for namespace `testing`.    )annotations   )init_ffi_api)TYPE_CHECKING)MappingMutableMappingMutableSequenceSequence)DeviceObjectTensordtype)TestIntPair)AnyCallabletesting_0r   returnintc                C     d S N r   r   r   N/home/ubuntu/vllm_env/lib/python3.10/site-packages/tvm_ffi/testing/_ffi_api.pyTestIntPairSum&       r   c                C  r   r   r   r   r   r   r   add_one'   r   r   argsr   c                  G  r   r   r   r   r   r   r   apply(   r   r   c                  G  r   r   r   r   r   r   r   echo)   r   r    c                   C  r   r   r   r   r   r   r   get_add_one_c_symbol*   r   r!   c                   C  r   r   r   r   r   r   r   get_mlir_add_one_c_symbol+   r   r"   r   c                   C  r   r   r   r   r   r   r   make_unregistered_object,   r   r#   c                  G  r   r   r   r   r   r   r   nop-   r   r$   c                C  r   r   r   r   r   r   r   object_use_count.   r   r%   Tensor | Noneboolc                C  r   r   r   r   r   r   r   optional_tensor_view_has_value/   r   r(   Nonec                C  r   r   r   r   r   r   r   run_check_signal0   r   r*   Sequence[int | None]_1Mapping[str, Sequence[int]]_2
str | Nonec                C  r   r   r   )r   r,   r.   r   r   r   schema_arr_map_opt1   r   r0   c                C  r   r   r   r   r   r   r   schema_id_any2   r   r1   Sequence[Any]c                C  r   r   r   r   r   r   r   schema_id_arr3   r   r3   Sequence[int]c                C  r   r   r   r   r   r   r   schema_id_arr_int4   r   r5   Sequence[Object]c                C  r   r   r   r   r   r   r   schema_id_arr_obj5   r   r7   Sequence[str]c                C  r   r   r   r   r   r   r   schema_id_arr_str6   r   r9   c                C  r   r   r   r   r   r   r   schema_id_bool7   r   r:   bytesc                C  r   r   r   r   r   r   r   schema_id_bytes8   r   r<   r
   c                C  r   r   r   r   r   r   r   schema_id_device9   r   r=   MutableMapping[str, int]c                C  r   r   r   r   r   r   r   schema_id_dict_str_int:   r   r?   MutableMapping[str, str]c                C  r   r   r   r   r   r   r   schema_id_dict_str_str;   r   rA   r   c                C  r   r   r   r   r   r   r   schema_id_dltensor<   r   rB   r   c                C  r   r   r   r   r   r   r   schema_id_dtype=   r   rC   floatc                C  r   r   r   r   r   r   r   schema_id_float>   r   rE   Callable[..., Any]c                C  r   r   r   r   r   r   r   schema_id_func?   r   rG   0Callable[[int, float, Callable[..., Any]], None]c                C  r   r   r   r   r   r   r   schema_id_func_typed@   r   rI   c                C  r   r   r   r   r   r   r   schema_id_intA   r   rJ   MutableSequence[int]c                C  r   r   r   r   r   r   r   schema_id_list_intB   r   rL   MutableSequence[Object]c                C  r   r   r   r   r   r   r   schema_id_list_objC   r   rN   MutableSequence[str]c                C  r   r   r   r   r   r   r   schema_id_list_strD   r   rP   Mapping[Any, Any]c                C  r   r   r   r   r   r   r   schema_id_mapE   r   rR   Mapping[str, int]c                C  r   r   r   r   r   r   r   schema_id_map_str_intF   r   rT   Mapping[str, Object]c                C  r   r   r   r   r   r   r   schema_id_map_str_objG   r   rV   Mapping[str, str]c                C  r   r   r   r   r   r   r   schema_id_map_str_strH   r   rX   c                C  r   r   r   r   r   r   r   schema_id_objectI   r   rY   
int | Nonec                C  r   r   r   r   r   r   r   schema_id_opt_intJ   r   r[   Object | Nonec                C  r   r   r   r   r   r   r   schema_id_opt_objK   r   r]   c                C  r   r   r   r   r   r   r   schema_id_opt_strL   r   r^   strc                C  r   r   r   r   r   r   r   schema_id_stringM   r   r`   c                C  r   r   r   r   r   r   r   schema_id_tensorN   r   ra   	int | strc                C  r   r   r   r   r   r   r   schema_id_variant_int_strO   r   rc   c                   C  r   r   r   r   r   r   r   schema_no_argsP   r   rd   c                   C  r   r   r   r   r   r   r   schema_no_args_no_returnQ   r   re   c                C  r   r   r   r   r   r   r   schema_no_returnR   r   rf   c                  G  r   r   r   r   r   r   r   schema_packedS   r   rg   c                C  r   r   r   r   r   r   r   schema_tensor_view_inputT   r   rh   int | str | Sequence[int]c                C  r   r   r   r   r   r   r   schema_variant_mixU   r   rj   c                C  r   r   r   )r   r,   r   r   r   test_raise_errorV   r   rk   )1r   r   r   r    r!   r"   r#   r$   r%   r(   r*   r0   r1   r3   r5   r7   r9   r:   r<   r=   r?   rA   rB   rC   rE   rG   rI   rJ   rL   rN   rP   rR   rT   rV   rX   rY   r[   r]   r^   r`   ra   rc   rd   re   rf   rg   rh   rj   rk   N)r   r   r   r   )r   r   r   r   )r   r   r   r   )r   r   )r   r   )r   r   r   r   )r   r&   r   r'   )r   r   r   r)   )r   r+   r,   r-   r.   r/   r   r-   )r   r   r   r   )r   r2   r   r2   )r   r4   r   r4   )r   r6   r   r6   )r   r8   r   r8   )r   r'   r   r'   )r   r;   r   r;   )r   r
   r   r
   )r   r>   r   r>   )r   r@   r   r@   )r   r   r   r   )r   r   r   r   )r   rD   r   rD   )r   rF   r   rF   )r   rH   r   rH   )r   rK   r   rK   )r   rM   r   rM   )r   rO   r   rO   )r   rQ   r   rQ   )r   rS   r   rS   )r   rU   r   rU   )r   rW   r   rW   )r   r   r   r   )r   rZ   r   rZ   )r   r\   r   r\   )r   r/   r   r/   )r   r_   r   r_   )r   rb   r   rb   )r   r)   )r   r   r   r)   )r   ri   r   ri   )r   r_   r,   r_   r   r)   )I__doc__
__future__r   registryr   _FFI_INIT_FUNCtypingr   collections.abcr   r   r   r	   tvm_ffir
   r   r   r   tvm_ffi.testingr   r   r   __name__r   r   r   r    r!   r"   r#   r$   r%   r(   r*   r0   r1   r3   r5   r7   r9   r:   r<   r=   r?   rA   rB   rC   rE   rG   rI   rJ   rL   rN   rP   rR   rT   rV   rX   rY   r[   r]   r^   r`   ra   rc   rd   re   rf   rg   rh   rj   rk   __all__r   r   r   r   <module>   sz   

















































