File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed
Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -1014,6 +1014,8 @@ def apply(self, **kwargs):
10141014 if k not in specialize }
10151015
10161016 # TODO: Does this cause problems for profilers?
1017+ # FIXME: Need some way to inspect this Operator for testing
1018+ # FIXME: Perhaps this should use some separate method
10171019 return op .apply (** specialized_kwargs )
10181020
10191021 # Invoke kernel function with args
Original file line number Diff line number Diff line change @@ -203,14 +203,23 @@ def test_apply_basic(self):
203203 assert np .all (check == f .data )
204204
205205
206- # class TestApply:
207- # """Tests for specialization of operators at apply time"""
206+ class TestApply :
207+ """Tests for specialization of operators at apply time"""
208208
209- # def test_basic(self):
210- # grid = Grid(shape=(11, 11))
209+ def test_basic (self ):
210+ grid = Grid (shape = (11 , 11 ))
211+ f = Function (name = 'f' , grid = grid , dtype = np .int32 )
212+ op = Operator (Eq (f , f + 1 ))
213+
214+ # TODO: Need to verify that specialized operator is actually the one
215+ # being run. How can I achieve this?
216+ op .apply (specialize = ('x_m' , 'x_M' ))
211217
212- # f = TimeFunction(name='f', grid=grid, space_order=2)
218+ check = np .array (f .data [:])
219+ f .data [:] = 0
220+ op .apply ()
213221
214- # op = Operator(Eq(f.forward, f + 1) )
222+ assert np . all ( check == f . data )
215223
216- # op.apply(time_M=10, specialize=('x_m', 'x_M'))
224+ # Need to test combining specialization and overrides (a range of them)
225+ # Need to test specialization with MPI (both at)
You can’t perform that action at this time.
0 commit comments