Alex Zinenko | 029e199 | 2020-11-17 17:28:16 | [diff] [blame] | 1 | add_subdirectory(Bindings) |
Alex Zinenko | 75f239e | 2020-08-05 12:36:16 | [diff] [blame] | 2 | add_subdirectory(CAPI) |
Alex Zinenko | 3183394 | 2019-05-17 22:03:39 | [diff] [blame] | 3 | add_subdirectory(EDSC) |
Alex Zinenko | 6804cf2 | 2019-05-21 14:22:35 | [diff] [blame] | 4 | add_subdirectory(SDBM) |
Nicolas Vasilache | dac75ae | 2019-06-24 21:35:21 | [diff] [blame] | 5 | add_subdirectory(lib) |
Nicolas Vasilache | 5c64d2a | 2019-05-13 17:59:04 | [diff] [blame] | 6 | |
Mehdi Amini | 38b71d6 | 2019-04-02 17:02:07 | [diff] [blame] | 7 | llvm_canonicalize_cmake_booleans( |
Stella Laurenzo | 722475a | 2020-07-07 06:05:46 | [diff] [blame] | 8 | MLIR_BINDINGS_PYTHON_ENABLED |
Mehdi Amini | 38b71d6 | 2019-04-02 17:02:07 | [diff] [blame] | 9 | LLVM_BUILD_EXAMPLES |
Stella Laurenzo | abd6574 | 2020-07-09 00:54:56 | [diff] [blame] | 10 | MLIR_CUDA_CONVERSIONS_ENABLED |
| 11 | MLIR_CUDA_RUNNER_ENABLED |
| 12 | MLIR_ROCM_CONVERSIONS_ENABLED |
| 13 | MLIR_ROCM_RUNNER_ENABLED |
Vladislav Vinogradov | 9667d15 | 2021-01-12 16:06:06 | [diff] [blame] | 14 | MLIR_SPIRV_CPU_RUNNER_ENABLED |
Stella Laurenzo | abd6574 | 2020-07-09 00:54:56 | [diff] [blame] | 15 | MLIR_VULKAN_RUNNER_ENABLED |
Mehdi Amini | 38b71d6 | 2019-04-02 17:02:07 | [diff] [blame] | 16 | ) |
| 17 | |
Nicolas Vasilache | 6aa5cc8 | 2019-05-15 16:26:27 | [diff] [blame] | 18 | # Passed to lit.site.cfg.py.in to set up the path where to find the libraries |
| 19 | # for linalg integration tests. |
Nicolas Vasilache | 9059cf3 | 2019-11-26 16:47:14 | [diff] [blame] | 20 | set(MLIR_DIALECT_LINALG_INTEGRATION_TEST_LIB_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) |
Uday Bondhugula | 7fca0e9 | 2020-03-27 09:20:05 | [diff] [blame] | 21 | set(MLIR_RUNNER_UTILS_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) |
Nicolas Vasilache | 6aa5cc8 | 2019-05-15 16:26:27 | [diff] [blame] | 22 | |
Stephan Herhut | e8b21a7 | 2019-07-04 14:49:52 | [diff] [blame] | 23 | # Passed to lit.site.cfg.py.in to set up the path where to find the libraries |
Christian Sigg | 9d7be77 | 2021-03-03 10:24:38 | [diff] [blame^] | 24 | # for the mlir rocm / spirv / vulkan runner tests. |
Wen-Heng (Jack) Chung | 2fd6403 | 2020-05-20 21:07:49 | [diff] [blame] | 25 | set(MLIR_ROCM_WRAPPER_LIBRARY_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) |
George Mitenkov | 89808ce | 2020-10-23 14:46:18 | [diff] [blame] | 26 | set(MLIR_SPIRV_WRAPPER_LIBRARY_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) |
Denis Khalikov | 896ee36 | 2020-02-19 14:11:22 | [diff] [blame] | 27 | set(MLIR_VULKAN_WRAPPER_LIBRARY_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) |
Stephan Herhut | e8b21a7 | 2019-07-04 14:49:52 | [diff] [blame] | 28 | |
Mehdi Amini | 99b0032 | 2021-02-23 00:56:01 | [diff] [blame] | 29 | if (MLIR_INCLUDE_INTEGRATION_TESTS) |
| 30 | set(INTEL_SDE_EXECUTABLE "" CACHE STRING |
| 31 | "If set, arch-specific integration tests are run with Intel SDE.") |
| 32 | option(MLIR_RUN_AVX512_TESTS "Run AVX512 tests.") |
| 33 | # Passed to lit.site.cfg.py.in to set up the path where to find the libraries. |
| 34 | set(MLIR_INTEGRATION_TEST_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) |
| 35 | |
| 36 | # Copy test data over. |
| 37 | file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/Integration/data/test.mtx |
| 38 | ${CMAKE_CURRENT_SOURCE_DIR}/Integration/data/test.tns |
| 39 | DESTINATION ${MLIR_INTEGRATION_TEST_DIR}/data/) |
| 40 | endif() |
| 41 | |
Jacques Pienaar | 1273af2 | 2019-03-30 05:10:12 | [diff] [blame] | 42 | configure_lit_site_cfg( |
| 43 | ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in |
| 44 | ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py |
| 45 | MAIN_CONFIG |
| 46 | ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py |
| 47 | ) |
| 48 | configure_lit_site_cfg( |
| 49 | ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in |
| 50 | ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py |
| 51 | MAIN_CONFIG |
| 52 | ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py |
| 53 | ) |
| 54 | |
| 55 | set(MLIR_TEST_DEPENDS |
| 56 | FileCheck count not |
Alex Zinenko | 75f239e | 2020-08-05 12:36:16 | [diff] [blame] | 57 | mlir-capi-ir-test |
Mehdi Amini | f61d102 | 2020-11-03 21:38:34 | [diff] [blame] | 58 | mlir-capi-pass-test |
Jacques Pienaar | 1273af2 | 2019-03-30 05:10:12 | [diff] [blame] | 59 | mlir-cpu-runner |
Alex Zinenko | 29c7929 | 2019-05-22 19:13:54 | [diff] [blame] | 60 | mlir-edsc-builder-api-test |
Nicolas Vasilache | 882ba48 | 2020-04-10 17:54:08 | [diff] [blame] | 61 | mlir-linalg-ods-gen |
Jacques Pienaar | 1273af2 | 2019-03-30 05:10:12 | [diff] [blame] | 62 | mlir-opt |
Mauricio Sifontes | ec04ce4 | 2020-07-07 23:42:40 | [diff] [blame] | 63 | mlir-reduce |
Alex Zinenko | 6804cf2 | 2019-05-21 14:22:35 | [diff] [blame] | 64 | mlir-sdbm-api-test |
Jacques Pienaar | 1273af2 | 2019-03-30 05:10:12 | [diff] [blame] | 65 | mlir-tblgen |
| 66 | mlir-translate |
Nicolas Vasilache | 512f345 | 2020-02-27 17:58:41 | [diff] [blame] | 67 | mlir_runner_utils |
Nicolas Vasilache | 4a966e5 | 2020-02-27 18:45:43 | [diff] [blame] | 68 | mlir_c_runner_utils |
Lei Zhang | 36ce915 | 2020-10-22 19:20:42 | [diff] [blame] | 69 | mlir_async_runtime |
Jacques Pienaar | 1273af2 | 2019-03-30 05:10:12 | [diff] [blame] | 70 | ) |
| 71 | |
Christian Sigg | 9d7be77 | 2021-03-03 10:24:38 | [diff] [blame^] | 72 | if(MLIR_CUDA_RUNNER_ENABLED) |
| 73 | list(APPEND MLIR_TEST_DEPENDS mlir_cuda_runtime) |
| 74 | endif() |
| 75 | |
Mehdi Amini | 09cfec6 | 2021-02-11 01:17:24 | [diff] [blame] | 76 | list(APPEND MLIR_TEST_DEPENDS MLIRUnitTests) |
Michał Górny | 2aa1af9 | 2021-02-02 19:09:45 | [diff] [blame] | 77 | |
Mehdi Amini | 38b71d6 | 2019-04-02 17:02:07 | [diff] [blame] | 78 | if(LLVM_BUILD_EXAMPLES) |
| 79 | list(APPEND MLIR_TEST_DEPENDS |
| 80 | toyc-ch1 |
Mehdi Amini | 213dda6 | 2019-04-02 20:11:20 | [diff] [blame] | 81 | toyc-ch2 |
Mehdi Amini | 092f3fa | 2019-04-04 02:16:32 | [diff] [blame] | 82 | toyc-ch3 |
Mehdi Amini | d33a9dc | 2019-04-05 01:31:31 | [diff] [blame] | 83 | toyc-ch4 |
Mehdi Amini | c39592b | 2019-04-09 06:00:49 | [diff] [blame] | 84 | toyc-ch5 |
River Riddle | 0372eb4 | 2019-10-17 21:21:44 | [diff] [blame] | 85 | toyc-ch6 |
River Riddle | 6b4e30b | 2019-11-07 17:53:27 | [diff] [blame] | 86 | toyc-ch7 |
Mehdi Amini | 38b71d6 | 2019-04-02 17:02:07 | [diff] [blame] | 87 | ) |
| 88 | endif() |
| 89 | |
Stephan Herhut | e8b21a7 | 2019-07-04 14:49:52 | [diff] [blame] | 90 | if(MLIR_CUDA_RUNNER_ENABLED) |
| 91 | list(APPEND MLIR_TEST_DEPENDS |
| 92 | mlir-cuda-runner |
| 93 | ) |
| 94 | endif() |
| 95 | |
Wen-Heng (Jack) Chung | 2fd6403 | 2020-05-20 21:07:49 | [diff] [blame] | 96 | if(MLIR_ROCM_RUNNER_ENABLED) |
| 97 | list(APPEND MLIR_TEST_DEPENDS |
| 98 | mlir-rocm-runner |
| 99 | ) |
| 100 | endif() |
| 101 | |
George Mitenkov | 89808ce | 2020-10-23 14:46:18 | [diff] [blame] | 102 | if(MLIR_SPIRV_CPU_RUNNER_ENABLED) |
| 103 | add_subdirectory(mlir-spirv-cpu-runner) |
| 104 | list(APPEND MLIR_TEST_DEPENDS |
| 105 | mlir-spirv-cpu-runner |
| 106 | mlir_test_spirv_cpu_runner_c_wrappers |
| 107 | ) |
| 108 | endif() |
| 109 | |
Denis Khalikov | 896ee36 | 2020-02-19 14:11:22 | [diff] [blame] | 110 | if(MLIR_VULKAN_RUNNER_ENABLED) |
| 111 | list(APPEND MLIR_TEST_DEPENDS |
| 112 | mlir-vulkan-runner |
| 113 | ) |
| 114 | endif() |
| 115 | |
Stella Laurenzo | 722475a | 2020-07-07 06:05:46 | [diff] [blame] | 116 | if(MLIR_BINDINGS_PYTHON_ENABLED) |
| 117 | list(APPEND MLIR_TEST_DEPENDS |
| 118 | MLIRBindingsPythonExtension |
Alex Zinenko | 029e199 | 2020-11-17 17:28:16 | [diff] [blame] | 119 | MLIRBindingsPythonTestOps |
Mehdi Amini | dc43f78 | 2020-11-10 18:39:12 | [diff] [blame] | 120 | MLIRTransformsBindingsPythonExtension |
Stella Laurenzo | 722475a | 2020-07-07 06:05:46 | [diff] [blame] | 121 | ) |
| 122 | endif() |
| 123 | |
Jacques Pienaar | 1273af2 | 2019-03-30 05:10:12 | [diff] [blame] | 124 | add_lit_testsuite(check-mlir "Running the MLIR regression tests" |
| 125 | ${CMAKE_CURRENT_BINARY_DIR} |
| 126 | DEPENDS ${MLIR_TEST_DEPENDS} |
| 127 | ) |
| 128 | set_target_properties(check-mlir PROPERTIES FOLDER "Tests") |
| 129 | |
| 130 | add_lit_testsuites(MLIR ${CMAKE_CURRENT_SOURCE_DIR} |
Stephen Neuendorffer | 6282886 | 2020-05-15 17:33:13 | [diff] [blame] | 131 | DEPENDS ${MLIR_TEST_DEPENDS} |
Jacques Pienaar | 1273af2 | 2019-03-30 05:10:12 | [diff] [blame] | 132 | ) |