Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Const[i16] in step position of 'range' causes error message #2499

Closed
@rebcabin

Description

@rebcabin
from lpython import i32, i16, Const
VR_SIZE: i32 = 32_768
l: Const[i32] = VR_SIZE
n: Const[i32] = 15
m: Const[i32] = 3
k: i32
M2: Const[i32] = 5  # ~~~~~~~~~~~~~~~~~~~~~~~~~~ ATTENTION ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
            pass
        for k in range(0, m):  # rows of B
            for i in range(0, M2):
                pass
(lp) ┌─(~/Documents/GitHub/lpython/integration_tests)──────────────────────────────────────────────────────────────────────────────(brian@MacBook-Pro:s001)─┐
└─(07:13:11 on vector-backend ✹ ✭)──> lpython ../ISSUES/Issue2499.py                                                                     ──(Wed,Feb07)─┘
semantic error: For loop increment type should be Integer.
  --> ../ISSUES/Issue2499.py:13:5 - 18:20
   |
13 |        for ii in range(0, n, M2):  # each M2 block in A cols and B rows
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
...
   |
18 |                    pass
   | ...^^^^^^^^^^^^^^^^^^^^ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions