
    J/Ph
                     4   d dl mZ d dlmZ d dlmZmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZ  e
            Zej        Z ej         ej        d                    Zed	             Ze                    ej                  e                    ej                  d
                         Ze                    ej                  d             Ze                    ej                  d             Z ee ej        ej                            d             Z dS )    )singledispatch)ir)typescgutils)NumbaWarning)Registry)	nvvmutils)warn   c                 &    t          d|           )z
    Handle printing of a single value of the given Numba type.
    A (format string, [list of arguments]) is returned that will allow
    forming the final printf()-like call.
    z*printing unimplemented for values of type )NotImplementedError)tycontextbuildervals       T/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/numba/cuda/printimpl.py
print_itemr      s#     
!#& ' ' '    c                     | t           j        v rd}t           j        }nd}t           j        }|                    ||| |          }||gfS )Nz%lluz%lld)r   unsigned_domainuint64int64cast)r   r   r   r   rawfmtdsttypellds          r   int_print_implr      sO     
U""",+
,,wR
1
1CC5=r   c                 P    |                     ||| t          j                  }d|gfS )Nz%f)r   r   float64)r   r   r   r   r   s        r   real_print_implr    )   s'    
,,wR
7
7C#;r   c                 x    | j         }t          |t                    sJ d}|                    ||          }||gfS )Nz%s)literal_value
isinstancestrinsert_string_const_addrspace)r   r   r   sigvalpyvalr   r   s          r   const_print_implr(   /   sF    EeS!!!!!F

/
/
?
?CC5=r   c                    t          j        |j                  }g }g }t          t	          |j        |                    D ]G\  }\  }}	t          || ||	          \  }
}|                    |
           |                    |           Hd	                    |          dz   }t          |          dk    r-d}t          |t                     |                    dd          }|                     ||          }t          j        ||          }t          j        ||          }t          j        |j                  }|                    |||                    |t(                    f           |                                 S )zThis function is a generic 'print' wrapper for arbitrary types.
    It dispatches to the appropriate 'print' implementations above
    depending on the detected real types in the signature. 
    zjCUDA print() cannot print more than 32 items. The raw format string will be emitted by the kernel instead.%z%%)r	   declare_vprintmodule	enumeratezipargsr   appendextendjoinlenr
   r   replacer%   r   make_anonymous_structalloca_once_valuecallbitcastvoidptrget_dummy_value)r   r   sigr2   vprintformatsvaluesiargtypeargvalargfmtargvalsr   msgfmtarrayarrayptrs                    r   print_varargsrK   8   s_    %gn55FGF )#ch*=*= > >  GV$WgwGGvgXXg%F
4yy2~~NS,T**

/
/
@
@C)'6::E(%88H%gn55FLL#wxAABCCC""$$$r   N)!	functoolsr   llvmliter   
numba.corer   r   numba.core.errorsr   numba.core.imputilsr   
numba.cudar	   warningsr
   registrylowerPointerTypeIntTyper<   r   registerIntegerIntegerLiteralr   Floatr    StringLiteralr(   printVarArgAnyrK    r   r   <module>r`      s   $ $ $ $ $ $       % % % % % % % % * * * * * * ( ( ( ( ( (                  8::
".A
'
'
 ' ' ' U]##U)**  +* $# U[!!  "!
 U())  *) ulel59%%&&% % '&% % %r   