Skip to content

Commit 4374e44

Browse files
kaushikcfdinducer
authored andcommitted
test pt_actx.compile for callables returning thawed arrays
1 parent 8dab9bc commit 4374e44

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/test_arraycontext.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,6 +1308,16 @@ def test_array_container_with_numpy(actx_factory):
13081308
# }}}
13091309

13101310

1311+
def test_actx_compile_on_pure_array_return(actx_factory):
1312+
def _twice(x):
1313+
return 2 * x
1314+
1315+
actx = actx_factory()
1316+
ones = actx.zeros(shape=(10, 4), dtype=np.float64) + 1
1317+
np.testing.assert_allclose(actx.to_numpy(_twice(ones)),
1318+
actx.to_numpy(actx.compile(_twice)(ones)))
1319+
1320+
13111321
if __name__ == "__main__":
13121322
import sys
13131323
if len(sys.argv) > 1:

0 commit comments

Comments
 (0)