################################################################################
# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
# tests/e2e/math/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_genrule(
  NAME
    gen_math_ops_llvm-cpu.mlir
  SRCS
    "generate.py"
    "math_ops_llvm-cpu.json"
  OUTS
    math_ops_llvm-cpu.mlir
  CMD
    "python3 $(rootpath generate.py) --testcases=$(rootpath math_ops_llvm-cpu.json) > $(execpath math_ops_llvm-cpu.mlir)"
)

iree_genrule(
  NAME
    gen_math_ops_rocm.mlir
  SRCS
    "generate.py"
    "math_ops_rocm.json"
  OUTS
    math_ops_rocm.mlir
  CMD
    "python3 $(rootpath generate.py) --testcases=$(rootpath math_ops_rocm.json) > $(execpath math_ops_rocm.mlir)"
)

iree_check_single_backend_test_suite(
  NAME
    math_ops_llvm-cpu
  SRCS
    "${PROJECT_BINARY_DIR}/tests/e2e/math/math_ops_llvm-cpu.mlir"
  TARGET_BACKEND
    "llvm-cpu"
  DRIVER
    "local-task"
  COMPILER_FLAGS
    "--iree-llvmcpu-target-cpu=generic"
  DEPS
    "gen_math_ops_llvm-cpu.mlir"
)

iree_check_single_backend_test_suite(
  NAME
    math_ops_rocm
  SRCS
    "${PROJECT_BINARY_DIR}/tests/e2e/math/math_ops_rocm.mlir"
  TARGET_BACKEND
    "rocm"
  DRIVER
    "hip"
  COMPILER_FLAGS

  DEPS
    "gen_math_ops_rocm.mlir"
)

### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
