Python frontend: Better support for scalar-ranges and dynamic ranges
- Dominant language
- Python
- Stars
- 593
- Forks
- 163
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 60
Description
The Python frontend has trouble dealing with dynamic map inputs.
- [x] Some programs don't generate valid graphs:
```
@dace.program
def test(A: dace.float64[20], B: dace.float64[20]):
N = dace.define_local_scalar(dace.int32)
N = 5
for i in dace.map[0:N]:
for j in dace.map[0:N]:
with dace.tasklet:
a << A[i]
b >> B[j]
b = a + 1
```
- [x] others generate symbols instead of scalars:
```
@dace.program
def test(A: dace.float64[20], B: dace.float64[20], N: dace.int32):
for i, j in dace.map[0:N, 0:N]:
with dace.tasklet:
a << A[i]
b >> B[j]
b = a + 1
```
- [x] and others generate code in the wrong order, allocating the scalars before setting their values:
```
@dace.program
def test(A: dace.float64[20], N: dace.int32):
A[0:N] = 5
```
Contributor guide
Assessment
This issue has not been assessed yet.