U
    ,d                     @   sl   d dl mZ d dlmZ d dlmZ d dl mZ d dlZd dlZedG dd deZ	e
d	krhe  dS )
    )skip_on_cudasim)cuda)types)CUDATestCaseNz#Simulator does not produce lineinfoc                   @   s0   e Zd ZdZdd Zdd Zdd Zdd	 Zd
S )TestCudaLineInfozC
    These tests only check the compiled PTX for line mappings
    c                 C   s   | | ||S )N)compileZinspect_asm)selffnsig r   I/tmp/pip-unpacked-wheel-eu7e0c37/numba/cuda/tests/cudapy/test_lineinfo.py_getasm   s    
zTestCudaLineInfo._getasmc                 C   sB   | j ||d}td}||}|r,| jn| j}|||d d S )N)r
   ztest_lineinfo.py)msg)r   rer   searchZassertIsNotNoneZassertIsNone)r   r	   r
   expectZasmZre_section_lineinfomatchZassertfnr   r   r   _check   s
    

zTestCudaLineInfo._checkc                 C   s4   t jdddd }| j|tjd d  fdd d S )NFZlineinfoc                 S   s   d| d< d S N   r   r   xr   r   r   foo   s    z5TestCudaLineInfo.test_no_lineinfo_in_asm.<locals>.foor
   r   r   Zjitr   r   Zint32r   r   r   r   r   test_no_lineinfo_in_asm   s    

z(TestCudaLineInfo.test_no_lineinfo_in_asmc                 C   s4   t jdddd }| j|tjd d  fdd d S )NTr   c                 S   s   d| d< d S r   r   r   r   r   r   r   #   s    z2TestCudaLineInfo.test_lineinfo_in_asm.<locals>.foor   r   r   r   r   r   test_lineinfo_in_asm"   s    

z%TestCudaLineInfo.test_lineinfo_in_asmN)__name__
__module____qualname____doc__r   r   r   r   r   r   r   r   r   	   s
   	r   __main__)Znumba.cuda.testingr   Znumbar   Z
numba.corer   r   r   Zunittestr   r   mainr   r   r   r   <module>   s    