lcompilers / lpython

Python compiler
https://lpython.org/
Other
1.5k stars 157 forks source link

Broadcast of constant does not work #2500

Open rebcabin opened 7 months ago

rebcabin commented 7 months ago

This is more of a work-tracking issue than a bug.

    VR_SIZE: i32 = 32_768
    k: i32
    A_ik: i16
    jj: i32
    ii: i32
    i: i32
    for jj in range(0, l, VR_SIZE):  # each VR-col chunk in B and C
        for ii in range(0, n, M2):  # each M2 block in A cols and B rows
            for i in range(0, M2):  # zero-out rows of C
                Cnl[i + ii, :] = 0  # ~~~~~~~~~~~~~~~~~~~~~~ ATTENTION ~~~~~~~~~~~~~~~
                pass
(lp) ┌─(~/Documents/GitHub/lpython/integration_tests)──────────────────────────────────────────────────────────────────────────────(brian@MacBook-Pro:s001)─┐
└─(07:18:24 on vector-backend ✹ ✭)──> lpython matmul_integration.py                                                                      ──(Wed,Feb07)─┘
semantic error: Type mismatch in assignment, the types must be compatible
   --> matmul_integration.py:201:17
    |
201 |                 Cnl[i + ii, :] = 0
    |                 ^^^^^^^^^^^^^^   ^ type mismatch ('i16[15,32768]' and 'i32')
rudhrabehara commented 7 months ago

i think lpython repository does not have file named "matmul_integration.py"

certik commented 7 months ago

I think this works in LFortran, so we just need to hook this in.