o
    X۷i                     @  sd   d dl mZ d dlZd dlmZmZ e r&d dlZeeddZ	dd Z
ndd	 ZeZ
d
d ZdS )    )annotationsN)is_availablecheck_availableCUPY_TEST_GPU_LIMITz-1c                  O  s   t jj| i |S )N)pytestmarkslowargskwargs r   H/home/ubuntu/vllm_env/lib/python3.10/site-packages/cupy/testing/_attr.pyr      s   r   c                  O  s   t d J )Nzpytest attributesr   r	   r   r   r   _dummy_callable   s   r   c                   s$   t d d k s
J  fdd}|S )a{  Decorator to indicate number of GPUs required to run the test.

    Tests can be annotated with this decorator (e.g., ``@multi_gpu(2)``) to
    declare number of GPUs required to run. When running tests, if
    ``CUPY_TEST_GPU_LIMIT`` environment variable is set to value greater
    than or equals to 0, test cases that require GPUs more than the limit will
    be skipped.
    zmulti_gpu attribute   c                   s6   t jjdt  ko k n  d dt j| S )Nr   z{} GPUs required)reason)r   r   skipif
_gpu_limitformat	multi_gpu)fgpu_numr   r   _wrapper(   s   
zmulti_gpu.<locals>._wrapperr   )r   r   r   r   r   r      s   
r   )
__future__r   oscupy.testing._pytest_implr   r   r   intgetenvr   r   r   r   r   r   r   r   <module>   s    
