Skip to content

Commit

Permalink
Change default comparison method to none to avoid confusing errors wh…
Browse files Browse the repository at this point in the history
…en multiple procs are defined in a test.

#1415

PiperOrigin-RevId: 669318695
  • Loading branch information
erinzmoore authored and copybara-github committed Aug 30, 2024
1 parent 6d4f276 commit 63a36e5
Show file tree
Hide file tree
Showing 18 changed files with 69 additions and 1 deletion.
1 change: 1 addition & 0 deletions third_party/xls_berkeley_softfloat/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ xls_dslx_opt_ir(
# udiv not supported in equivalence checking.
xls_dslx_test(
name = "fpdiv_2x32_dslx_test",
dslx_test_args = {"compare": "jit"},
library = ":fpdiv_2x32_dslx",
tags = ["optonly"],
)
Expand Down
1 change: 1 addition & 0 deletions third_party/xls_colors/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ exports_files(["LICENSE"])
xls_dslx_test(
name = "hsv2rgb_dslx_test",
srcs = ["hsv2rgb.x"],
dslx_test_args = {"compare": "jit"},
)

cc_test(
Expand Down
4 changes: 4 additions & 0 deletions third_party/xls_go_math/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ xls_dslx_opt_ir(

xls_dslx_test(
name = "fpexp_32_dslx_test",
dslx_test_args = {"compare": "jit"},
library = ":fpexp_32_dslx",
)

Expand Down Expand Up @@ -114,6 +115,7 @@ xls_dslx_opt_ir(

xls_dslx_test(
name = "fp_sincos_32_dslx_test",
dslx_test_args = {"compare": "jit"},
library = ":fp_sincos_32_dslx",
)

Expand Down Expand Up @@ -179,6 +181,7 @@ xls_dslx_opt_ir(

xls_dslx_test(
name = "fp_trig_reduce_dslx_test",
dslx_test_args = {"compare": "jit"},
library = ":fp_trig_reduce_dslx_module",
)

Expand Down Expand Up @@ -244,6 +247,7 @@ xls_dslx_opt_ir(

xls_dslx_test(
name = "fpsqrt_32_dslx_test",
dslx_test_args = {"compare": "jit"},
library = ":fpsqrt_32_dslx",
)

Expand Down
6 changes: 6 additions & 0 deletions xls/build_rules/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ sh_test(
xls_dslx_test(
name = "generated_file_as_input_test",
srcs = ["generated.x"],
dslx_test_args = {"compare": "jit"},
)

# Encapsulate the generated file as a library.
Expand All @@ -226,6 +227,7 @@ xls_dslx_library(
# Reference the library with the generated file inside of a xls_dslx_test rule.
xls_dslx_test(
name = "dependent_on_library_with_generated_file_test",
dslx_test_args = {"compare": "jit"},
library = ":importer_dslx",
)

Expand Down Expand Up @@ -260,6 +262,7 @@ xls_dslx_library(
# xls_dslx_test on a xls_dslx_library with a transitive dependency.
xls_dslx_test(
name = "d_dslx_test",
dslx_test_args = {"compare": "jit"},
library = ":d_dslx",
)

Expand All @@ -276,6 +279,7 @@ xls_dslx_library(
# xls_dslx_test on a xls_dslx_library with a transitive dependency.
xls_dslx_test(
name = "e_dslx_test",
dslx_test_args = {"compare": "jit"},
library = ":e_dslx",
)

Expand Down Expand Up @@ -360,6 +364,7 @@ xls_dslx_verilog(
xls_dslx_test(
name = "chaining_example_test",
srcs = ["chaining_example.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_ir(
Expand Down Expand Up @@ -564,6 +569,7 @@ xls_dslx_library(
# Execute the DSLX interpreter.
xls_dslx_test(
name = "simple_example_4_test",
dslx_test_args = {"compare": "jit"},
library = ":simple_example_4_dslx",
)

Expand Down
2 changes: 1 addition & 1 deletion xls/build_rules/xls_dslx_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ _H_FILE_EXTENSION = ".h"
_CC_FILE_EXTENSION = ".cc"

_DEFAULT_DSLX_TEST_ARGS = {
"compare": "jit",
"compare": "none",
}

def get_transitive_dslx_srcs_files_depset(srcs, deps):
Expand Down
7 changes: 7 additions & 0 deletions xls/dslx/stdlib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ xls_dslx_fmt_test(
xls_dslx_test(
name = "std_dslx_test",
srcs = ["std.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_prove_quickcheck_test(
Expand All @@ -61,6 +62,7 @@ xls_dslx_prove_quickcheck_test(
xls_dslx_test(
name = "acm_random_dslx_test",
srcs = ["acm_random.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_fmt_test(
Expand All @@ -77,6 +79,7 @@ xls_dslx_library(
xls_dslx_test(
name = "apfloat_dslx_test",
srcs = ["apfloat.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_prove_quickcheck_test(
Expand Down Expand Up @@ -110,6 +113,7 @@ xls_dslx_fmt_test(
xls_dslx_test(
name = "bfloat16_dslx_test",
srcs = ["bfloat16.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_opt_ir(
Expand Down Expand Up @@ -185,6 +189,7 @@ xls_dslx_fmt_test(
xls_dslx_test(
name = "float32_dslx_test",
srcs = ["float32.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_opt_ir(
Expand Down Expand Up @@ -336,6 +341,7 @@ cc_test(
xls_dslx_test(
name = "float32_upcast_test",
srcs = ["float32_upcast_test.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_opt_ir(
Expand Down Expand Up @@ -625,6 +631,7 @@ xls_dslx_fmt_test(
xls_dslx_test(
name = "float64_dslx_test",
srcs = ["float64.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_opt_ir(
Expand Down
1 change: 1 addition & 0 deletions xls/dslx/tests/trace_fmt_repro_issue_652/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@ xls_dslx_opt_ir(

xls_dslx_test(
name = "trace_fmt_repro_dslx_test",
dslx_test_args = {"compare": "jit"},
library = ":trace_fmt_repro_dslx",
)
27 changes: 27 additions & 0 deletions xls/examples/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ xls_dslx_fmt_test(
xls_dslx_test(
name = "lfsr_dslx_test",
srcs = ["lfsr.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_library(
Expand All @@ -85,6 +86,7 @@ xls_dslx_library(
xls_dslx_test(
name = "lfsr_proc_dslx_test",
srcs = ["lfsr_proc.x"],
dslx_test_args = {"compare": "jit"},
deps = [":lfsr_proc_dslx"],
)

Expand All @@ -96,6 +98,7 @@ xls_dslx_library(
xls_dslx_test(
name = "capitalize_dslx_test",
srcs = ["capitalize.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_opt_ir(
Expand Down Expand Up @@ -155,6 +158,7 @@ xls_dslx_library(
xls_dslx_test(
name = "dot_product_dslx_test",
srcs = ["dot_product.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_library(
Expand All @@ -165,6 +169,7 @@ xls_dslx_library(
xls_dslx_test(
name = "fir_filter_dslx_test",
srcs = ["fir_filter.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_library(
Expand Down Expand Up @@ -311,6 +316,7 @@ xls_dslx_library(
xls_dslx_test(
name = "ffi_test",
srcs = ["ffi.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_verilog(
Expand Down Expand Up @@ -356,6 +362,7 @@ xls_dslx_opt_ir(
xls_dslx_test(
name = "sha256_dslx_test",
srcs = ["sha256.x"],
dslx_test_args = {"compare": "jit"},
)

# TODO(rspringer): OOMs on some machines. Add xls_ir_equivalence_test.
Expand Down Expand Up @@ -394,12 +401,14 @@ xls_dslx_library(
xls_dslx_test(
name = "sobel_filter_dslx_test",
srcs = ["sobel_filter.x"],
dslx_test_args = {"compare": "jit"},
deps = [":sobel_filter_dslx"],
)

xls_dslx_test(
name = "sobel_filter_test",
srcs = ["sobel_filter.x"],
dslx_test_args = {"compare": "jit"},
deps = [":sobel_filter_dslx"],
)

Expand Down Expand Up @@ -559,6 +568,7 @@ xls_dslx_library(

xls_dslx_test(
name = "memory_proc_test",
dslx_test_args = {"compare": "jit"},
library = ":memory_proc_dslx",
)

Expand All @@ -571,6 +581,7 @@ xls_dslx_library(

xls_dslx_test(
name = "tiny_adder_test",
dslx_test_args = {"compare": "jit"},
library = ":tiny_adder_dslx",
)

Expand Down Expand Up @@ -605,6 +616,7 @@ xls_dslx_library(

xls_dslx_test(
name = "find_index_test",
dslx_test_args = {"compare": "jit"},
library = ":find_index_dslx",
)

Expand Down Expand Up @@ -671,6 +683,7 @@ xls_dslx_library(
xls_dslx_test(
name = "large_array_dslx_test",
srcs = ["large_array.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_opt_ir(
Expand All @@ -696,6 +709,7 @@ xls_dslx_library(
xls_dslx_test(
name = "prefix_sum_dslx_test",
srcs = ["prefix_sum.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_opt_ir(
Expand All @@ -721,6 +735,7 @@ xls_dslx_library(
xls_dslx_test(
name = "sparse_prefix_sum_dslx_test",
srcs = ["sparse_prefix_sum.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_opt_ir(
Expand All @@ -745,6 +760,7 @@ xls_dslx_library(

xls_dslx_test(
name = "ram_test",
dslx_test_args = {"compare": "jit"},
library = ":ram_dslx",
)

Expand All @@ -756,6 +772,7 @@ xls_dslx_library(

xls_dslx_test(
name = "delay_test",
dslx_test_args = {"compare": "jit"},
library = ":delay_dslx",
)

Expand Down Expand Up @@ -839,6 +856,7 @@ xls_dslx_fmt_test(

xls_dslx_test(
name = "delay_loopback_channel_test",
dslx_test_args = {"compare": "jit"},
library = ":delay_loopback_channel_dslx",
)

Expand Down Expand Up @@ -923,6 +941,7 @@ xls_dslx_library(
xls_dslx_test(
name = "constraint_dslx_test",
srcs = ["constraint.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_ir(
Expand Down Expand Up @@ -1033,6 +1052,7 @@ xls_dslx_library(
xls_dslx_test(
name = "overflow_detect_dslx_test",
srcs = ["overflow_detect.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_opt_ir(
Expand All @@ -1051,6 +1071,7 @@ xls_dslx_library(
xls_dslx_test(
name = "nested_sel_dslx_test",
srcs = ["nested_sel.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_opt_ir(
Expand All @@ -1072,6 +1093,7 @@ xls_dslx_library(
xls_dslx_test(
name = "cubic_bezier_dslx_test",
srcs = ["cubic_bezier.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_library(
Expand All @@ -1082,6 +1104,7 @@ xls_dslx_library(
xls_dslx_test(
name = "bitonic_sort_dslx_test",
srcs = ["bitonic_sort.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_library(
Expand All @@ -1092,6 +1115,7 @@ xls_dslx_library(
xls_dslx_test(
name = "hack_cpu_dslx_test",
srcs = ["hack_cpu.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_library(
Expand All @@ -1101,6 +1125,7 @@ xls_dslx_library(

xls_dslx_test(
name = "serialized_decomposer_test",
dslx_test_args = {"compare": "jit"},
library = ":serialized_decomposer_dslx",
)

Expand Down Expand Up @@ -1178,6 +1203,7 @@ xls_dslx_library(
xls_dslx_test(
name = "passthrough_dslx_test",
srcs = ["passthrough.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_verilog(
Expand All @@ -1202,4 +1228,5 @@ xls_dslx_test(
name = "gcd_test",
size = "small",
srcs = ["gcd.x"],
dslx_test_args = {"compare": "jit"},
)
1 change: 1 addition & 0 deletions xls/examples/adler32/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ xls_dslx_opt_ir(
xls_dslx_test(
name = "adler32_dslx_test",
srcs = ["adler32.x"],
dslx_test_args = {"compare": "jit"},
)

xls_dslx_fmt_test(
Expand Down
1 change: 1 addition & 0 deletions xls/examples/apfloat_add_parallel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ xls_dslx_library(

xls_dslx_test(
name = "apfloat_add_parallel_dslx_test",
dslx_test_args = {"compare": "jit"},
library = ":apfloat_add_parallel_dslx",
)

Expand Down
Loading

0 comments on commit 63a36e5

Please sign in to comment.