Skip to content

Commit 183f891

Browse files
committed
Update onnx-tensorrt and copyright headers (2021)
Signed-off-by: Rajeev Rao <rajeevrao@nvidia.com>
1 parent da988fd commit 183f891

470 files changed

Lines changed: 765 additions & 763 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
[submodule "parsers/onnx"]
1010
path = parsers/onnx
1111
url = https://github.com/onnx/onnx-tensorrt.git
12-
branch = 7.2.1
12+
branch = master

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
2+
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -194,4 +194,3 @@ endif()
194194
if(BUILD_SAMPLES)
195195
add_subdirectory(samples)
196196
endif()
197-

CODING-GUIDELINES.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ if (nbInputs == kNbInputsWBias) {/*...*/}
7676
* Public member variables do not require the 'm' prefix but it is highly encouraged to use the prefix when needed to improve code clarity, especially in cases where the class is a base class in an inheritance chain.
7777

7878
8. Constants
79-
* Enumerations, global constants, static constants at class-scope and function-scope magic-number/literal constants are uppercase snakecase with prefix 'k':
79+
* Enumerations, global constants, static constants at class-scope and function-scope magic-number/literal constants are uppercase snakecase with prefix 'k':
8080
```cpp
8181
const int kDIGIT_NUM = 10;
8282
```
@@ -103,7 +103,7 @@ Notes:
103103

