o
    8ήcd	                     @   s   d dl Zd dlmZ d dlmZ d dlmZ d dlZG dd de	Z
dd Zd	d
 Zdd ZejdejfgddZG dd deZedkrKe  dS dS )    N)cuda)wrap_arg)CUDATestCasec                   @   s   e Zd Zdd ZdS )	DefaultInc                 K   s   |t |tjdfS )N)default)r   r   In)selftyvalkwargs r   a/tmp/pip-target-vg8gfxp4/lib/python/numba/cuda/tests/cudapy/test_retrieve_autoconverted_arrays.pyprepare_args
   s   zDefaultIn.prepare_argsN)__name__
__module____qualname__r   r   r   r   r   r   	   s    r   c                 C   s   | j t  | S N)
extensionsappendr   )kernelr   r   r   nocopy   s   r   c                 C   s   d| d< d S )N   r   r   )arrr   r   r   set_array_to_three   s   r   c                 C   s   d| d d< d S )Nr   r   br   )recr   r   r   set_record_to_three   s   r   r   T)alignc                       s\   e Zd Z fddZdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dd Z  ZS )TestRetrieveAutoconvertedArraysc                    sF   t    tt| _ttt| _tt| _ttt| _d S r   )	supersetUpr   jitr   r   set_array_to_three_nocopyr   set_record_to_three_nocopy)r   	__class__r   r   r    "   s
   
z%TestRetrieveAutoconvertedArrays.setUpc                 C   s8   t jdt jd}| jd t| | d|d  d S N   dtyper'   r'   r   r   )npzerosint64r   r   InOutassertEqualr   host_arrr   r   r   test_array_inout)      z0TestRetrieveAutoconvertedArrays.test_array_inoutc                 C   s8   t jdt jd}| jd t| | d|d  d S Nr'   r(   r*   r   )r+   r,   r-   r   r   r   r/   r0   r   r   r   test_array_in.   r3   z-TestRetrieveAutoconvertedArrays.test_array_inc                 C   s2   t jdt jd}| jd | | d|d  d S r4   )r+   r,   r-   r"   r/   r0   r   r   r   test_array_in_from_config3      z9TestRetrieveAutoconvertedArrays.test_array_in_from_configc                 C   s2   t jdt jd}| jd | | d|d  d S r&   )r+   r,   r-   r   r/   r0   r   r   r   test_array_default8   r7   z2TestRetrieveAutoconvertedArrays.test_array_defaultc                 C   s:   t jdtd}| jd t| | d|d d  d S Nr'   r(   r*   r   r   )r+   r,   
recordtyper   r   r   r/   r   host_recr   r   r   test_record_in=      z.TestRetrieveAutoconvertedArrays.test_record_inc                 C   s:   t jdtd}| jd t| | d|d d  d S Nr'   r(   r*   r   r   r   )r+   r,   r:   r   r   r.   r/   r;   r   r   r   test_record_inoutB   r>   z1TestRetrieveAutoconvertedArrays.test_record_inoutc                 C   s4   t jdtd}| jd | | d|d d  d S r?   )r+   r,   r:   r   r/   r;   r   r   r   test_record_defaultG      z3TestRetrieveAutoconvertedArrays.test_record_defaultc                 C   s4   t jdtd}| jd | | d|d d  d S r9   )r+   r,   r:   r#   r/   r;   r   r   r   test_record_in_from_configL   rB   z:TestRetrieveAutoconvertedArrays.test_record_in_from_config)r   r   r   r    r2   r5   r6   r8   r=   r@   rA   rC   __classcell__r   r   r$   r   r   !   s    r   __main__)numpyr+   numbar   numba.cuda.argsr   numba.cuda.testingr   unittestobjectr   r   r   r   r)   int32r:   r   r   mainr   r   r   r   <module>   s"    
1