
    `i                         d dl Z d dlmZ d dlZd dlmZ d dlmZm	Z	 d Z
 G d de	          Zedk    r ej                     dS dS )	    N)Queue)cuda)unittestContextResettingTestCasec                 V   	 t          j        d           t          j                    }t          j        d          }t          j        ||          }|                                 ~~t          j                     d S # t          $ r }| 	                    |           Y d }~d S d }~ww xY w)Nr   d   )stream)
r   select_devicer	   nparange	to_devicesynchronizeclose	Exceptionput)exception_queuer	   AdAes        /home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/numba/cuda/tests/cudadrv/test_select_device.py	newthreadr      s    
1IcNN^Af---
   As   A:A> >
B(B##B(c                       e Zd Zd ZdS )TestSelectDevicec                    t                      }t          d          D ]F}t          j        t          |f          }|                                 |                                 Gg }|                                s;|                    |	                                           |                                ;| 
                    |g            d S )N
   )targetargs)r   range	threadingThreadr   startjoinemptyappendgetassertEqual)selfr   it
exceptionss        r   test_select_devicez#TestSelectDevice.test_select_device   s    ''r 	 	A 	8JKKKAGGIIIFFHHHH
!'')) 	5o1133444 "'')) 	5R(((((    N)__name__
__module____qualname__r+    r,   r   r   r      s#        
) 
) 
) 
) 
)r,   r   __main__)r   queuer   numpyr   numbar   numba.cuda.testingr   r   r   r   r-   mainr0   r,   r   <module>r7      s                        A A A A A A A A  ) ) ) ) )/ ) ) ) zHMOOOOO r,   