
Retry landing https://github.com/llvm/llvm-project/pull/153373 ## Major changes from previous attempt - remove the test in CAPI because no existing tests in CAPI deal with sanitizer exemptions - update `mlir/docs/Dialects/GPU.md` to reflect the new behavior: load GPU binary in global ctors, instead of loading them at call site. - skip the test on Aarch64 since we have an issue with initialization there --------- Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
143 lines
2.8 KiB
CMake
143 lines
2.8 KiB
CMake
function(_add_capi_test_executable name)
|
|
cmake_parse_arguments(ARG
|
|
""
|
|
""
|
|
"LINK_LIBS"
|
|
${ARGN})
|
|
set(LLVM_LINK_COMPONENTS
|
|
)
|
|
add_llvm_executable(${name}
|
|
PARTIAL_SOURCES_INTENDED
|
|
${ARG_UNPARSED_ARGUMENTS})
|
|
set_target_properties(${name} PROPERTIES FOLDER "MLIR/Tests")
|
|
set_target_properties(${name} PROPERTIES EXCLUDE_FROM_ALL ON)
|
|
|
|
llvm_update_compile_flags(${name})
|
|
if(MLIR_BUILD_MLIR_C_DYLIB)
|
|
target_link_libraries(${name} PRIVATE
|
|
LLVMCore
|
|
MLIR-C)
|
|
else()
|
|
target_link_libraries(${name} PRIVATE
|
|
${ARG_LINK_LIBS})
|
|
endif()
|
|
endfunction(_add_capi_test_executable)
|
|
|
|
if(MLIR_ENABLE_EXECUTION_ENGINE)
|
|
_add_capi_test_executable(mlir-capi-execution-engine-test
|
|
execution_engine.c
|
|
LINK_LIBS PRIVATE
|
|
MLIRCAPIConversion
|
|
MLIRCAPIExecutionEngine
|
|
MLIRCAPIRegisterEverything
|
|
)
|
|
_add_capi_test_executable(mlir-capi-global-constructors-test
|
|
global_constructors.c
|
|
LINK_LIBS PRIVATE
|
|
MLIRCAPIConversion
|
|
MLIRCAPIExecutionEngine
|
|
MLIRCAPIRegisterEverything
|
|
)
|
|
endif()
|
|
|
|
_add_capi_test_executable(mlir-capi-ir-test
|
|
ir.c
|
|
LINK_LIBS PRIVATE
|
|
MLIRCAPIIR
|
|
MLIRCAPIFunc
|
|
MLIRCAPIRegisterEverything
|
|
)
|
|
|
|
_add_capi_test_executable(mlir-capi-irdl-test
|
|
irdl.c
|
|
LINK_LIBS PRIVATE
|
|
MLIRCAPIIR
|
|
MLIRCAPIIRDL
|
|
)
|
|
|
|
_add_capi_test_executable(mlir-capi-llvm-test
|
|
llvm.c
|
|
LINK_LIBS PRIVATE
|
|
MLIRCAPIIR
|
|
MLIRCAPILLVM
|
|
MLIRCAPIRegisterEverything
|
|
)
|
|
|
|
_add_capi_test_executable(mlir-capi-pass-test
|
|
pass.c
|
|
LINK_LIBS PRIVATE
|
|
MLIRCAPIFunc
|
|
MLIRCAPIIR
|
|
MLIRCAPIRegisterEverything
|
|
MLIRCAPITransforms
|
|
)
|
|
|
|
_add_capi_test_executable(mlir-capi-pdl-test
|
|
pdl.c
|
|
LINK_LIBS PRIVATE
|
|
MLIRCAPIIR
|
|
MLIRCAPIRegisterEverything
|
|
MLIRCAPIPDL
|
|
)
|
|
|
|
_add_capi_test_executable(mlir-capi-sparse-tensor-test
|
|
sparse_tensor.c
|
|
LINK_LIBS PRIVATE
|
|
MLIRCAPIIR
|
|
MLIRCAPIRegisterEverything
|
|
MLIRCAPISparseTensor
|
|
)
|
|
|
|
_add_capi_test_executable(mlir-capi-quant-test
|
|
quant.c
|
|
LINK_LIBS PRIVATE
|
|
MLIRCAPIIR
|
|
MLIRCAPIRegisterEverything
|
|
MLIRCAPIQuant
|
|
)
|
|
|
|
_add_capi_test_executable(mlir-capi-rewrite-test
|
|
rewrite.c
|
|
LINK_LIBS PRIVATE
|
|
MLIRCAPIIR
|
|
MLIRCAPIRegisterEverything
|
|
MLIRCAPITransforms
|
|
)
|
|
|
|
|
|
_add_capi_test_executable(mlir-capi-transform-test
|
|
transform.c
|
|
LINK_LIBS PRIVATE
|
|
MLIRCAPIIR
|
|
MLIRCAPIRegisterEverything
|
|
MLIRCAPITransformDialect
|
|
)
|
|
|
|
_add_capi_test_executable(mlir-capi-transform-interpreter-test
|
|
transform_interpreter.c
|
|
LINK_LIBS PRIVATE
|
|
MLIRCAPIIR
|
|
MLIRCAPIRegisterEverything
|
|
MLIRCAPITransformDialect
|
|
MLIRCAPITransformDialectTransforms
|
|
)
|
|
|
|
_add_capi_test_executable(mlir-capi-translation-test
|
|
translation.c
|
|
LINK_LIBS PRIVATE
|
|
MLIRCAPIIR
|
|
MLIRCAPILLVM
|
|
MLIRCAPIRegisterEverything
|
|
MLIRCAPITarget
|
|
)
|
|
|
|
_add_capi_test_executable(mlir-capi-smt-test
|
|
smt.c
|
|
|
|
LINK_LIBS PRIVATE
|
|
MLIRCAPIIR
|
|
MLIRCAPIFunc
|
|
MLIRCAPISMT
|
|
MLIRCAPIExportSMTLIB
|
|
)
|