modify build in dialect

This commit is contained in:
colin 2020-10-12 15:14:29 +08:00
parent 8af23c97e9
commit 1b2fae016f
3 changed files with 17 additions and 13 deletions

View File

@ -9,7 +9,6 @@ load("//third_party:repo.bzl", "tf_http_archive")
LLVM_COMMIT = "85763e0758fbd238c81f233c6f9510e81c7de177" # llvm 12 LLVM_COMMIT = "85763e0758fbd238c81f233c6f9510e81c7de177" # llvm 12
LLVM_COMMIT_xx = "91671e13efbc5dbd17b832d7973401350d0a6ee6" #
LLVM_BAZEL_TAG = "llvm-project-%s" % (LLVM_COMMIT,) LLVM_BAZEL_TAG = "llvm-project-%s" % (LLVM_COMMIT,)
LLVM_BAZEL_SHA256 = "5d358075abc2db8192c138bdaa6ce74f2c59a0bde6d7d57813f3fc66d6b6da34" LLVM_BAZEL_SHA256 = "5d358075abc2db8192c138bdaa6ce74f2c59a0bde6d7d57813f3fc66d6b6da34"
@ -20,19 +19,17 @@ http_archive(
url = "https://github.com/google/llvm-bazel/archive/{tag}.tar.gz".format(tag = LLVM_BAZEL_TAG), url = "https://github.com/google/llvm-bazel/archive/{tag}.tar.gz".format(tag = LLVM_BAZEL_TAG),
) )
# LLVM_SHA256 = "f33108ba4bc81c6704753838ee4d85ad87e195fda3df991c2b00f18872a9e2dd" LLVM_SHA256 = "f33108ba4bc81c6704753838ee4d85ad87e195fda3df991c2b00f18872a9e2dd"
LLVM_SHA256 = "" LLVM_SHA256 = ""
LLVM_URLS = [ LLVM_URLS = [
# "https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT), # "https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT),
"https://github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT_xx), "https://github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT),
# "https://github.com/llvm/llvm-project/archive/llvmorg-11.0.0-rc6.tar.gz"
] ]
http_archive( http_archive(
name = "llvm-project-raw", name = "llvm-project-raw",
build_file_content = "#empty", build_file_content = "#empty",
sha256 = LLVM_SHA256, sha256 = LLVM_SHA256,
strip_prefix = "llvm-project-" + LLVM_COMMIT_xx, strip_prefix = "llvm-project-" + LLVM_COMMIT,
# strip_prefix = "llvm-project-85763e0758fbd238c81f233c6f9510e81c7de177",
urls = LLVM_URLS, urls = LLVM_URLS,
) )
load("@llvm-bazel//:configure.bzl", "llvm_configure") load("@llvm-bazel//:configure.bzl", "llvm_configure")

View File

@ -15,10 +15,6 @@ gentbl(
td_includes = ["."], td_includes = ["."],
td_srcs = [ td_srcs = [
"ONNXOps.td.inc", "ONNXOps.td.inc",
# "//src/Interface:PromotableConstOperandsOpInterface.td",
# "//src/Interface:ResultTypeInferenceOpInterface.td",
# "//src/Interface:ShapeInferenceInterface.td",
"@llvm-project//mlir:TdFiles", "@llvm-project//mlir:TdFiles",
], ],
) )
@ -27,9 +23,7 @@ cc_library(
name = "OMONNXOps", name = "OMONNXOps",
srcs = [ srcs = [
"ONNXOps.cpp", "ONNXOps.cpp",
# "ONNXOps.hpp",
"ONNXOpsHelper.cpp", "ONNXOpsHelper.cpp",
# "ONNXOpsHelper.hpp",
], ],
hdrs = glob([ hdrs = glob([
"**/*.hpp", "**/*.hpp",
@ -48,8 +42,18 @@ cc_library(
"@llvm-project//mlir:IR", "@llvm-project//mlir:IR",
"@llvm-project//mlir:Shape", "@llvm-project//mlir:Shape",
# "@llvm-project//mlir:AffineOps",
"@llvm-project//mlir:Dialect",
"@llvm-project//mlir:ExecutionEngine",
"@llvm-project//mlir:LLVMDialect",
# "@llvm-project//mlir:LoopOps",
"@llvm-project//mlir:MlirOptLib",
"@llvm-project//mlir:Parser",
"@llvm-project//mlir:StandardOps",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:VectorOps",
# "@llvm-project//mlir:Support", # "@llvm-project//mlir:Support",
# "@llvm-project//mlir:TableGen", # "@llvm-project//mlir:TableGen",
], ],
) )

View File

@ -57,6 +57,7 @@ cc_library(
deps = [ deps = [
":OMPromotableConstOperandsOpInterfaceIncGen", ":OMPromotableConstOperandsOpInterfaceIncGen",
"@llvm-project//mlir:IR", "@llvm-project//mlir:IR",
"@llvm-project//mlir:Shape",
], ],
) )
@ -71,6 +72,7 @@ cc_library(
deps = [ deps = [
":ShapeInferenceOpInterfaceIncGen", ":ShapeInferenceOpInterfaceIncGen",
"@llvm-project//mlir:IR", "@llvm-project//mlir:IR",
"@llvm-project//mlir:Shape",
], ],
) )
@ -85,5 +87,6 @@ cc_library(
deps = [ deps = [
":OMResultTypeInferenceOpInterfaceIncGen", ":OMResultTypeInferenceOpInterfaceIncGen",
"@llvm-project//mlir:IR", "@llvm-project//mlir:IR",
"@llvm-project//mlir:Shape",
], ],
) )