Skip to content

Commit cd9bc45

Browse files
authored
Merge branch 'master' into bugfix/nms_oveflow_fp16
2 parents b22ef50 + 5a31545 commit cd9bc45

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.12)
22
project(torchvision)
33
set(CMAKE_CXX_STANDARD 14)
4-
set(TORCHVISION_VERSION 0.7.0)
4+
file(STRINGS version.txt TORCHVISION_VERSION)
55

66
option(WITH_CUDA "Enable CUDA support" OFF)
77

test/tracing/frcnn/test_frcnn_tracing.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
#include <torchvision/vision.h>
44
#include <torchvision/ops/nms.h>
55

6-
#ifdef _WIN32
7-
// Windows only
8-
// This is necessary until operators are automatically registered on include
9-
static auto _nms = &vision::ops::nms;
10-
#endif
116

127
int main() {
138
torch::DeviceType device_type;

torchvision/csrc/macros.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#else
1616
#ifdef _MSC_VER
1717
#define VISION_INLINE_VARIABLE __declspec(selectany)
18+
#define HINT_MSVC_LINKER_INCLUDE_SYMBOL
1819
#else
1920
#define VISION_INLINE_VARIABLE __attribute__((weak))
2021
#endif

torchvision/csrc/vision.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ namespace vision {
77
VISION_API int64_t cuda_version();
88

99
namespace detail {
10-
// Dummy variable to reference a symbol from vision.cpp.
11-
// This ensures that the torchvision library and the ops registration
12-
// initializers are not pruned.
13-
VISION_INLINE_VARIABLE int64_t _cuda_version = cuda_version();
10+
extern "C" VISION_INLINE_VARIABLE auto _register_ops = &cuda_version;
11+
#ifdef HINT_MSVC_LINKER_INCLUDE_SYMBOL
12+
#pragma comment(linker, "/include:_register_ops")
13+
#endif
14+
1415
} // namespace detail
1516
} // namespace vision

0 commit comments

Comments
 (0)