Skip to content

Commit

Permalink
merge from master
Browse files Browse the repository at this point in the history
Signed-off-by: inocsin <vcheungyi@163.com>
  • Loading branch information
inocsin committed Oct 20, 2021
2 parents 0bc3c05 + 601ca12 commit 606d4de
Show file tree
Hide file tree
Showing 117 changed files with 2,180 additions and 1,110 deletions.
2 changes: 2 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ pkg_tar(
name = "libtrtorch",
srcs = [
"//:LICENSE",
"//bzl_def:BUILD",
"//bzl_def:WORKSPACE"
],
extension = "tar.gz",
package_dir = "trtorch",
Expand Down
7 changes: 7 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ git_repository(
shallow_since = "1570114335 -0400",
)

# External dependency for trtorch if you already have precompiled binaries.
# This is currently used in pytorch NGC container CI testing.
local_repository(
name = "trtorch",
path = "/opt/conda/lib/python3.8/site-packages/trtorch"
)

# CUDA should be installed on the system locally
new_local_repository(
name = "cuda",
Expand Down
79 changes: 79 additions & 0 deletions bzl_def/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package(default_visibility = ["//visibility:public"])

config_setting(
name = "aarch64_linux",
constraint_values = [
"@platforms//cpu:aarch64",
"@platforms//os:linux",
],
)

config_setting(
name = "windows",
constraint_values = [
"@platforms//os:windows",
],
)

cc_library(
name = "libtrtorch",
srcs = select({
":windows": [
"lib/x64/trtorch.dll",
],
"//conditions:default": [
"lib/libtrtorch.so",
],
}),
hdrs = glob([
"include/**/*.h",
]),
strip_include_prefix = "include",
includes = ["include/"]
)

cc_library(
name = "libtrtorchrt",
srcs = select({
":windows": [
"lib/x64/trtorchrt.dll"
],
"//conditions:default": [
"lib/libtrtorchrt.so"
]
})
)

cc_library(
name = "libtrtorch_plugins",
srcs = select({
":windows": [
"lib/x64/trtorch_plugins.dll"
],
"//conditions:default": [
"lib/libtrtorch_plugins.so"
]
}),
hdrs = glob([
"include/trtorch/core/plugins/**/*.h",
]),
strip_include_prefix = "include",
includes = ["include/"]
)

cc_library(
name = "trtorch_core_hdrs",
hdrs = glob([
"include/trtorch/core/**/*.h"
]),
strip_include_prefix = "include/trtorch",
includes = ["include/trtorch/"]
)

# Alias for ease of use
cc_library(
name = "trtorch",
deps = [
":libtrtorch",
]
)
6 changes: 6 additions & 0 deletions bzl_def/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package(default_visibility = ["//visibility:public"])

exports_files([
"WORKSPACE",
"BUILD"
])
1 change: 1 addition & 0 deletions bzl_def/WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
workspace(name = "trtorch")
Loading

0 comments on commit 606d4de

Please sign in to comment.