1# NVIDIA TensorRT 2# A high-performance deep learning inference optimizer and runtime. 3 4licenses(["notice"]) 5 6load("@local_config_cuda//cuda:build_defs.bzl", "cuda_default_copts") 7load("@bazel_skylib//:bzl_library.bzl", "bzl_library") 8 9package(default_visibility = ["//visibility:public"]) 10 11exports_files(["LICENSE"]) 12 13config_setting( 14 name = "use_static_tensorrt", 15 define_values = {"TF_TENSORRT_STATIC":"1"}, 16) 17 18cc_library( 19 name = "tensorrt_headers", 20 hdrs = [ 21 "tensorrt/include/tensorrt_config.h", 22 ":tensorrt_include" 23 ], 24 include_prefix = "third_party/tensorrt", 25 strip_include_prefix = "tensorrt/include", 26) 27 28cc_library( 29 name = "tensorrt", 30 srcs = select({ 31 ":use_static_tensorrt": [":tensorrt_static_lib"], 32 "//conditions:default": [":tensorrt_lib"], 33 }), 34 copts = cuda_default_copts(), 35 data = select({ 36 ":use_static_tensorrt": [], 37 "//conditions:default": [":tensorrt_lib"], 38 }), 39 linkstatic = 1, 40 deps = [ 41 ":tensorrt_headers", 42 # TODO(b/174608722): fix this line. 43 "@local_config_cuda//cuda", 44 ], 45) 46 47bzl_library( 48 name = "build_defs_bzl", 49 srcs = ["build_defs.bzl"], 50 deps = [ 51 "@bazel_skylib//lib:selects", 52 ], 53) 54 55py_library( 56 name = "tensorrt_config_py", 57 srcs = ["tensorrt/tensorrt_config.py"] 58) 59 60%{copy_rules} 61