Skip to content

Commit fb27bcf

Browse files
committed
Merge pull request #592 from NVIDIA/src_tree_reorg
refactor: Move example apps out of cpp
2 parents f8ad361 + 3c397dd commit fb27bcf

File tree

34 files changed

+224
-468
lines changed

34 files changed

+224
-468
lines changed

BUILD

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ pkg_tar(
3333
pkg_tar(
3434
name = "include",
3535
srcs = [
36-
"//cpp/api:api_headers",
36+
"//cpp:api_headers",
3737
],
3838
package_dir = "include/trtorch/",
3939
)
4040

4141
pkg_tar(
4242
name = "lib",
4343
srcs = select({
44-
":windows": ["//cpp/api/lib:trtorch.dll"],
44+
":windows": ["//cpp/lib:trtorch.dll"],
4545
"//conditions:default": [
46-
"//cpp/api/lib:libtrtorch.so",
47-
"//cpp/api/lib:libtrtorchrt.so",
48-
"//cpp/api/lib:libtrtorch_plugins.so",
46+
"//cpp/lib:libtrtorch.so",
47+
"//cpp/lib:libtrtorchrt.so",
48+
"//cpp/lib:libtrtorch_plugins.so",
4949
],
5050
}),
5151
mode = "0755",
@@ -55,7 +55,7 @@ pkg_tar(
5555
pkg_tar(
5656
name = "bin",
5757
srcs = [
58-
"//cpp/trtorchc",
58+
"//cpp/bin/trtorchc",
5959
],
6060
mode = "0755",
6161
package_dir = "bin/",

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,11 @@ You can register a converter for your op using the `NodeConverterRegistry` insid
222222

223223
| Component | Description |
224224
| ------------- | ------------------------------------------------------------ |
225-
| [**core**](core) | Main JIT ingest, lowering, conversion and execution implementations |
226-
| [**cpp**](cpp) | C++ specific components including API and example applications |
227-
| [**cpp/api**](cpp/api) | C++ API for TRTorch |
225+
| [**core**](core) | Main JIT ingest, lowering, conversion and runtime implementations |
226+
| [**cpp**](cpp) | C++ API and CLI source |
227+
| [**examples**](examples) | Example applications to show different features of TRTorch |
228228
| [**py**](py) | Python API for TRTorch |
229-
| [**tests**](tests) | Unit test for TRTorch |
229+
| [**tests**](tests) | Unit tests for TRTorch |
230230

231231
## Contributing
232232

cpp/BUILD

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
cc_library(
4+
name = "trtorch",
5+
srcs = [
6+
"src/compile_spec.cpp",
7+
"src/logging.cpp",
8+
"src/ptq.cpp",
9+
"src/trtorch.cpp",
10+
],
11+
hdrs = [
12+
"include/trtorch/logging.h",
13+
"include/trtorch/macros.h",
14+
"include/trtorch/ptq.h",
15+
"include/trtorch/trtorch.h",
16+
],
17+
linkstatic = True,
18+
strip_include_prefix = "include/",
19+
deps = [
20+
"//core",
21+
"//core/util:prelude",
22+
],
23+
alwayslink = True,
24+
)
25+
26+
filegroup(
27+
name = "api_headers",
28+
srcs = glob(["include/**/*.h"]),
29+
)

cpp/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# C++ API
2+
3+
Targets in module create the user facing C++ library for the TRTorch core.
4+
5+
## Building libtrtorch.so
6+
7+
### Debug build
8+
``` shell
9+
bazel build //cpp/lib:libtrtorch.so --compilation_mode=dbg
10+
```
11+
12+
### Release build
13+
14+
``` shell
15+
bazel build //cpp/lib:libtrtorch.so -c opt
16+
```
17+
18+
## Usage
19+
20+
``` c++
21+
#include "trtorch/trtorch.h"
22+
```

cpp/api/BUILD

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)