File tree Expand file tree Collapse file tree 5 files changed +9
-9
lines changed Expand file tree Collapse file tree 5 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -841,7 +841,7 @@ endif()
841841 DESTINATION ${TORCH_INSTALL_INCLUDE_DIR} /torch)
842842
843843
844- if (BUILD_TEST AND NOT USE_ROCM )
844+ if (BUILD_TEST)
845845 add_subdirectory (${TORCH_ROOT} /test /cpp/jit ${CMAKE_BINARY_DIR} /test_jit)
846846 add_subdirectory (${TORCH_ROOT} /test /cpp/tensorexpr ${CMAKE_BINARY_DIR} /test_tensorexpr)
847847 if (USE_DISTRIBUTED AND NOT WIN32 )
Original file line number Diff line number Diff line change @@ -97,8 +97,6 @@ elseif(USE_ROCM)
9797 ${PYTORCH_HIP_HCC_LIBRARIES}
9898 ${TORCH_CUDA_LIBRARIES} )
9999
100- target_link_libraries (test_jit PRIVATE caffe2_gpu)
101-
102100 target_compile_definitions (test_jit PRIVATE USE_ROCM)
103101endif ()
104102
Original file line number Diff line number Diff line change @@ -36,14 +36,12 @@ elseif(USE_ROCM)
3636 ${ROCM_HIPRTC_LIB}
3737 ${PYTORCH_HIP_HCC_LIBRARIES}
3838 ${TORCH_CUDA_LIBRARIES} )
39- target_link_libraries (test_tensorexpr PRIVATE caffe2_gpu)
4039 target_compile_definitions (test_tensorexpr PRIVATE USE_ROCM)
4140
4241 target_link_libraries (tutorial_tensorexpr PRIVATE
4342 ${ROCM_HIPRTC_LIB}
4443 ${PYTORCH_HIP_HCC_LIBRARIES}
4544 ${TORCH_CUDA_LIBRARIES} )
46- target_link_libraries (tutorial_tensorexpr PRIVATE caffe2_gpu)
4745 target_compile_definitions (tutorial_tensorexpr PRIVATE USE_ROCM)
4846endif ()
4947
Original file line number Diff line number Diff line change 2424
2525class TestTorchbind (JitTestCase ):
2626 def setUp (self ):
27- if TEST_WITH_ROCM or IS_SANDCASTLE or IS_WINDOWS or IS_MACOS or IS_FBCODE :
27+ if IS_SANDCASTLE or IS_WINDOWS or IS_MACOS or IS_FBCODE :
2828 raise unittest .SkipTest ("non-portable load_library call used in test" )
29- torch_root = Path (__file__ ).resolve ().parent .parent .parent
30- p = torch_root / 'build' / 'lib' / 'libtorchbind_test.so'
29+ if TEST_WITH_ROCM :
30+ torch_root = Path (torch .__file__ ).resolve ().parent
31+ p = torch_root / 'lib' / 'libtorchbind_test.so'
32+ else :
33+ torch_root = Path (__file__ ).resolve ().parent .parent .parent
34+ p = torch_root / 'build' / 'lib' / 'libtorchbind_test.so'
3135 torch .ops .load_library (str (p ))
3236
3337 def test_torchbind (self ):
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ append_filelist("libtorch_python_core_sources" TORCH_PYTHON_SRCS)
4646
4747# NB: This has to match the condition under which the JIT test directory
4848# is included (at the time of writing that's in caffe2/CMakeLists.txt).
49- if (BUILD_TEST AND NOT USE_ROCM )
49+ if (BUILD_TEST)
5050 add_definitions (-DBUILDING_TESTS)
5151 list (APPEND TORCH_PYTHON_SRCS
5252 ${TORCH_ROOT} /test /cpp/jit/torch_python_test.cpp
You can’t perform that action at this time.
0 commit comments