Skip to content

Commit e7923bc

Browse files
committed
create flag to indicate a program is inside a deploy interpreter
ghstack-source-id: 5a82019 Pull Request resolved: #310
1 parent 782a55b commit e7923bc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

multipy/runtime/interpreter/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
101101
endif()
102102

103103
target_include_directories(torch_deployinterpreter PRIVATE ${INTERPRETER_DIR})
104-
target_include_directories(torch_deployinterpreter BEFORE PUBLIC ${Python3_INCLUDE_DIRS})
104+
target_include_directories(torch_deployinterpreter BEFORE PUBLIC "-Wl,--no-as-needed -rdynamic" ${Python3_INCLUDE_DIRS})
105105

106106
target_link_libraries(torch_deployinterpreter PRIVATE fmt::fmt-header-only)
107107
target_link_libraries(torch_deployinterpreter PRIVATE gtest)
108-
target_link_libraries(torch_deployinterpreter PRIVATE torch_python)
108+
target_link_libraries(torch_deployinterpreter PRIVATE "-Wl,--no-as-needed -rdynamic -Wno-undef" torch_python)
109109
target_link_libraries(torch_deployinterpreter PRIVATE multipy_torch)

multipy/runtime/interpreter/interpreter_impl.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ except ModuleNotFoundError:
179179
_v.git_version = 'fake'
180180
_v.hip = None
181181
182+
sys.using_multipy_interpreter = True
182183
183184
if torch.cuda.is_available():
184185
torch.zeros(1).cuda() # force cuda init...

0 commit comments

Comments
 (0)