File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
numba_dpex/tests/dpjit_tests/dpnp Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -139,3 +139,33 @@ def func(shape, queue):
139
139
with pytest .raises (errors .TypingError ):
140
140
queue = dpctl .SyclQueue ()
141
141
func (10 , queue )
142
+
143
+
144
+ @pytest .mark .xfail (reason = "dpjit allocates new dpctl.SyclQueue on boxing" )
145
+ # TODO: remove test_dpnp_empty_with_dpjit_queue_temp once pass.
146
+ def test_dpnp_empty_with_dpjit_queue ():
147
+ """Test if dpnp array can be created with a queue from another array"""
148
+
149
+ @dpjit
150
+ def func (a ):
151
+ queue = a .sycl_queue
152
+ return dpnp .empty (10 , sycl_queue = queue )
153
+
154
+ a = dpnp .empty (10 )
155
+ b = func (a )
156
+
157
+ assert id (a .sycl_queue ) == id (b .sycl_queue )
158
+
159
+
160
+ def test_dpnp_empty_with_dpjit_queue_temp ():
161
+ """Test if dpnp array can be created with a queue from another array"""
162
+
163
+ @dpjit
164
+ def func (a ):
165
+ queue = a .sycl_queue
166
+ return dpnp .empty (10 , sycl_queue = queue )
167
+
168
+ a = dpnp .empty (10 )
169
+ b = func (a )
170
+
171
+ assert a .sycl_queue == b .sycl_queue
You can’t perform that action at this time.
0 commit comments