Ai
2 Star 1 Fork 15

src-anolis-ai/pytorch

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
pytorch-C.patch 1.11 KB
一键复制 编辑 原始数据 按行查看 历史
forrest_ly 提交于 2021-12-14 16:24 +08:00 . first commit
--- torch/CMakeLists.txt.python 2021-09-10 16:46:11.450141401 +0300
+++ torch/CMakeLists.txt 2021-09-10 16:48:15.678074039 +0300
@@ -247,6 +247,24 @@
list(APPEND TORCH_PYTHON_COMPILE_DEFINITIONS USE_NCCL)
endif()
+add_library(_dl SHARED ${TORCH_SRC_DIR}/csrc/dl.c)
+target_compile_options(_dl PRIVATE "-Wl,--no-as-needed")
+set_target_properties(_dl PROPERTIES PREFIX "")
+target_link_libraries(_dl
+ ${CUDA_LIBRARIES}
+ ${CUDA_NVRTC_LIB}
+ ${CUDA_CUDA_LIB}
+ ${TORCH_CUDA_LIBRARIES})
+
+add_library(_C SHARED ${TORCH_SRC_DIR}/csrc/stub.c)
+target_link_libraries(_C ${PYTHON_LIBRARIES} torch_python)
+target_compile_definitions(_C PRIVATE ${TORCH_PYTHON_COMPILE_DEFINITIONS})
+target_compile_options(_C PRIVATE ${TORCH_PYTHON_COMPILE_OPTIONS})
+target_include_directories(_C PUBLIC ${TORCH_PYTHON_INCLUDE_DIRECTORIES})
+set_target_properties(_C PROPERTIES PREFIX "")
+if (TORCH_PYTHON_LINK_FLAGS)
+ set_target_properties(_C PROPERTIES LINK_FLAGS "${TORCH_PYTHON_LINK_FLAGS}")
+endif()
# WARNING- any TORCH_PYTHON_COMPILE_DEFINITIONS above this line
# affect both torch_python and DEPLOY interpreter.
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-anolis-ai/pytorch.git
git@gitee.com:src-anolis-ai/pytorch.git
src-anolis-ai
pytorch
pytorch
master

搜索帮助