+
    nDjV                        ^ RI t ^ RIHt ^ RIt^ RIt^ RIt^ RIHt ]P                  P                  t]P                  ! R4      tR tR tR t]]P                  P#                  R]P$                  ! 4       R3]P&                  ! 4       R	3]P(                  ! 4       R
3]P*                  ! 4       R3]P,                  ! 4       R3]P.                  ! 4       R3]P0                  ! 4       R3]P2                  ! 4       R3]P4                  ! 4       R3]P6                  ! 4       R3]P8                  ! 4       R3.4      R 4       4       t]]P                  P#                  R]P$                  ]P&                  ]P(                  ]P*                  ]P,                  ]P.                  ]P0                  ]P2                  ]P4                  ]P6                  ]P8                  .4      R 4       4       tR tR t R# )    Nwraps)Versionnumpyc                 p    \         P                  P                  \         P                  ! V 4      V4      ^8H  # )   )ctypes	pythonapiPyCapsule_IsValid	py_object)capsulenames   &&S/data/cameron/venvs/s3viz/lib/python3.14/site-packages/pyarrow/tests/test_dlpack.pyr   r       s,    --f.>.>w.GNRSSS    c                     V P                  4       p\        VR 4      RJ g   Q h\        P                  V 4      p\        P                  P                  W1RR7       V P                  4       R8X  g   Q hR# )s   dltensorT)strictN)r   r   )
__dlpack__r   npfrom_dlpacktestingassert_array_equal__dlpack_device__)arrexpected_arrDLTensorresults   &&  r   check_dlpack_exportr   $   s_    ~~HX{3t;;;^^C FJJ!!&t!D  "f,,,r   c                 0   a  \        S 4      V 3R  l4       pV# )c                     < \         P                  ! 4        \        P                  ! 4       p S! V / VB \        P                  ! 4       V8X  g   Q h#   \        P                  ! 4       T8X  g   Q hi ; i)N)gccollectpatotal_allocated_bytes)argskwargsallocated_bytesfs   *, r   wrapper&check_bytes_allocated.<locals>.wrapper/   s\    


224	Ad%f%++-@@@2++-@@@s   A A/r   )r'   r(   s   f r   check_bytes_allocatedr*   .   s"    
1XA A Nr   uint8uint16uint32uint64int8int16int32int64float16float32float64c                    \        \        P                  4      \        R 4      8  d   \        P                  ! R4       \        P                  . RO\        P                  V4      R7      p\        P
                  ! W R7      p\        W24       \        P                  P                  V4      p\        WB4       VP                  ^^4      p\        P                  ^.\        P                  V4      R7      p\        WR4       VP                  ^ ^4      p\        P                  ^.\        P                  V4      R7      p\        WR4       VP                  ^4      p\        P                  ^^.\        P                  V4      R7      p\        WR4       \        P
                  ! . V R7      p\        P                  . \        P                  V4      R7      p\        Wb4       \        P                  P                  V4      p\        WB4       R# )1.24.0yNo dlpack support in numpy versions older than 1.22.0, strict keyword in assert_array_equal added in numpy version 1.24.0dtypetypeNr         )r   r   __version__pytestskiparrayr:   r"   r   Tensor
from_numpyslice)
value_typenp_type_strexpectedr   t
arr_slicedarr_zeros   &&     r   test_dlpackrM   :   se   $ r~~!22  	 xx	+)>x?H
((8
-C&
		X&A$1aJxx288K#8x9H
-1aJxx288K#8x9H
-1JxxAbhh{&;x<H
-xx,Hxx"((;"7x8H+
		X&A$r   np_typec                    \        \        P                  4      \        R 4      8  d   \        P                  ! R4       \        P                  . RO4      p\        P                  WR7      P                  RRR7      p\        P                  P                  V4      p\        W24       \        P                  WR7      P                  RRR7      p\        P                  P                  V4      p\        W24       R# )	r7   r8   r9   C)orderFN)r   r>   r?            r   r   )r>   r>   r>   )r   r   r@   rA   rB   rC   reshaper"   rD   rE   r   )rN   r   rI   rJ   s   &   r   test_tensor_dlpackrW   l   s     r~~!22  	 ((+
,Cxxx+33IS3IH
		X&A$xxx+33IS3IH
		X&A$r   c                  B   \        \        P                  4      \        R 4      8  d   \        P                  ! R4       \
        P                  ! . RO4      p \        P                  ! \        RR7      ;_uu_ 4        \        P                  V 4       RRR4       \
        P                  ! ^ ^.^^..\
        P                  ! \
        P                  ! 4       4      R7      p \        P                  ! \        RR7      ;_uu_ 4        \        P                  V 4       RRR4       \
        P                  ! . 4      p \        P                  ! \        RR7      ;_uu_ 4        \        P                  V 4       RRR4       \
        P                  ! . R	O4      p \        P                  ! \        RR7      ;_uu_ 4        \        P                  V 4       RRR4       R#   + '       g   i     ELL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)
z1.22.0z6No dlpack support in numpy versions older than 1.22.0.Nz,Can only use DLPack on arrays with no nulls.matchr;   z+DataType is not compatible with DLPack specz5Bit-packed boolean data type not supported by DLPack.)r   Nr?   )TFT)r   r   r@   rA   rB   r"   rC   raises	TypeErrorr   list_r1   )r   s    r   test_dlpack_not_supportedr^      sZ   r~~!22LM
((<
 C	y )2 
3 
3
s
3 ((
Q!QXXbhhj!C 
y(U	V	V
s 
W ((2,C	y(U	V	V
s 
W ((&
'C	y )2 
3 
3
s
3 
3#
3 
3 
3 
W	V 
W	V

3 
3 
3s0   :GG'G:3HG$	'G7	:H
	H	c                     \         P                  ! R 4      p \        P                  ! \        P                  ! R\        P
                  ! 4       4      .4      p\        P                  ! . RO\        P
                  ! 4       R7      p\        P                  ! V.VR7      pV P                  W0P                  ^ 4      4      pV P                  WCP                  4      pVR,          p\         P                  ! \        RR7      ;_uu_ 4        \        P                  V4       RRR4       \         P                  ! \        RR7      ;_uu_ 4        VP                  4        RRR4       R#   + '       g   i     LO; i  + '       g   i     R# ; i)zpyarrow.cudaf0r;   )schemaz=DLPack support is implemented only for buffers on CPU device.rY   Nr=   )rA   importorskipr"   ra   fieldr0   rC   record_batchserialize_record_batchContextread_record_batchr[   NotImplementedErrorr   r   r   )cudara   a0batchcbufcbatchcarrs          r   test_dlpack_cuda_not_supportedro      s	   ~.DYYrxxz234F	)"((*	-BOORD0E&&ull1o>D##D,,7F$<D 
* 39 
: 
:
t
: 
* 39 
: 
: 
: 
:	
: 
:
: 
: 
:s   E!E4!E1	4F	)rG   rH   )!r	   	functoolsr   r    rA   pyarrowr"   pyarrow.vendored.versionr   markr   
pytestmarkrb   r   r   r   r*   parametrizer+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   rM   rW   r^   ro    r   r   <module>rw      s  $   	   , [[
!T-	 !	W	h	h	h	F	W	W	W	y!	y!	y! %! "%B ((BIIryy"))''288RXXrxx**bjj"**?@%	@ 
% 6!r   