104104
#### Formatting
105105
1. Use the [LLVM clang-format](https://clang.llvm.org/docs/ClangFormat.html) tool for formatting your changes prior to submitting the PR.
106-
2. Use a maximum of 120 characters per line. The auto formatting tool will wrap longer lines.
106+
2. Use a maximum of 120 characters per line. The auto formatting tool will wrap longer lines.
107107
3. Exceptions to formatting violations must be justified on a per-case basis. Bypassing the formatting rules is discouraged, but can be achieved for exceptions as follows:
108108
```cpp
109109
// clang-format off
@@ -133,7 +133,7 @@ doSomeOperation(/* checkForErrors = */ false);
133133
```cpp
134134
//! This is a Doxygen comment
135135
//! in C++ style
136-
136+
137137
struct Foo
138138
{
139139
int x; //!< This is a Doxygen comment for members
@@ -149,7 +149,7 @@ struct Foo
149149
#endif
150150
```
151151

152-
```cpp
152+
```cpp
153153
// Alternative: use a macro which evaluates to a noop in release code.
154154
#if DEBUG_CONVOLUTION_INSTRUMENTATION
155155
# define DEBUG_CONV_CODE(x) x
@@ -235,7 +235,7 @@ switch (x) case 4: if (y) case 5: return 0; else default: return 1;
235235
switch (x)
236236
{
237237
case 0: // Fall-through allowed from case 0: to case 1: since case 0 is empty.
238-
case 1:
238+
case 1:
239239
a();
240240
b();
241241
break;
@@ -250,7 +250,7 @@ case 5:
250250
c();
251251
throw 42; // Terminating with throw is okay
252252
default:
253-
throw 42;
253+
throw 42;
254254
}
255255
```
256256

@@ -297,7 +297,7 @@ case 1:
297297
#### Preprocessor Directives
298298
1. *MISRA C++: 2008 Rule 16-0-2*
299299
`#define` and `#undef` of macros should be done only at global namespace.
300-
2. Avoid the use of `#ifdef` and `#ifndef` directives (except in the case of header include guards). Prefer to use `#if defined(...)` or `#if !defined(...)` instead. The latter syntax is more consistent with C syntax, and allows you to use more complicated preprocessor conditionals, e.g.:
300+
2. Avoid the use of `#ifdef` and `#ifndef` directives (except in the case of header include guards). Prefer to use `#if defined(...)` or `#if !defined(...)` instead. The latter syntax is more consistent with C syntax, and allows you to use more complicated preprocessor conditionals, e.g.:
301301
```cpp
302302
#if defined(FOO) || defined(BAR)
303303
void foo();
@@ -343,14 +343,14 @@ for (size_t i = 0; i < mTensors.size(); ++i) // preferred style
343343
```
344344
* Using only signed integers for the above would lead to prolixity and perhaps unsafe narrowing:
345345
```cpp
346-
for (int i = 0; i < static_cast<int>(mTensors.size()); ++i)
346+
for (int i = 0; i < static_cast<int>(mTensors.size()); ++i)
347347
```
348348

349349

350350
#### Special Considerations for API
351351
1. The API consists, with very few exceptions, of methodless structs and pure virtual interface classes.
352352
2. API class methods should be either virtual or inline.
353-
3. The API does not use integral types with platform-dependent sizes, other than `int`, `unsigned`, and `bool`. `size_t` should be used only for sizes of memory buffers.
353+
3. The API does not use integral types with platform-dependent sizes, other than `int`, `unsigned`, and `bool`. `size_t` should be used only for sizes of memory buffers.
354354
4. The API does not use any aggregate types (e.g. `std::string`) which may be compiled differently with different compilers and libraries.
355355
5. The API minimizes dependencies on system headers - currently only `<cstddef>` and `<cstdint>`.
356356
6. Memory ownership may not be transferred across API boundaries - any memory allocated inside a library must be freed inside the library.
@@ -419,7 +419,7 @@ char const * const errStr = getErrorStr(status);
419419
1. All TensorRT Open Source Software code should contain an NVIDIA copyright header that includes the current year. The following block of text should be prepended to the top of all OSS files. This includes .cpp, .h, .cu, .py, and any other source files which are compiled or interpreted.
420420
```cpp
421421
/*
422-
* Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
422+
* Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
423423
*
424424
* Licensed under the Apache License, Version 2.0 (the "License");
425425
* you may not use this file except in compliance with the License.

cmake/modules/find_library_create_target.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
2+
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

cmake/modules/set_ifndef.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
2+
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

cmake/toolchains/cmake_aarch64-android.toolchain

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
2+
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@ set(CMAKE_CUDA_COMPILER_FORCED TRUE)
4040

4141
set(CUDA_LIBS -L${CUDA_ROOT}/lib64)
4242

43-
set(ADDITIONAL_PLATFORM_LIB_FLAGS ${CUDA_LIBS} -lcublas -lcudart -lnvToolsExt -lculibos -lcudadevrt -llog)
43+
set(ADDITIONAL_PLATFORM_LIB_FLAGS ${CUDA_LIBS} -lcublas -lcudart -lnvToolsExt -lculibos -lcudadevrt -llog)
4444

4545

4646
set(DISABLE_SWIG TRUE)

cmake/toolchains/cmake_aarch64.toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
2+
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

cmake/toolchains/cmake_ppc64le.toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
2+
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

cmake/toolchains/cmake_qnx.toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
2+
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

cmake/toolchains/cmake_x64_win.toolchain

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
2+
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ set(W10_LINKER ${MSVC_COMPILER_DIR}/bin/amd64/link)
3838

3939

4040
set(CMAKE_CUDA_HOST_COMPILER ${CMAKE_NVCC_COMPILER} CACHE STRING "" FORCE)
41-
41+
4242
set(ADDITIONAL_PLATFORM_INCL_FLAGS "-I${MSVC_COMPILER_DIR}/include -I${MSVC_COMPILER_DIR}/../ucrt/include")
4343
set(ADDITIONAL_PLATFORM_LIB_FLAGS ${ADDITIONAL_PLATFORM_LIB_FLAGS} "-LIBPATH:${NV_TOOLS}/ddk/wddmv2/official/17134/Lib/10.0.17134.0/um/x64")
4444
set(ADDITIONAL_PLATFORM_LIB_FLAGS ${ADDITIONAL_PLATFORM_LIB_FLAGS} "-LIBPATH:${MSVC_COMPILER_DIR}/lib/amd64" )

0 commit comments

Comments
 (0)