
    xKg                     t    d dl Zd dlZd dlmZ d dlmZmZ  G d de      Ze	dk(  r ej                          yy)    N)cuda)unittestContextResettingTestCasec                       e Zd Zd Zd Zd Zy)
TestPinnedc                 <   t        j                  |      }t        j                         }t        j                  |d|      }|j                  ||       |j                  ||       |j                          | j                  t        j                  ||             y )NF)copystream)r
   )
npr	   r   r
   	to_devicecopy_to_devicecopy_to_hostsynchronize
assertTrueallclose)selfAA0r
   ptrs        h/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/numba/cuda/tests/cudadrv/test_pinned.py_run_copieszTestPinned._run_copies
   su    WWQZnnQU6:1V,6*Ar*+    c                    t        j                         }|j                  d      s|j                  d      rd}nd}t        j                  |      }t        j                  |      5  | j                  |       d d d        y # 1 sw Y   y xY w)Narmaarch64i       )platformmachine
startswithr   aranger   pinnedr   )r   r   countr   s       r   test_pinnedzTestPinned.test_pinned   sf    ""$e$(:(:9(EEEIIe[[^Q ^^s   &BB
c                 P    t        j                  d      }| j                  |       y )Nr   )r   r    r   )r   r   s     r   test_unpinnedzTestPinned.test_unpinned   s    IIo&r   N)__name__
__module____qualname__r   r#   r%    r   r   r   r      s    	, r   r   __main__)numpyr   r   numbar   numba.cuda.testingr   r   r   r&   mainr)   r   r   <module>r/      s8       A) 8 zHMMO r   