lpython icon indicating copy to clipboard operation
lpython copied to clipboard

Broadcast of constant does not work

Open rebcabin opened this issue 1 year ago • 2 comments

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')

rebcabin avatar Feb 07 '24 15:02 rebcabin

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

rudhrabehara avatar Feb 08 '24 20:02 rudhrabehara

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

certik avatar Feb 08 '24 22:02 certik