zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
U
O±dNã(@s"ddlZddlZddlZddlZddlmZdZdZGdd„deƒZ    dd„Z
d    d
„Z iZ d d „Z d D]LZee e¡jeƒ.ZeD]"Ze d¡r’q‚e ¡sœq‚e eƒq‚W5QRXqddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6g(Zd7gZd8d9d:gZd;d<gZd=d>gZd8d9gZd?d@dAgZdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSgZdTdUdVdWdXdYdZd[d\g    Zd]d^d_d`dadbdcdddedfdgdhdidjdkdldmgZ dndodpdqgZ!drdsdtdugZ"dvdwdxgZ#dydz„Z$d{d|„Z%d}d~„Z&dd€„Z'dZ(d‚dƒ„Z)d„d„d„d„d„d„d„d„d…d†d‡dˆd‰dŠd‹dŒgZ*ddŽddd‘d’d“d”gZ+d•d–d—d˜d’d„d„d„gZ,e,ddd™…Z-d„d„d„d„dšd›dœddždŸd„d„g Z.d„d„d„d„dšd›dœddždŸd„d„d„d„d„d„gZ/dŸdžd„d„ddœd›dšd„d„d„d„g Z0dŸdžd d¡d‡d¢d„d„d„d„d„d„d„d„d„d„gZ1e1ddd™…Z2d•d–d—d˜d’d„d„d„gd„gd£Z3d„d„d„d’d˜d—d–d•gd„gd£Z4d¤d¥„Z5d¦d§„Z6dS)¨éN)Úmingw32i    éc@s eZdZdS)ÚMismatchCAPIErrorN)Ú__name__Ú
__module__Ú __qualname__©rrúNd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/core/setup_common.pyr5srcCsNtj d|¡z(tdƒ}tdƒ}| |j¡}| ¡}W5tjd=X|||fS)z°
    Return current C API checksum and the recorded checksum.
 
    Return current C API checksum and the recorded checksum for the given
    version of the C API version.
 
    rZgenapiÚ    numpy_api)ÚsysÚpathÚinsertÚ
__import__Z fullapi_hashZfull_apiZget_versions_hash)Ú
apiversionÚ codegen_dirÚmr
Ú curapi_hashZ    apis_hashrrr    Úget_api_versions9s
 
