Skip to content

Commit 6b9ed2a

Browse files
Remove the nobuild/partialbuildmethod tests from python_bindings/ (#6668)
They no longer serve a purpose and are redundant to other tests.
1 parent 5d2abd3 commit 6b9ed2a

File tree

5 files changed

+1
-113
lines changed

5 files changed

+1
-113
lines changed

python_bindings/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ $(BIN)/ext/%.so: $(BIN)/%.py.o $(BIN)/%.a $(BIN)/runtime.a $(BIN)/ext/%.ldscript
164164
test_correctness_addconstant_test: $(BIN)/ext/addconstant.so
165165
test_correctness_bit_test: $(BIN)/ext/bit.so
166166
test_correctness_user_context_test: $(BIN)/ext/user_context.so
167-
test_correctness_pystub: $(BIN)/generators/simplestub.so $(BIN)/generators/complexstub.so $(BIN)/generators/partialbuildmethod.so $(BIN)/generators/nobuildmethod.so
167+
test_correctness_pystub: $(BIN)/generators/simplestub.so $(BIN)/generators/complexstub.so
168168

169169
APPS = $(shell ls $(ROOT_DIR)/apps/*.py)
170170
CORRECTNESS = $(shell ls $(ROOT_DIR)/correctness/*.py)

python_bindings/correctness/CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
set(GENERATORS
22
complexstub_generator.cpp
3-
nobuildmethod_generator.cpp
4-
partialbuildmethod_generator.cpp
53
simplestub_generator.cpp
64
)
75

python_bindings/correctness/nobuildmethod_generator.cpp

-24
This file was deleted.

python_bindings/correctness/partialbuildmethod_generator.cpp

-49
This file was deleted.

python_bindings/correctness/pystub.py

-37
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
# test alternate-but-legal syntax
66
from complexstub import generate as complexstub
77

8-
import partialbuildmethod
9-
import nobuildmethod
10-
118
def _realize_and_check(f, offset = 0):
129
b = hl.Buffer(hl.Float(32), [2, 2])
1310
f.realize(b)
@@ -260,41 +257,7 @@ def test_complexstub():
260257
actual = b[x, y]
261258
assert expected == actual, "Expected %s Actual %s" % (expected, actual)
262259

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-
294260
if __name__ == "__main__":
295261
test_simplestub()
296262
test_looplevel()
297263
test_complexstub()
298-
# disabled because HALIDE_ALLOW_GENERATOR_BUILD_METHOD is off by default
299-
# test_partialbuildmethod()
300-
test_nobuildmethod()

0 commit comments

Comments
 (0)