commit | 434ff0efdb5a80ba0138ae698ae0d04f281fbe39 | [log] [tgz] |
---|---|---|
author | Scott Todd <scotttodd@google.com> | Tue Dec 21 10:38:36 2021 -0800 |
committer | GitHub <noreply@github.com> | Tue Dec 21 10:38:36 2021 -0800 |
tree | 6fba754f78be9a9466df9f609d5c95ab3bb5288b | |
parent | 4e9bbd7c20ad0aca01403c6be99e5d4e606d17ff [diff] |
Refactor the HAL CTS for out of tree / individual drivers. (#7887) Fixes https://github.com/google/iree/issues/4643 This refactors the Hardware Abstraction Layer's Conformance Test Suite into a set of libraries and parameterized test suites that can be instantiated for individual HAL drivers using a new CMake function. This way, we can filter tests/drivers within the build system and can support drivers that are not added to the global test registry. The tests are still written as googletest [Value-Parameterized Tests](https://google.github.io/googletest/advanced.html#value-parameterized-tests), but they are now _abstract tests_ as well. The CMake function creates a concrete implementation of each test in the suite using a template file. Here is an example of a generated test file: ```c++ // clang-format off #define IREE_CTS_TEST_FILE_PATH "iree/hal/cts/descriptor_set_layout_test.h" #define IREE_CTS_TEST_CLASS_NAME DescriptorSetLayoutTest #define IREE_CTS_DRIVER_NAME "vmvx" // clang-format on #include IREE_CTS_TEST_FILE_PATH #include "iree/hal/cts/cts_test_base.h" #include "iree/testing/gtest.h" namespace iree { namespace hal { namespace cts { INSTANTIATE_TEST_SUITE_P(CTS, IREE_CTS_TEST_CLASS_NAME, ::testing::Values(IREE_CTS_DRIVER_NAME), GenerateTestName()); } // namespace cts } // namespace hal } // namespace iree ``` (I referenced https://crascit.com/2017/04/18/generated-sources-in-cmake-builds/ for guidance on generating files from templates in CMake) This also drops support for running these tests through Bazel. Support could be added back, but the file and test generation is sufficiently weird that I'd rather not support both build systems. I also think we have sufficient CI coverage for the HAL in open source (where nearly all HAL development happens) using CMake that Bazel support won't be very useful.
IREE (Intermediate Representation Execution Environment, pronounced as “eerie”) is an MLIR-based end-to-end compiler and runtime that lowers Machine Learning (ML) models to a unified IR that scales up to meet the needs of the datacenter and down to satisfy the constraints and special considerations of mobile and edge deployments.
See our website for project details, user guides, and instructions on building from source.
IREE is still in its early phase. We have settled down on the overarching infrastructure and are actively improving various software components as well as project logistics. It is still quite far from ready for everyday use and is made available without any support at the moment. With that said, we welcome any kind of feedback on any communication channels!
See our website for more information.
IREE is licensed under the terms of the Apache 2.0 License with LLVM Exceptions. See LICENSE for more information.