Skip to content

Commit

Permalink
Remove the nobuild/partialbuildmethod tests from python_bindings/ (#6668
Browse files Browse the repository at this point in the history
)

They no longer serve a purpose and are redundant to other tests.
  • Loading branch information
steven-johnson committed Mar 30, 2022
1 parent 5d2abd3 commit 6b9ed2a
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 113 deletions.
2 changes: 1 addition & 1 deletion python_bindings/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ $(BIN)/ext/%.so: $(BIN)/%.py.o $(BIN)/%.a $(BIN)/runtime.a $(BIN)/ext/%.ldscript
test_correctness_addconstant_test: $(BIN)/ext/addconstant.so
test_correctness_bit_test: $(BIN)/ext/bit.so
test_correctness_user_context_test: $(BIN)/ext/user_context.so
test_correctness_pystub: $(BIN)/generators/simplestub.so $(BIN)/generators/complexstub.so $(BIN)/generators/partialbuildmethod.so $(BIN)/generators/nobuildmethod.so
test_correctness_pystub: $(BIN)/generators/simplestub.so $(BIN)/generators/complexstub.so

APPS = $(shell ls $(ROOT_DIR)/apps/*.py)
CORRECTNESS = $(shell ls $(ROOT_DIR)/correctness/*.py)
Expand Down
2 changes: 0 additions & 2 deletions python_bindings/correctness/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
set(GENERATORS
complexstub_generator.cpp
nobuildmethod_generator.cpp
partialbuildmethod_generator.cpp
simplestub_generator.cpp
)

Expand Down
24 changes: 0 additions & 24 deletions python_bindings/correctness/nobuildmethod_generator.cpp

This file was deleted.

49 changes: 0 additions & 49 deletions python_bindings/correctness/partialbuildmethod_generator.cpp

This file was deleted.

37 changes: 0 additions & 37 deletions python_bindings/correctness/pystub.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
# test alternate-but-legal syntax
from complexstub import generate as complexstub

import partialbuildmethod
import nobuildmethod

def _realize_and_check(f, offset = 0):
b = hl.Buffer(hl.Float(32), [2, 2])
f.realize(b)
Expand Down Expand Up @@ -260,41 +257,7 @@ def test_complexstub():
actual = b[x, y]
assert expected == actual, "Expected %s Actual %s" % (expected, actual)

# disabled because HALIDE_ALLOW_GENERATOR_BUILD_METHOD is off by default
def test_partialbuildmethod():
x, y, c = hl.Var(), hl.Var(), hl.Var()
target = hl.get_jit_target_from_environment()

b_in = hl.Buffer(hl.Float(32), [2, 2])
b_in.fill(123)

b_out = hl.Buffer(hl.Int(32), [2, 2])

try:
f = partialbuildmethod.generate(target, b_in, 1.0)
except RuntimeError as e:
assert "Generators that use build() (instead of generate()+Output<>) are not supported in the Python bindings." in str(e)
else:
assert False, 'Did not see expected exception!'

def test_nobuildmethod():
x, y, c = hl.Var(), hl.Var(), hl.Var()
target = hl.get_jit_target_from_environment()

b_in = hl.Buffer(hl.Float(32), [2, 2])
b_in.fill(123)

b_out = hl.Buffer(hl.Int(32), [2, 2])

f = nobuildmethod.generate(target, b_in, 1.0)
f.realize(b_out)

assert b_out.all_equal(123)

if __name__ == "__main__":
test_simplestub()
test_looplevel()
test_complexstub()
# disabled because HALIDE_ALLOW_GENERATOR_BUILD_METHOD is off by default
# test_partialbuildmethod()
test_nobuildmethod()

0 comments on commit 6b9ed2a

Please sign in to comment.