rc    Cs@t||ƒ\}}||ks<d|›d|›d|›dt›d    }t|ƒ‚dS)z@Emits a MismatchCAPIWarning if the C API version needs updating.z^API mismatch detected, the C API version numbers have to be updated. Current C api version is z, with checksum z=, but recorded checksum in core/codegen_dir/cversions.txt is zL. If functions were added in the C API, you have to update C_API_VERSION in Ú.N)rÚ__file__r)rrrZapi_hashÚmsgrrr    Úcheck_api_versionNsrcCs\| d¡\}}}| d¡d}| d¡d}dd„| d¡Dƒ}d     d
d „|Dƒ¡t|<dS) Nú(ú)rú éÿÿÿÿcSsg|] }| ¡‘qSr)Ústrip©Ú.0Úargrrr    Ú
<listcomp>hszset_sig.<locals>.<listcomp>ú,z, css|]}d|VqdS)z(%s){0}Nrrrrr    Ú    <genexpr>jszset_sig.<locals>.<genexpr>)Ú    partitionÚ
rpartitionÚsplitÚjoinÚFUNC_CALL_ARGS)ÚsigÚprefixÚ_ÚargsÚfuncnamerrr    Úset_sigds
r-)zfeature_detection_locale.hzfeature_detection_math.hzfeature_detection_cmath.hzfeature_detection_misc.hzfeature_detection_stdio.hú#ÚsinÚcosÚtanÚsinhÚcoshÚtanhÚfabsÚfloorÚceilÚsqrtÚlog10ÚlogÚexpÚasinÚacosÚatanÚfmodÚmodfÚfrexpÚldexpÚexpm1Úlog1pÚacoshÚasinhÚatanhZrintÚtruncZexp2ÚcopysignZ    nextafterZstrtollZstrtoullZcbrtÚlog2ÚpowÚhypotÚatan2ZcrealZcimagZconjZ    strtold_lZftelloZfseekoZ    fallocateZ    backtraceZmadviseZ__threadz__declspec(thread)zcomplex doublez complex floatzcomplex long doubleZcabsZcacosZcacoshZcargZcasinZcasinhZcatanZcatanhZcexpZclogZcpowZcsqrtZcsinZcsinhZccosZccoshZctanZctanhú xmmintrin.hú emmintrin.hú immintrin.hz
features.hz    xlocale.hzdlfcn.hz
execinfo.hz libunwind.hz
sys/mman.h)Z__builtin_isnanú5.)Z__builtin_isinfrQ)Z__builtin_isfiniterQ)Z__builtin_bswap32Ú5u)Z__builtin_bswap64rR)Z__builtin_expectz5, 0)Z__builtin_mul_overflowz(long long)5, 5, (int*)5)Z _m_from_int64Ú0rO)Z _mm_load_psz    (float*)0rN)Z _mm_prefetchz(float*)0, _MM_HINT_NTArN)Z _mm_load_pdz
(double*)0rO)Z__builtin_prefetchz(float*)0, 0, 3)ú__asm__ volatilez"vpand %xmm1, %xmm2, %xmm3"ústdio.hZLINK_AVX)rTz"vpand %ymm1, %ymm2, %ymm3"rUZ    LINK_AVX2)rTz"vpaddd %zmm1, %zmm2, %zmm3"rUZ LINK_AVX512F)rTz²"vfpclasspd $0x40, %zmm15, %k6\n"                                             "vmovdqu8 %xmm0, %xmm1\n"                                             "vpbroadcastmb2q %k0, %xmm0\n"rUZLINK_AVX512_SKX)rTz"xgetbv"rUZXGETBV)z)__attribute__((optimize("unroll-loops")))Zattribute_optimize_unroll_loops)z__attribute__((optimize("O3")))Zattribute_optimize_opt_3)z__attribute__((optimize("O2")))Zattribute_optimize_opt_2)z__attribute__((nonnull (1)))Zattribute_nonnull)z__attribute__((target ("avx")))Zattribute_target_avx)z __attribute__((target ("avx2")))Zattribute_target_avx2)z#__attribute__((target ("avx512f")))Zattribute_target_avx512f)úG__attribute__((target ("avx512f,avx512dq,avx512bw,avx512vl,avx512cd")))Zattribute_target_avx512_skx)z#__attribute__((target("avx2,fma")))Z%attribute_target_avx2_with_intrinsicszO__m256 temp = _mm256_set1_ps(1.0); temp =     _mm256_fmadd_ps(temp, temp, temp)rP)z"__attribute__((target("avx512f")))Z(attribute_target_avx512f_with_intrinsicsz7__m512i temp = _mm512_castps_si512(_mm512_set1_ps(1.0))rP)rVZ+attribute_target_avx512_skx_with_intrinsicszÎ__mmask8 temp = _mm512_fpclass_pd_mask(_mm512_set1_pd(1.0), 0x01);    __m512i unused_temp =         _mm512_castps_si512(_mm512_set1_ps(1.0));    _mm_mask_storeu_epi8(NULL, 0xFF, _mm_broadcastmb_epi64(temp))rPcCs d| ¡S)NzHAVE_%s)Úupper)Únamerrr    Ú    fname2defsrYcCs| dd¡}| ¡S)NrÚ©ÚreplacerW©ÚsymbolZdefinerrr    Úsym2defs r_cCs| dd¡}| ¡S)Nrr*r[r]rrr    Útype2defs r`c    CsN| ¡tddi}tjdkrRtƒsRz|jj d¡Wq tt    fk
rNYq XnNtjdkr |jj
  d¡r d|jj kr |jj   dd¡}|jj|||||d    d
| |ddd ¡\}}zŠztt|ƒƒ}|WW¢tSt    k
r:|  d d ¡}|d7}| |ddd ¡\}}|j d¡|j |gd¡ttdƒƒ}|YW¢SXW5| ¡XdS)NÚtypez long doubleÚwin32z/GLÚintelz-ipoz -iporZz -shared)ÚcompilerÚ compiler_soÚ compiler_cxxÚ
linker_exeÚ    linker_soÚcÚstructzvolatile structz)int main(void) { return foo.before[0]; }
Z _configtest)Ú_check_compilerÚLONG_DOUBLE_REPRESENTATION_SRCr ÚplatformrrdZcompile_optionsÚremoveÚAttributeErrorÚ
ValueErrorÚ compiler_typeÚ
startswithZcc_exer\Úset_executablesÚ_compileZ_cleanÚlong_double_representationÚpyodZ
temp_filesÚappendZlink_executable)ÚcmdÚbodyZ newcompilerÚsrcÚobjZltyperrr    Ú check_long_double_representation sB 
 ÿ
þû     
   r|aA
/* "before" is 16 bytes to ensure there's no padding between it and "x".
 *    We're not expecting any "long double" bigger than 16 bytes or with
 *       alignment requirements stricter than 16 bytes.  */
typedef %(type)s test_type;
 
