From 4374e44c4ce8edd59d0839cb2e2bf405e32d89ec Mon Sep 17 00:00:00 2001
From: Kaushik Kulkarni <kaushikcfd@gmail.com>
Date: Thu, 23 Dec 2021 15:19:24 -0600
Subject: [PATCH] test pt_actx.compile for callables returning thawed arrays

---
 test/test_arraycontext.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/test/test_arraycontext.py b/test/test_arraycontext.py
index 75a91cb..0fe5480 100644
--- a/test/test_arraycontext.py
+++ b/test/test_arraycontext.py
@@ -1308,6 +1308,16 @@ def test_array_container_with_numpy(actx_factory):
 # }}}
 
 
+def test_actx_compile_on_pure_array_return(actx_factory):
+    def _twice(x):
+        return 2 * x
+
+    actx = actx_factory()
+    ones = actx.zeros(shape=(10, 4), dtype=np.float64) + 1
+    np.testing.assert_allclose(actx.to_numpy(_twice(ones)),
+                               actx.to_numpy(actx.compile(_twice)(ones)))
+
+
 if __name__ == "__main__":
     import sys
     if len(sys.argv) > 1:
-- 
GitLab