################################################################################
# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
# tests/e2e/regression/BUILD.bazel                                             #
#                                                                              #
# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
# CMake-only content.                                                          #
#                                                                              #
# To disable autogeneration for this file entirely, delete this header.        #
################################################################################

iree_add_all_subdirs()

iree_lit_test_suite(
  NAME
    lit
  SRCS
    "fill_i64.mlir"
    "force_single_dispatch.mlir"
    "globals.mlir"
    "libm_linking.mlir"
    "scalar.mlir"
    "trace_dispatch_tensors.mlir"
    "unused_args.mlir"
  TOOLS
    ${IREE_LLD_TARGET}
    FileCheck
    iree-opt
    iree-run-mlir
  LABELS
    "driver=local-task"
    "hostonly"
)

iree_check_single_backend_test_suite(
  NAME
    check_fp_reassoc_regression_llvm-cpu
  SRCS
    "associative_reordering.mlir"
  TARGET_BACKEND
    "llvm-cpu"
  DRIVER
    "local-task"
  COMPILER_FLAGS
    "--iree-llvmcpu-reassociate-fp-reductions=false"
    "--iree-llvmcpu-target-cpu=generic"
  INPUT_TYPE
    "stablehlo"
)

iree_check_single_backend_test_suite(
  NAME
    check_regression_llvm-cpu
  SRCS
    "dynamic_abs.mlir"
    "dynamic_add.mlir"
    "dynamic_dot.mlir"
    "dynamic_reduce_min.mlir"
    "dynamic_torch_index_select_high_rank.mlir"
    "dynamic_torch_index_select_negative.mlir"
    "dynamic_torch_index_select_scalar.mlir"
    "dynamic_torch_index_select_vector.mlir"
    "i1_inlined_constant.mlir"
    "layernorm.mlir"
    "linalg_ops.mlir"
    "lowering_config.mlir"
    "pack_pad_transpose_1x9_into_2x4x8x4_issue_12546.mlir"
    "reduction_broadcast_elementwise.mlir"
    "scalar_computation.mlir"
    "softmax.mlir"
    "strided_slice.mlir"
    "transpose.mlir"
  TARGET_BACKEND
    "llvm-cpu"
  DRIVER
    "local-task"
  COMPILER_FLAGS
    "--iree-llvmcpu-target-cpu=generic"
  INPUT_TYPE
    "stablehlo"
)

iree_check_single_backend_test_suite(
  NAME
    check_regression_tosa_llvm-cpu
  SRCS
    "linalg_quantized_matmul_vs_linalg_matmul.mlir"
  TARGET_BACKEND
    "llvm-cpu"
  DRIVER
    "local-task"
  COMPILER_FLAGS
    "--iree-llvmcpu-target-cpu=generic"
  INPUT_TYPE
    "tosa"
)

iree_check_single_backend_test_suite(
  NAME
    check_regression_vmvx
  SRCS
    "dynamic_abs.mlir"
    "dynamic_add.mlir"
    "dynamic_dot.mlir"
    "dynamic_reduce_min.mlir"
    "dynamic_torch_index_select_high_rank.mlir"
    "dynamic_torch_index_select_negative.mlir"
    "dynamic_torch_index_select_scalar.mlir"
    "dynamic_torch_index_select_vector.mlir"
    "i1_inlined_constant.mlir"
    "layernorm.mlir"
    "linalg_ops.mlir"
    "reduction_broadcast_elementwise.mlir"
    "scalar_computation.mlir"
    "softmax.mlir"
    "strided_slice.mlir"
    "transpose.mlir"
  TARGET_BACKEND
    "vmvx"
  DRIVER
    "local-task"
  INPUT_TYPE
    "stablehlo"
)

iree_check_single_backend_test_suite(
  NAME
    check_regression_vulkan-spirv
  SRCS
    "dynamic_abs.mlir"
    "dynamic_add.mlir"
    "dynamic_dot.mlir"
    "dynamic_reduce_min.mlir"
    "dynamic_torch_index_select_high_rank.mlir"
    "dynamic_torch_index_select_negative.mlir"
    "dynamic_torch_index_select_scalar.mlir"
    "dynamic_torch_index_select_vector.mlir"
    "i1_inlined_constant.mlir"
    "linalg_ops.mlir"
    "reduction_broadcast_elementwise.mlir"
    "scalar_computation.mlir"
    "softmax.mlir"
    "strided_slice.mlir"
    "transpose.mlir"
  TARGET_BACKEND
    "vulkan-spirv"
  DRIVER
    "vulkan"
  INPUT_TYPE
    "stablehlo"
)

iree_check_single_backend_test_suite(
  NAME
    check_regression_cuda
  SRCS
    "dynamic_abs.mlir"
    "dynamic_add.mlir"
    "dynamic_dot.mlir"
    "dynamic_reduce_min.mlir"
    "dynamic_torch_index_select_high_rank.mlir"
    "dynamic_torch_index_select_negative.mlir"
    "dynamic_torch_index_select_scalar.mlir"
    "dynamic_torch_index_select_vector.mlir"
    "i1_inlined_constant.mlir"
    "large_reduction.mlir"
    "layernorm.mlir"
    "linalg_ops.mlir"
    "reduction_broadcast_elementwise.mlir"
    "scalar_computation.mlir"
    "softmax.mlir"
    "strided_slice.mlir"
    "transpose.mlir"
  TARGET_BACKEND
    "cuda"
  DRIVER
    "cuda"
  INPUT_TYPE
    "stablehlo"
  LABELS
    "noasan"
    "nomsan"
    "notsan"
    "noubsan"
    "requires-gpu-nvidia"
)

iree_check_single_backend_test_suite(
  NAME
    aggressive_fusion_test_cuda
  SRCS
    "softmax.mlir"
    "softmax_large.mlir"
  TARGET_BACKEND
    "cuda"
  DRIVER
    "cuda"
  COMPILER_FLAGS
    "--iree-dispatch-creation-fuse-multi-use"
  LABELS
    "noasan"
    "nomsan"
    "notsan"
    "noubsan"
    "requires-gpu-nvidia"
)

iree_check_single_backend_test_suite(
  NAME
    disable_demote_f64_to_f32
  SRCS
    "disable_demote_f64_to_f32.mlir"
  TARGET_BACKEND
    "llvm-cpu"
  DRIVER
    "local-task"
  COMPILER_FLAGS
    "--iree-input-demote-f64-to-f32=false"
    "--iree-llvmcpu-target-cpu=generic"
)

iree_check_single_backend_test_suite(
  NAME
    aggressive_fusion_test
  SRCS
    "softmax.mlir"
  TARGET_BACKEND
    "llvm-cpu"
  DRIVER
    "local-task"
  COMPILER_FLAGS
    "--iree-dispatch-creation-fuse-multi-use"
    "--iree-llvmcpu-target-cpu=generic"
)

iree_check_single_backend_test_suite(
  NAME
    check_regression_compilation_only_vmvx_ukernels
  SRCS
    "dynamic_matmuls_on_same_accumulator_issue_12060.mlir"
    "dynamic_tosa_clamp.mlir"
    "dynamic_tosa_quantized_fully_connected_issue_10859.mlir"
  TARGET_BACKEND
    "vmvx"
  COMPILER_FLAGS
    "--iree-vmvx-enable-microkernels"
  INPUT_TYPE
    "tosa"
)

### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
