Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/nms_oveflow_fp16
Browse files Browse the repository at this point in the history
  • Loading branch information
datumbox authored Feb 11, 2021
2 parents b22ef50 + 5a31545 commit cd9bc45
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.12)
project(torchvision)
set(CMAKE_CXX_STANDARD 14)
set(TORCHVISION_VERSION 0.7.0)
file(STRINGS version.txt TORCHVISION_VERSION)

option(WITH_CUDA "Enable CUDA support" OFF)

Expand Down
5 changes: 0 additions & 5 deletions test/tracing/frcnn/test_frcnn_tracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
#include <torchvision/vision.h>
#include <torchvision/ops/nms.h>

#ifdef _WIN32
// Windows only
// This is necessary until operators are automatically registered on include
static auto _nms = &vision::ops::nms;
#endif

int main() {
torch::DeviceType device_type;
Expand Down
1 change: 1 addition & 0 deletions torchvision/csrc/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#else
#ifdef _MSC_VER
#define VISION_INLINE_VARIABLE __declspec(selectany)
#define HINT_MSVC_LINKER_INCLUDE_SYMBOL
#else
#define VISION_INLINE_VARIABLE __attribute__((weak))
#endif
Expand Down
9 changes: 5 additions & 4 deletions torchvision/csrc/vision.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ namespace vision {
VISION_API int64_t cuda_version();

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

} // namespace detail
} // namespace vision

0 comments on commit cd9bc45

Please sign in to comment.