Skip to content

Commit

Permalink
[fuzzer] Fully port sample_generator_test to C++.
Browse files Browse the repository at this point in the history
Allows us to delete some Python APIs for (internal) concrete types.

PiperOrigin-RevId: 375180163
  • Loading branch information
cdleary authored and copybara-github committed May 21, 2021
1 parent 19ef46a commit 96f23af
Show file tree
Hide file tree
Showing 11 changed files with 141 additions and 697 deletions.
1 change: 1 addition & 0 deletions xls/dslx/concrete_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class ConcreteTypeDim {
return ConcreteTypeDim(std::move(op));
}

explicit ConcreteTypeDim(int64_t value) : value_(value) {}
explicit ConcreteTypeDim(const ParametricExpression& value)
: value_(value.Clone()) {}
ConcreteTypeDim(const ConcreteTypeDim& other);
Expand Down
30 changes: 1 addition & 29 deletions xls/dslx/interpreter/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Reference interpreter executor for XLS syntax.

# pytype test and library
# pytype tests are present in this file

load("@xls_pip_deps//:requirements.bzl", "requirement")

Expand All @@ -35,34 +35,6 @@ py_test(
],
)

py_library(
name = "jit_comparison",
srcs = ["jit_comparison.py"],
srcs_version = "PY3",
deps = [
"//xls/dslx:bit_helpers",
"//xls/dslx/python:cpp_concrete_type",
"//xls/dslx/python:interp_value",
"//xls/ir/python:bits",
"//xls/ir/python:number_parser",
"//xls/ir/python:value",
],
)

py_test(
name = "jit_comparison_test",
srcs = ["jit_comparison_test.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
":jit_comparison",
"//xls/dslx/python:interp_value",
"//xls/ir/python:bits",
"//xls/ir/python:value",
"@com_google_absl_py//absl/testing:absltest",
],
)

py_test(
name = "interpreter_test",
srcs = ["interpreter_test.py"],
Expand Down
162 changes: 0 additions & 162 deletions xls/dslx/interpreter/jit_comparison.py

This file was deleted.

117 changes: 0 additions & 117 deletions xls/dslx/interpreter/jit_comparison_test.py

This file was deleted.

18 changes: 0 additions & 18 deletions xls/dslx/python/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,6 @@ xls_pybind_extension(
],
)

xls_pybind_extension(
name = "cpp_concrete_type",
srcs = [
"cpp_concrete_type.cc",
],
py_deps = [
],
deps = [
"@com_google_absl//absl/base",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"//xls/common/status:status_macros",
"//xls/common/status:statusor_pybind_caster",
"//xls/dslx:concrete_type",
],
)

xls_pybind_extension(
name = "interp_value",
srcs = [
Expand All @@ -129,7 +112,6 @@ xls_pybind_extension(
srcs = ["interpreter.cc"],
py_deps = [
":interp_value", # build_cleaner: keep
":cpp_concrete_type", # build_cleaner: keep
],
deps = [
":errors",
Expand Down
Loading

0 comments on commit 96f23af

Please sign in to comment.