spcl / spcl/dace

Python frontend: Better support for scalar-ranges and dynamic ranges

Open
#650 1 comment 0 reactions 0 assignees Claimed by @tbennun View on GitHub
2.0 frontend
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.