Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
7c69b6b4
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
7c69b6b4
编写于
10月 21, 2019
作者:
石
石晓伟
提交者:
GitHub
10月 21, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
link static library with cuda, test=develop (#2228)
* add static libraries of cuda, test=develop * update cuda make
上级
57d8e42e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
10 deletion
+27
-10
cmake/cuda.cmake
cmake/cuda.cmake
+10
-0
cmake/cudnn.cmake
cmake/cudnn.cmake
+5
-3
lite/api/CMakeLists.txt
lite/api/CMakeLists.txt
+3
-1
lite/backends/cuda/math/CMakeLists.txt
lite/backends/cuda/math/CMakeLists.txt
+9
-6
未找到文件。
cmake/cuda.cmake
浏览文件 @
7c69b6b4
...
...
@@ -174,6 +174,16 @@ if(NOT WITH_DSO)
endif
(
WIN32
)
endif
(
NOT WITH_DSO
)
get_filename_component
(
CUDA_LIB_PATH
${
CUDA_curand_LIBRARY
}
DIRECTORY
)
function
(
import_static_library alias path
)
add_library
(
${
alias
}
STATIC IMPORTED GLOBAL
)
set_property
(
TARGET
${
alias
}
PROPERTY IMPORTED_LOCATION
${
path
}
)
endfunction
()
import_static_library
(
cudart_static
${
CUDA_LIB_PATH
}
/libcudart_static.a
)
import_static_library
(
cublas_static
${
CUDA_LIB_PATH
}
/libcublas_static.a
)
import_static_library
(
curand_static
${
CUDA_LIB_PATH
}
/libcurand_static.a
)
import_static_library
(
culibos_static
${
CUDA_LIB_PATH
}
/libculibos.a
)
# setting nvcc arch flags
select_nvcc_arch_flags
(
NVCC_FLAGS_EXTRA
)
list
(
APPEND CUDA_NVCC_FLAGS
${
NVCC_FLAGS_EXTRA
}
)
...
...
cmake/cudnn.cmake
浏览文件 @
7c69b6b4
...
...
@@ -53,11 +53,10 @@ if(APPLE)
set
(
CUDNN_LIB_NAME
"libcudnn.dylib"
"libcudnn.so"
)
endif
(
APPLE
)
find_library
(
CUDNN_LIBRARY NAMES
${
CUDNN_LIB_NAME
}
# libcudnn_static.a
find_library
(
CUDNN_LIBRARY NAMES
${
CUDNN_LIB_NAME
}
PATHS
${
CUDNN_CHECK_LIBRARY_DIRS
}
${
CUDNN_INCLUDE_DIR
}
${
__libpath_hist
}
NO_DEFAULT_PATH
DOC
"Path to cuDNN library."
)
DOC
"Path to cuDNN dynamic library."
)
if
(
CUDNN_INCLUDE_DIR AND CUDNN_LIBRARY
)
set
(
CUDNN_FOUND ON
)
...
...
@@ -69,6 +68,9 @@ if(CUDNN_FOUND)
file
(
READ
${
CUDNN_INCLUDE_DIR
}
/cudnn.h CUDNN_VERSION_FILE_CONTENTS
)
get_filename_component
(
CUDNN_LIB_PATH
${
CUDNN_LIBRARY
}
DIRECTORY
)
add_library
(
cudnn_static STATIC IMPORTED GLOBAL
)
set_property
(
TARGET cudnn_static PROPERTY IMPORTED_LOCATION
"
${
CUDNN_LIB_PATH
}
/libcudnn_static.a"
)
string
(
REGEX MATCH
"define CUDNN_VERSION +([0-9]+)"
CUDNN_VERSION
"
${
CUDNN_VERSION_FILE_CONTENTS
}
"
)
...
...
lite/api/CMakeLists.txt
浏览文件 @
7c69b6b4
...
...
@@ -68,6 +68,8 @@ set(light_api_deps
scope target_wrapper_host model_parser program
)
if
(
LITE_WITH_CUDA
)
set
(
light_api_deps
${
light_api_deps
}
target_wrapper_cuda
)
set
(
cuda_static_deps cudart_static cublas_static curand_static
cudnn_static culibos_static
)
endif
()
lite_cc_library
(
light_api SRCS light_api.cc
DEPS scope target_wrapper_host model_parser
...
...
@@ -195,7 +197,7 @@ if (NOT LITE_ON_TINY_PUBLISH)
# The final inference library for just MobileConfig.
bundle_static_library
(
paddle_api_full paddle_api_full_bundled bundle_full_api
)
get_property
(
fluid_modules GLOBAL PROPERTY FLUID_MODULES
)
cc_library
(
api_full_static SRCS DEPS paddle_api_full cxx_api paddle_api light_api
${
cxx_api_deps
}
${
ops
}
${
host_kernels
}
${
cuda_kernels
}
program tensor memory naive_buffer types
${
fluid_modules
}
protobuf
)
cc_library
(
api_full_static SRCS DEPS paddle_api_full cxx_api paddle_api light_api
${
cxx_api_deps
}
${
ops
}
${
host_kernels
}
${
cuda_kernels
}
program tensor memory naive_buffer types
${
fluid_modules
}
protobuf
${
cuda_static_deps
}
)
endif
()
bundle_static_library
(
paddle_api_light paddle_api_light_bundled bundle_light_api
)
#-----------------------------------------------------------------------------------------------------
...
...
lite/backends/cuda/math/CMakeLists.txt
浏览文件 @
7c69b6b4
...
...
@@ -2,13 +2,16 @@ if(NOT LITE_WITH_CUDA)
return
()
endif
()
nv_library
(
cuda_activation SRCS activation.cu
)
nv_library
(
cuda_scale SRCS scale.cu
)
nv_library
(
cuda_type_trans SRCS type_trans.cu
)
nv_library
(
cuda_transpose SRCS transpose.cu
)
set
(
cuda_static_deps cudnn_static cublas_static curand_static
culibos_static cudart_static
)
nv_library
(
cuda_activation SRCS activation.cu DEPS
${
cuda_static_deps
}
)
nv_library
(
cuda_scale SRCS scale.cu DEPS
${
cuda_static_deps
}
)
nv_library
(
cuda_type_trans SRCS type_trans.cu DEPS
${
cuda_static_deps
}
)
nv_library
(
cuda_transpose SRCS transpose.cu DEPS
${
cuda_static_deps
}
)
nv_library
(
cudnn_conv SRCS cudnn_conv.cc DEPS cuda_activation cuda_scale
cuda_type_trans
)
nv_library
(
cuda_elementwise SRCS elementwise.cu
)
cuda_type_trans
${
cuda_static_deps
}
)
nv_library
(
cuda_elementwise SRCS elementwise.cu
DEPS
${
cuda_static_deps
}
)
set
(
math_cuda
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录