struct {
        char         before[16];
        test_type    x;
        char         after[8];
} foo = {
        { '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
          '\001', '\043', '\105', '\147', '\211', '\253', '\315', '\357' },
        -123456789.0,
        { '\376', '\334', '\272', '\230', '\166', '\124', '\062', '\020' }
};
c    Csg}t|dƒ}dd„| ¡Dƒ}W5QRXtdt|ƒdƒD]N}dtt|ƒdd…ƒg}| d    d„|||d…Dƒ¡| d
 |¡¡q<|S) a£Python implementation of the od UNIX utility (od -b, more exactly).
 
    Parameters
    ----------
    filename : str
        name of the file to get the dump from.
 
    Returns
    -------
    out : seq
        list of lines of od output
 
    Notes
    -----
    We only implement enough to get the necessary information for long double
    representation, this is not intended as a compatible replacement for od.
    ÚrbcSsg|]}t|ƒdd…‘qS)éN)Úoct)rÚorrr    r bszpyod.<locals>.<listcomp>rrz%07dr~NcSsg|]}dt|ƒ‘qS)z%03d)Úint)rrirrr    r esr)    ÚopenÚreadÚrangeÚlenrrÚextendrwr&)ÚfilenameÚoutZfidZyo2ÚiÚlinerrr    rvNs  rvZ000Z001Z043Z105Z147Z211Z253Z315Z357Z376Z334Z272Z230Z166Z124Z062Z020Z301Z235Z157Z064rZ240Z242Z171Z353Z031Z300Z326Z363Z100écCs®dgd}d}|D]p}| ¡dd…D]X}| d¡| |¡|dd…tkr(t |¡}|dd…tdd…kr¦|dd…tkrŒd    S|dd…tkr¤d
Sq(|dd …td d…kr@|d d…tkrØd S|d d…t    krðd S|d d…t
kr
dS|d d…t kr$dS|d d…t kr‚dSq(|dd…tkr(|dd…t krjdS|dd…tkr(dSq(q|dk    ržtd|ƒ‚n td|ƒ‚dS)zSGiven a binary dump as given by GNU od -b, look for long double
    representation.rZé Nériøÿÿÿé éZINTEL_EXTENDED_12_BYTES_LEZMOTOROLA_EXTENDED_12_BYTES_BEr‹ZINTEL_EXTENDED_16_BYTES_LEZ IEEE_QUAD_BEZ IEEE_QUAD_LEZIBM_DOUBLE_DOUBLE_LEZIBM_DOUBLE_DOUBLE_BErZIEEE_DOUBLE_LEZIEEE_DOUBLE_BEzUnrecognized format (%s)zCould not lock sequences (%s))r%ÚpoprwÚ
_AFTER_SEQÚcopyÚ _BEFORE_SEQÚ_INTEL_EXTENDED_12BÚ_MOTOROLA_EXTENDED_12BÚ_INTEL_EXTENDED_16BÚ_IEEE_QUAD_PREC_BEÚ_IEEE_QUAD_PREC_LEÚ_IBM_DOUBLE_DOUBLE_LEÚ_IBM_DOUBLE_DOUBLE_BEÚ_IEEE_DOUBLE_LEÚ_IEEE_DOUBLE_BErp)ÚlinesrƒZsawrŠÚwrrr    ru~s@
 
 
 
 
 
 
 
rucCs>| ¡| t d¡dd¡}|s$dS| t d¡dd¡}| S)a‰
    On our arm CI, this fails with an internal compilation error
 
    The failure looks like the following, and can be reproduced on ARM64 GCC 5.4:
 
        <source>: In function 'right_shift':
        <source>:4:20: internal compiler error: in expand_shift_1, at expmed.c:2349
               ip1[i] = ip1[i] >> in2;
                      ^
        Please submit a full bug report,
        with preprocessed source if appropriate.
        See <http://gcc.gnu.org/bugs.html> for instructions.
        Compiler returned: 1
 
    This function returns True if this compiler bug is present, and we need to
    turn off optimization for the function
    zF        __attribute__((optimize("O3"))) void right_shift() {}
        NFao        typedef long the_type;  /* fails also for unsigned and long long */
        __attribute__((optimize("O3"))) void right_shift(the_type in2, the_type *ip1, int n) {
            for (int i = 0; i < n; i++) {
                if (in2 < (the_type)sizeof(the_type) * 8) {
                    ip1[i] = ip1[i] >> in2;
                }
            }
        }
        )rkZ try_compileÚtextwrapÚdedent)rxZ has_optimizeZno_errrrr    Ú-check_for_right_shift_internal_compiler_error¹s þ     ÷
r¡)7r’Úpathlibr rŸZnumpy.distutils.misc_utilrZ C_ABI_VERSIONZ C_API_VERSIONrprrrr'r-Úfiler‚ÚPathrÚparentÚfrŠrrrZMANDATORY_FUNCSZOPTIONAL_LOCALE_FUNCSZOPTIONAL_FILE_FUNCSZOPTIONAL_MISC_FUNCSZOPTIONAL_VARIABLE_ATTRIBUTESZOPTIONAL_FUNCS_MAYBEZC99_COMPLEX_TYPESZC99_COMPLEX_FUNCSZOPTIONAL_HEADERSZOPTIONAL_INTRINSICSZOPTIONAL_FUNCTION_ATTRIBUTESZ OPTIONAL_FUNCTION_ATTRIBUTES_AVXZ0OPTIONAL_FUNCTION_ATTRIBUTES_WITH_INTRINSICS_AVXrYr_r`r|rlrvr“r‘rœr›r”r–r•r—r˜ršr™rur¡rrrr    Ú<module>s„     
ø 
ÿÿû
öå!ú
úö/ÿÿÿ ÿÿÿÿ;