Skip to content

Commit b8c991a

Browse files
kaushikcfdinducer
authored andcommitted
change dimension values
Otherwise Intel OpenCL gets its integer arithmetic wrong.
1 parent 52a594f commit b8c991a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/test_arraycontext.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def test_actx_ravel(actx_factory):
469469
actx = actx_factory()
470470
rng = default_rng()
471471
ndim = rng.integers(low=1, high=6)
472-
shape = tuple(rng.integers(2, 7, ndim))
472+
shape = tuple(rng.integers(2, 8, ndim))
473473

474474
assert_close_to_numpy(actx, lambda _np, ary: _np.ravel(ary),
475475
(rng.random(shape),))
@@ -716,7 +716,7 @@ def test_array_equal(actx_factory):
716716
def test_array_context_einsum_array_manipulation(actx_factory, spec):
717717
actx = actx_factory()
718718

719-
mat = actx.from_numpy(np.random.randn(10, 10))
719+
mat = actx.from_numpy(np.random.randn(16, 16))
720720
res = actx.to_numpy(actx.einsum(spec, mat,
721721
tagged=(FirstAxisIsElementsTag())))
722722
ans = np.einsum(spec, actx.to_numpy(mat))
@@ -731,8 +731,8 @@ def test_array_context_einsum_array_manipulation(actx_factory, spec):
731731
def test_array_context_einsum_array_matmatprods(actx_factory, spec):
732732
actx = actx_factory()
733733

734-
mat_a = actx.from_numpy(np.random.randn(5, 5))
735-
mat_b = actx.from_numpy(np.random.randn(5, 5))
734+
mat_a = actx.from_numpy(np.random.randn(16, 16))
735+
mat_b = actx.from_numpy(np.random.randn(16, 16))
736736
res = actx.to_numpy(actx.einsum(spec, mat_a, mat_b,
737737
tagged=(FirstAxisIsElementsTag())))
738738
ans = np.einsum(spec, actx.to_numpy(mat_a), actx.to_numpy(mat_b))
@@ -745,9 +745,9 @@ def test_array_context_einsum_array_matmatprods(actx_factory, spec):
745745
def test_array_context_einsum_array_tripleprod(actx_factory, spec):
746746
actx = actx_factory()
747747

748-
mat_a = actx.from_numpy(np.random.randn(7, 5))
749-
mat_b = actx.from_numpy(np.random.randn(5, 7))
750-
vec = actx.from_numpy(np.random.randn(7))
748+
mat_a = actx.from_numpy(np.random.randn(16, 4))
749+
mat_b = actx.from_numpy(np.random.randn(4, 16))
750+
vec = actx.from_numpy(np.random.randn(16))
751751
res = actx.to_numpy(actx.einsum(spec, mat_a, mat_b, vec,
752752
tagged=(FirstAxisIsElementsTag())))
753753
ans = np.einsum(spec,
@@ -1482,7 +1482,7 @@ def _twice(x):
14821482

14831483
actx = actx_factory()
14841484
ones = actx.thaw(actx.freeze(
1485-
actx.zeros(shape=(10, 4), dtype=np.float64) + 1
1485+
actx.zeros(shape=(16, 4), dtype=np.float64) + 1
14861486
))
14871487
np.testing.assert_allclose(actx.to_numpy(_twice(ones)),
14881488
actx.to_numpy(actx.compile(_twice)(ones)))
@@ -1573,11 +1573,11 @@ def test_compile_anonymous_function(actx_factory):
15731573
actx = actx_factory()
15741574
f = actx.compile(lambda x: 2*x+40)
15751575
np.testing.assert_allclose(
1576-
actx.to_numpy(f(1+actx.zeros((10, 4), "float64"))),
1576+
actx.to_numpy(f(1+actx.zeros((16, 4), "float64"))),
15771577
42)
15781578
f = actx.compile(partial(lambda x: 2*x+40))
15791579
np.testing.assert_allclose(
1580-
actx.to_numpy(f(1+actx.zeros((10, 4), "float64"))),
1580+
actx.to_numpy(f(1+actx.zeros((16, 4), "float64"))),
15811581
42)
15821582

15831583

0 commit comments

Comments
 (0)