# Copyright 2023 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

iree_lit_test_suite(
  NAME
    lit
  SRCS
    "access_to_acquire_release.mlir"
    "aie_link_executables.mlir"
    "acquire_release_to_use_lock.mlir"
    "assign_bd_ids.mlir"
    "assign_buffer_address.mlir"
    "assign_channels.mlir"
    "assign_connection_types.mlir"
    "assign_logical_objectfifo_depth.mlir"
    "assign_npu_dma_bd_ids.mlir"
    "assign_packet_ids.mlir"
    "assign_tiles.mlir"
    "bridge_to_air.mlir"
    "bufferize_to_allocation.mlir"
    "bufferize_to_allocation_pack_or_copy.mlir"
    "canonicalize_doubly_strided_op.mlir"
    "canonicalize_doubly_strided_op_hardware_aware.mlir"
    "canonicalize_npu_dma_cpy_nd.mlir"
    "combine_strided_ops.mlir"
    "connection_to_flow.mlir"
    "controlcode_forall_to_for.mlir"
    "controlcode_loop_unrolling.mlir"
    "controlcode_lowering.mlir"
    "controlcode_to_transaction.mlir"
    "control_packet_to_npu_dma.mlir"
    "convert_core_forall_to_for.mlir"
    "convert_device_to_control_packets.mlir"
    "create_aie_workgroup.mlir"
    "create_reference_to_allocation.mlir"
    "disable_linalg_function_outlining.mlir"
    "disable_vectorization.mlir"
    "distribute_cores_and_objectfifos.mlir"
    "distribute_l1_allocations.mlir"
    "dma_composition.mlir"
    "dma_cse.mlir"
    "dma_loop_subsumption_circular.mlir"
    "dma_loop_subsumption.mlir"
    "dma_to_circular_dma.mlir"
    "fold_dma_waits.mlir"
    "flatten_logical_objectfifo.mlir"
    "linalg_function_outlining.mlir"
    "fuse_consumer_into_loop.mlir"
    "fuse_fill_into_forall.mlir"
    "fuse_producer_into_loop.mlir"
    "generate_control_overlay.mlir"
    "hoist_for_affine_apply.mlir"
    "hoist_logical_obj_fifo.mlir"
    "insert_copy_ops.mlir"
    "insert_cores.mlir"
    "insert_dma_bd_chain.mlir"
    "insert_dma_out_of_order_block.mlir"
    "insert_infinite_loop_around_core_block.mlir"
    "insert_loops_for_vectorization.mlir"
    "load_store_alignment_reset.mlir"
    "localize_logical_objectfifo.mlir"
    "lower_func_args.mlir"
    "lower_to_aie.mlir"
    "lower_to_ukernel.mlir"
    "lower_workgroup_count.mlir"
    "lowering_strategy_air.mlir"
    "lowering_strategy_conv.mlir"
    "lowering_strategy_failures.mlir"
    "lowering_strategy_generic.mlir"
    "lowering_strategy_objectfifo_npu1.mlir"
    "lowering_strategy_objectfifo_npu4.mlir"
    "lowering_strategy_softmax.mlir"
    "map_forall_to_cores.mlir"
    "multi_reduction_to_reduction.mlir"
    "none_access_to_temporary_buffer.mlir"
    "normalize_loop_bounds.mlir"
    "npu_dma_to_half_dma_cpy_nd.mlir"
    "obj_fifo_bufferization.mlir"
    "pack_and_transpose_level1.mlir"
    "pack_and_transpose_level2.mlir"
    "pack_to_air.mlir"
    "convert_to_dma.mlir"
    "convert_to_dma_failures.mlir"
    "pad.mlir"
    "peel_for_loop.mlir"
    "propagate_data_layout.mlir"
    "remove_memory_space.mlir"
    "sink_into_core.mlir"
    "split_logicalobjfifos.mlir"
    "split_logicalobjfifos_for_connection_reuse.mlir"
    "temporary_alloc_bufferization.mlir"
    "tile_and_fuse_using_scf_for.mlir"
    "tile_and_fuse_matmul_using_scf_forall.mlir"
    "tile_and_fuse_convolution_using_scf_forall.mlir"
    "tile_copy_using_scf_for.mlir"
    "add_no_alias_function_arguments.mlir"
    "replicate_calls.mlir"
    "vectorization.mlir"
  TOOLS
    ${IREE_LLD_TARGET}
    FileCheck
    iree-opt
  LABELS
    "hostonly"
)


iree_cc_test(
  NAME
    AMDAIEDmaUtilsTest
  SRCS
    "AMDAIEDmaUtilsTest.cpp"
  DEPS
    gtest
    iree::target::amd-aie::Transforms
)


iree_cc_test(
  NAME
    AMDAIEUtilsCppTest
  SRCS
    "AMDAIEUtilsTest.cpp"
  DEPS
    gtest
    iree::target::amd-aie::Transforms
    iree::compiler::Dialect::HAL::IR
    iree::compiler::Dialect::HAL::IR::HALDialect
)

iree_cc_test(
  NAME
    AMDAIETileSizeSelectionUtilsCppTest
  SRCS
    "AMDAIETileSizeSelectionUtilsTest.cpp"
  DEPS
    gtest
    iree::target::amd-aie::Transforms
)

iree_cc_test(
  NAME
    AMDAIETransactionBuilderTest
  SRCS
    "AMDAIETransactionBuilderTest.cpp"
  DEPS
    gtest
    iree::target::amd-aie::Transforms
)
