2020-05-21 01:48:45 +08:00
|
|
|
# Invoke gen_onnx_mlir.py to obtain ONNXOps.td.inc, OpBuildTable.inc.
|
2020-04-08 15:00:34 +08:00
|
|
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/ONNXOps.td.inc
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/OpBuildTable.inc
|
2020-05-21 01:48:45 +08:00
|
|
|
COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/gen_onnx_mlir.py
|
|
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gen_onnx_mlir.py)
|
2020-04-08 15:00:34 +08:00
|
|
|
|
2020-05-18 21:44:31 +08:00
|
|
|
# Move the generated files to respective destinations:
|
2020-04-08 15:00:34 +08:00
|
|
|
# ONNXOps.td.inc -> src/Dialect/ONNX/ONNXOps.td.inc
|
2020-04-11 16:03:41 +08:00
|
|
|
add_custom_target(OMONNXOpsTableGenIncGen
|
2020-05-18 21:44:31 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E rename
|
2020-04-08 15:00:34 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/ONNXOps.td.inc
|
|
|
|
${ONNX_MLIR_SRC_ROOT}/src/Dialect/ONNX/ONNXOps.td.inc
|
|
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ONNXOps.td.inc)
|
|
|
|
|
|
|
|
# OpBuildTable.inc -> src/Builder/OpBuildTable.inc
|
2020-04-11 16:03:41 +08:00
|
|
|
add_custom_target(OMONNXOpsBuildTableIncGen
|
2020-05-18 21:44:31 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E rename
|
2020-04-08 15:00:34 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/OpBuildTable.inc
|
|
|
|
${ONNX_MLIR_SRC_ROOT}/src/Builder/OpBuildTable.inc
|
|
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/OpBuildTable.inc)
|
|
|
|
|
|
|
|
add_custom_target(OMONNXOpsIncTranslation
|
|
|
|
DEPENDS OMONNXOpsTableGenIncGen
|
2020-04-11 16:03:41 +08:00
|
|
|
OMONNXOpsBuildTableIncGen)
|
2020-05-13 06:43:44 +08:00
|
|
|
|
2020-05-21 01:48:45 +08:00
|
|
|
# Invoke gen_onnx_mlir.py to obtain ONNXOps.td.inc, OpBuildTable.inc.
|
2020-05-13 06:43:44 +08:00
|
|
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/MLONNXOps.td.inc
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/MLOpBuildTable.inc
|
2020-05-21 01:48:45 +08:00
|
|
|
COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/gen_onnx_mlir.py --domain="ONNX_ML"
|
|
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gen_onnx_mlir.py)
|
2020-05-18 21:44:31 +08:00
|
|
|
|
|
|
|
# Move the generated files to respective destinations:
|
|
|
|
# MLONNXOps.td.inc -> src/Dialect/MLONNX/MLONNXOps.td.inc
|
2020-05-13 06:43:44 +08:00
|
|
|
add_custom_target(OMMLONNXOpsTableGenIncGen
|
2020-05-18 21:44:31 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E rename
|
2020-05-13 06:43:44 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/MLONNXOps.td.inc
|
|
|
|
${ONNX_MLIR_SRC_ROOT}/src/Dialect/MLONNX/MLONNXOps.td.inc
|
|
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/MLONNXOps.td.inc)
|
|
|
|
|
2020-05-18 21:44:31 +08:00
|
|
|
# MLOpBuildTable.inc -> src/Builder/MLOpBuildTable.inc
|
2020-05-13 06:43:44 +08:00
|
|
|
add_custom_target(OMMLONNXOpsBuildTableIncGen
|
2020-05-18 21:44:31 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E rename
|
2020-05-13 06:43:44 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/MLOpBuildTable.inc
|
|
|
|
${ONNX_MLIR_SRC_ROOT}/src/Builder/MLOpBuildTable.inc
|
|
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/MLOpBuildTable.inc)
|
|
|
|
|
|
|
|
add_custom_target(OMMLONNXOpsIncTranslation
|
|
|
|
DEPENDS OMMLONNXOpsTableGenIncGen
|
|
|
|
OMMLONNXOpsBuildTableIncGen)
|
2020-05-21 01:48:45 +08:00
|
|
|
|
|
|
|
add_custom_target(OMONNXCheckVersion
|
|
|
|
COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/gen_onnx_mlir.py --check-operation-version)
|
|
|
|
|
|
|
|
add_custom_target(OMMLONNXCheckVersion
|
|
|
|
COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/gen_onnx_mlir.py
|
|
|
|
--check-operation-version --domain="ONNX_ML")
|
|
|
|
|