spcl / spcl/dace

Fortran Blas Library Node ignore array ranges

Open
#2,229 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
593
Forks
163
Avg merge
2d 23h
Merged PRs (30d)
60

Description

**Describe the bug**
Given the faulty test [from here](https://github.com/spcl/dace/blob/9f36d92c03fd043693b1b095df187cbd0d582f1d/tests/fortran/intrinsic_blas_test.py#L35) on the `f2dace-windwill` branch:
```python
def test_fortran_frontend_dot_range():
sources, main = SourceCodeBuilder().add_file("""
subroutine main(arg1, arg2, res1)
double precision, dimension(5) :: arg1
double precision, dimension(5) :: arg2
double precision, dimension(2) :: res1
res1(1) = dot_product(arg1(1:3), arg2(1:3))
end subroutine main
""").check_with_gfortran().get()
sdfg = create_singular_sdfg_from_string(sources, 'main', normalize_offsets=False)
sdfg.simplify()

size = 5
arg1 = np.full([size], 42, order="F", dtype=np.float64)
arg2 = np.full([size], 42, order="F", dtype=np.float64)
res1 = np.full([2], 0, order="F", dtype=np.float64)

for i in range(size):
arg1[i] = i + 1
arg2[i] = i + 5

sdfg(arg1=arg1, arg2=arg2, res1=res1)
assert res1[0] == np.dot(arg1, arg2)
```
it shows that the dot product should only be calculated on the first half of the arguments. Instead, the check passes because the assertion is not checking with the correct data and the dot-product is calculated over the entire argument arrays.

**To Reproduce**
Steps to reproduce the behavior:
1. Run the test above. The assertion will pass, demonstrating faulty behaviour

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.