|
5 | 5 | # test alternate-but-legal syntax
|
6 | 6 | from complexstub import generate as complexstub
|
7 | 7 |
|
8 |
| -import partialbuildmethod |
9 |
| -import nobuildmethod |
10 |
| - |
11 | 8 | def _realize_and_check(f, offset = 0):
|
12 | 9 | b = hl.Buffer(hl.Float(32), [2, 2])
|
13 | 10 | f.realize(b)
|
@@ -260,41 +257,7 @@ def test_complexstub():
|
260 | 257 | actual = b[x, y]
|
261 | 258 | assert expected == actual, "Expected %s Actual %s" % (expected, actual)
|
262 | 259 |
|
263 |
| -# disabled because HALIDE_ALLOW_GENERATOR_BUILD_METHOD is off by default |
264 |
| -def test_partialbuildmethod(): |
265 |
| - x, y, c = hl.Var(), hl.Var(), hl.Var() |
266 |
| - target = hl.get_jit_target_from_environment() |
267 |
| - |
268 |
| - b_in = hl.Buffer(hl.Float(32), [2, 2]) |
269 |
| - b_in.fill(123) |
270 |
| - |
271 |
| - b_out = hl.Buffer(hl.Int(32), [2, 2]) |
272 |
| - |
273 |
| - try: |
274 |
| - f = partialbuildmethod.generate(target, b_in, 1.0) |
275 |
| - except RuntimeError as e: |
276 |
| - assert "Generators that use build() (instead of generate()+Output<>) are not supported in the Python bindings." in str(e) |
277 |
| - else: |
278 |
| - assert False, 'Did not see expected exception!' |
279 |
| - |
280 |
| -def test_nobuildmethod(): |
281 |
| - x, y, c = hl.Var(), hl.Var(), hl.Var() |
282 |
| - target = hl.get_jit_target_from_environment() |
283 |
| - |
284 |
| - b_in = hl.Buffer(hl.Float(32), [2, 2]) |
285 |
| - b_in.fill(123) |
286 |
| - |
287 |
| - b_out = hl.Buffer(hl.Int(32), [2, 2]) |
288 |
| - |
289 |
| - f = nobuildmethod.generate(target, b_in, 1.0) |
290 |
| - f.realize(b_out) |
291 |
| - |
292 |
| - assert b_out.all_equal(123) |
293 |
| - |
294 | 260 | if __name__ == "__main__":
|
295 | 261 | test_simplestub()
|
296 | 262 | test_looplevel()
|
297 | 263 | test_complexstub()
|
298 |
| - # disabled because HALIDE_ALLOW_GENERATOR_BUILD_METHOD is off by default |
299 |
| - # test_partialbuildmethod() |
300 |
| - test_nobuildmethod() |
0 commit comments