CMakeLists.txt 929 字节
Newer Older
M
Megvii Engine Team 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
set(MGB_MLIR_TABLEGEN_INC_BASE ${CMAKE_CURRENT_BINARY_DIR}/include/)
file(MAKE_DIRECTORY ${MGB_MLIR_TABLEGEN_INC_BASE}/megbrain/jit/mlir/ir/)
list(APPEND MGB_MLIR_TABLEGEN_INC ${MGB_MLIR_TABLEGEN_INC_BASE})

external_tablegen_library(
    NAME
        mlir_shape_inference
    TBLGEN
        MLIR
    SRCS
        "shape_inference_interface.td"
    INCLUDES
        ${MGB_MLIR_TABLEGEN_INC} ${MLIR_LLVM_INCLUDE_DIR}
    OUTS
        -gen-op-interface-decls include/megbrain/jit/mlir/ir/shape_inference_interface.h.inc
        -gen-op-interface-defs include/megbrain/jit/mlir/ir/shape_inference_interface.cpp.inc
)

external_tablegen_library(
    NAME
        mlir_op_def
    TBLGEN
        MLIR
    SRCS
        "ops.td"
    INCLUDES
        ${MGB_MLIR_TABLEGEN_INC} ${MLIR_LLVM_INCLUDE_DIR}
    OUTS
        -gen-op-decls  include/megbrain/jit/mlir/ir/ops.h.inc
        -gen-op-defs   include/megbrain/jit/mlir/ir/ops.cpp.inc
)