Skip to content

Commit

Permalink
Fix CUDA high-dimensional test (#1441)
Browse files Browse the repository at this point in the history
Fixes invalid ranges used in a test.

Opened following #1337
  • Loading branch information
tbennun authored Nov 28, 2023
1 parent ec456e6 commit cfa0871
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/cuda_highdim_kernel_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def highdim(A: dace.uint64[N, M, K, L, X, Y, Z, W, U], B: dace.uint64[N, M, K, L
@dace.mapscope
def kernel(i: _[5:N - 5], j: _[0:M], k: _[7:K - 1], l: _[0:L]):
@dace.map
def block(a: _[0:X], b: _[0:Y], c: _[1:Z], d: _[2:W - 2], e: _[0:U]):
def block(a: _[0:X], b: _[0:Y], c: _[1:Z], d: _[2:W - 1], e: _[0:U]):
input << A[i, j, k, l, a, b, c, d, e]
output >> B(1, lambda a, b: a + b)[i, j, k, l]
output = input
Expand All @@ -31,7 +31,7 @@ def block(a: _[0:X], b: _[0:Y], c: _[1:Z], d: _[2:W - 2], e: _[0:U]):
def makendrange(*args):
result = []
for i in range(0, len(args), 2):
result.append(slice(args[i], args[i + 1] - 1, 1))
result.append(slice(args[i], args[i + 1], 1))
return result


Expand All @@ -58,7 +58,7 @@ def _test(sdfg):

# Equivalent python code
for i, j, k, l in dace.ndrange(makendrange(5, N - 5, 0, M, 7, K - 1, 0, L)):
for a, b, c, d, e in dace.ndrange(makendrange(0, X, 0, Y, 1, Z, 2, W - 2, 0, U)):
for a, b, c, d, e in dace.ndrange(makendrange(0, X, 0, Y, 1, Z, 2, W - 1, 0, U)):
B_regression[i, j, k, l] += A[i, j, k, l, a, b, c, d, e]

sdfg(A=A, B=B, N=N, M=M, K=K, L=L, X=X, Y=Y, Z=Z, W=W, U=U)
Expand Down

0 comments on commit cfa0871

Please sign in to comment.