File tree Expand file tree Collapse file tree 8 files changed +18
-17
lines changed Expand file tree Collapse file tree 8 files changed +18
-17
lines changed Original file line number Diff line number Diff line change @@ -86,9 +86,16 @@ set_target_properties(mlir-headers PROPERTIES FOLDER "Misc")
86
86
add_dependencies (mlir-headers mlir-generic-headers )
87
87
add_custom_target (mlir-doc )
88
88
89
+ # Only enable execution engine if the native target is available.
90
+ if (${LLVM_NATIVE_ARCH} IN_LIST LLVM_TARGETS_TO_BUILD )
91
+ set (MLIR_ENABLE_EXECUTION_ENGINE 1 )
92
+ else ()
93
+ set (MLIR_ENABLE_EXECUTION_ENGINE 0 )
94
+ endif ()
95
+
89
96
# Build the CUDA conversions and run according tests if the NVPTX backend
90
97
# is available
91
- if ("NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD )
98
+ if ("NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD AND MLIR_ENABLE_EXECUTION_ENGINE )
92
99
set (MLIR_ENABLE_CUDA_CONVERSIONS 1 )
93
100
else ()
94
101
set (MLIR_ENABLE_CUDA_CONVERSIONS 0 )
@@ -97,8 +104,8 @@ endif()
97
104
add_definitions (-DMLIR_CUDA_CONVERSIONS_ENABLED=${MLIR_ENABLE_CUDA_CONVERSIONS} )
98
105
99
106
# Build the ROCm conversions and run according tests if the AMDGPU backend
100
- # is available
101
- if ("AMDGPU" IN_LIST LLVM_TARGETS_TO_BUILD )
107
+ # is available.
108
+ if ("AMDGPU" IN_LIST LLVM_TARGETS_TO_BUILD AND MLIR_ENABLE_EXECUTION_ENGINE )
102
109
set (MLIR_ENABLE_ROCM_CONVERSIONS 1 )
103
110
else ()
104
111
set (MLIR_ENABLE_ROCM_CONVERSIONS 0 )
Original file line number Diff line number Diff line change @@ -15,8 +15,7 @@ add_subdirectory(IR)
15
15
add_subdirectory (RegisterEverything )
16
16
add_subdirectory (Transforms )
17
17
18
- # Only enable the ExecutionEngine if the native target is configured in.
19
- if (TARGET ${LLVM_NATIVE_ARCH} )
18
+ if (MLIR_ENABLE_EXECUTION_ENGINE )
20
19
add_subdirectory (ExecutionEngine )
21
20
endif ()
22
21
Original file line number Diff line number Diff line change @@ -39,8 +39,7 @@ add_mlir_library(MLIRExecutionEngineUtils
39
39
Passes
40
40
)
41
41
42
- # Only enable the ExecutionEngine if the native target is configured in.
43
- if (NOT TARGET ${LLVM_NATIVE_ARCH} )
42
+ if (NOT MLIR_ENABLE_EXECUTION_ENGINE )
44
43
return ()
45
44
endif ()
46
45
Original file line number Diff line number Diff line change @@ -363,8 +363,7 @@ declare_mlir_python_extension(MLIRPythonExtension.AsyncDialectPasses
363
363
MLIRCAPIAsync
364
364
)
365
365
366
- # Only enable the ExecutionEngine if the native target is configured in.
367
- if (TARGET ${LLVM_NATIVE_ARCH} )
366
+ if (MLIR_ENABLE_EXECUTION_ENGINE )
368
367
declare_mlir_python_extension (MLIRPythonExtension.ExecutionEngine
369
368
MODULE_NAME _mlirExecutionEngine
370
369
ADD_TO_PARENT MLIRPythonSources.ExecutionEngine
Original file line number Diff line number Diff line change @@ -19,8 +19,7 @@ function(_add_capi_test_executable name)
19
19
endif ()
20
20
endfunction (_add_capi_test_executable )
21
21
22
- # Only enable the ExecutionEngine if the native target is configured in.
23
- if (TARGET ${LLVM_NATIVE_ARCH} )
22
+ if (MLIR_ENABLE_EXECUTION_ENGINE )
24
23
_add_capi_test_executable (mlir-capi-execution-engine-test
25
24
execution_engine.c
26
25
LINK_LIBS PRIVATE
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ if (MLIR_INCLUDE_INTEGRATION_TESTS)
40
40
41
41
42
42
# The native target may not be enabled when cross compiling, raise an error.
43
- if (NOT TARGET ${LLVM_NATIVE_ARCH} )
43
+ if (NOT MLIR_ENABLE_EXECUTION_ENGINE )
44
44
message (FATAL_ERROR "MLIR_INCLUDE_INTEGRATION_TESTS requires a native target" )
45
45
endif ()
46
46
Original file line number Diff line number Diff line change @@ -9,8 +9,7 @@ add_subdirectory(mlir-translate)
9
9
add_subdirectory (mlir-vulkan-runner )
10
10
add_subdirectory (tblgen-lsp-server )
11
11
12
- # mlir-cpu-runner requires ExecutionEngine which is only built
13
- # when the native target is configured in.
14
- if (TARGET ${LLVM_NATIVE_ARCH} )
12
+ # mlir-cpu-runner requires ExecutionEngine.
13
+ if (MLIR_ENABLE_EXECUTION_ENGINE )
15
14
add_subdirectory (mlir-cpu-runner )
16
15
endif ()
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ add_subdirectory(Rewrite)
16
16
add_subdirectory (TableGen )
17
17
add_subdirectory (Transforms )
18
18
19
- # The native target may not be enabled when cross compiling.
20
- if (TARGET ${LLVM_NATIVE_ARCH} )
19
+ if (MLIR_ENABLE_EXECUTION_ENGINE )
21
20
add_subdirectory (ExecutionEngine )
22
21
endif ()
You can’t perform that action at this time.
0 commit comments