
    xKg
                     ,   d dl mZ d dlmZmZ d dlmZ d dlmZm	Z	  e       Z
e
j                  Zd Zd Ze	j                  j                         D ]=  \  Z\  ZZ eeD  cg c]  } | j(                   c}       r eeee       4 eeee       ? yc c} w )    )ir)cgutilstypes)Registry)	libdevicelibdevicefuncsc                       fd}t        t         dd        }t        D cg c]  }|j                  r|j                   }} t        |g| |       y c c}w )Nc                    |j                   }| j                        }D cg c]  }| j                  |j                         }}t        j                  ||      }t        j                  ||
      }	|j                  |	|      S c c}w )N)moduleget_value_typetyr   FunctionTyper   get_or_insert_functioncall)contextbuildersigargslmodfrettyargfargtysfntyfnfuncnbargsrettys             \/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/numba/cuda/libdeviceimpl.pycorez!libdevice_implement.<locals>.core   sz    ~~''.=CDVc7))#&&1VDvw/++D$=||B%% Es   "B   )getattrr   r   is_ptrr   lower)r   r   r   r   keyr   argtyss   ```    r   libdevice_implementr&   
   sS    & )T!"X
&C $7CJJcffF7E# 8s
   AAc                      t        j                        }|j                   fd}t        t         dd        } t        |g|j                   |       y )Nc                    |j                   }g }D ]J  }| j                  |j                        }|j                  r|j	                         }|j                  |       L | j                        }t        j                  ||      }	t        j                  ||	      }
g }g }d}D ]y  }|j                  rRt        j                  || j                  |j                              }|j                  |       |j                  |       a|j                  ||          |dz  }{ |j                  |
|      }g }t        j                  k7  r|j                  |       |D ]"  }|j                  |j                  |             $ t        t        j                         rt        j"                  ||      S t        j$                  ||      S )Nr      )r   r   r   r"   
as_pointerappendr   r   r   r   alloca_oncer   r   voidload
isinstanceUniTuple
pack_arraypack_struct)r   r   r   r   r   r   r   r   r   r   r   actual_argsvirtual_argsarg_idxtmp_argret
tuple_argsr   nb_rettyprototype_argsr   s                    r   r   z2libdevice_implement_multiple_returns.<locals>.core   s   ~~!C''/Bzz]]_NN2	 " ''.vw/++D$= !Czz!--g.5.D.DSVV.LN""7+##G,""4=11 " ll2{+ 
EJJc"Cgll3/0   h/%%gz::&&w
;;    r    )r   create_signaturereturn_typer!   r   r#   r   )r   r   r:   r   r   r$   r9   s   ```   @r   $libdevice_implement_multiple_returnsr>      sP    

)
)%
@CH,<\ )T!"X
&CE#$r;   N)llvmliter   
numba.corer   r   numba.core.imputilsr   
numba.cudar   r   registryr#   r&   r>   	functionsitemsr   r   r   anyr"   )r   s   0r   <module>rG      s     % ( 0:3 l *3399;D-5$
$'$3CJJ$'(,T5$?D%.	 <'s   B
