################################################################################
# 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"
    "transients_test.mlir"
    "unused_args.mlir"
  TOOLS
    ${IREE_LLD_TARGET}
    FileCheck
    iree-compile
    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"
)

iree_check_single_backend_test_suite(
  NAME
    check_regression_llvm-cpu
  SRCS
    "broadcast_batch_matmul_to_matmul.mlir"
    "i1_inlined_constant.mlir"
    "layernorm.mlir"
    "linalg_ops.mlir"
    "pack_pad_transpose_1x9_into_2x1x8x4_issue_12546.mlir"
    "reduction_broadcast_elementwise.mlir"
    "scalar_computation.mlir"
    "softmax.mlir"
    "split_reduction_using_tiling.mlir"
    "strided_slice.mlir"
    "transpose.mlir"
  TARGET_BACKEND
    "llvm-cpu"
  DRIVER
    "local-task"
  COMPILER_FLAGS
    "--iree-llvmcpu-target-cpu=generic"
)

iree_check_single_backend_test_suite(
  NAME
    check_regression_dynamic_gather_attention_llvm-cpu
  SRCS
    "dynamic_gather_attention.mlir"
  TARGET_BACKEND
    "llvm-cpu"
  DRIVER
    "local-task"
  COMPILER_FLAGS
    "--iree-llvmcpu-target-cpu=generic"
  LABELS
    "noriscv"
)

iree_check_single_backend_test_suite(
  NAME
    check_regression_xla_reverse_after_slice_llvm-cpu
  SRCS
    "xla_reverse_after_slice.mlir"
  TARGET_BACKEND
    "llvm-cpu"
  DRIVER
    "local-task"
  COMPILER_FLAGS
    "--iree-llvmcpu-target-cpu=generic"
  LABELS
    "noriscv"
)

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"
)

iree_check_single_backend_test_suite(
  NAME
    check_regression_vmvx
  SRCS
    "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"
)

iree_check_single_backend_test_suite(
  NAME
    check_regression_vulkan-spirv
  SRCS
    "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"
)

iree_check_single_backend_test_suite(
  NAME
    check_regression_cuda
  SRCS
    "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"
  LABELS
    "noasan"
    "nomsan"
    "notsan"
    "noubsan"
    "requires-gpu-nvidia"
)

iree_check_single_backend_test_suite(
  NAME
    check_regression_hip
  SRCS
    "dynamic_batch_matmul_gfx1100.mlir"
    "dynamic_gather_attention.mlir"
    "linalg_ops_dynamic.mlir"
    "split_reduction_using_tiling.mlir"
  TARGET_BACKEND
    "rocm"
  DRIVER
    "hip"
  COMPILER_FLAGS
    "--iree-opt-level=O3"
  LABELS
    "noasan"
    "nomsan"
    "notsan"
    "noubsan"
    "requires-gpu-amd"
  TIMEOUT
    300
)

iree_check_single_backend_test_suite(
  NAME
    check_regression_vector_distribute_64bit_hip
  SRCS
    "vector_distribute_64bit_amdgpu.mlir"
  TARGET_BACKEND
    "rocm"
  DRIVER
    "hip"
  COMPILER_FLAGS
    "--iree-opt-level=O3"
    "--iree-input-demote-f64-to-f32=false"
  LABELS
    "noasan"
    "nomsan"
    "notsan"
    "noubsan"
    "requires-gpu-amd"
  TIMEOUT
    300
)

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
    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"
  TARGET_BACKEND
    "vmvx"
  COMPILER_FLAGS
    "--iree-vmvx-enable-microkernels"
)

### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
