Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
856c54a8
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
856c54a8
编写于
6月 07, 2023
作者:
S
Sanbu
提交者:
GitHub
6月 07, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[cmake] add cusparselt third_party cache (#54388)
* [cmake] add cusparselt third_party cache * fix * fix ci * fix ci
上级
12d04ab2
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
46 addition
and
7 deletion
+46
-7
cmake/external/cusparselt.cmake
cmake/external/cusparselt.cmake
+46
-7
未找到文件。
cmake/external/cusparselt.cmake
浏览文件 @
856c54a8
...
@@ -22,7 +22,8 @@ if(WITH_ARM OR WIN32)
...
@@ -22,7 +22,8 @@ if(WITH_ARM OR WIN32)
endif
()
endif
()
include
(
ExternalProject
)
include
(
ExternalProject
)
set
(
CUSPARSELT_DOWNLOAD_DIR
${
PADDLE_SOURCE_DIR
}
/third_party/cusparselt/
${
CMAKE_SYSTEM_NAME
}
)
set
(
CUSPARSELT_PROJECT
"extern_cusparselt"
)
set
(
CUSPARSELT_PROJECT
"extern_cusparselt"
)
set
(
CUSPARSELT_P
"https://developer.download.nvidia.com/compute"
)
set
(
CUSPARSELT_P
"https://developer.download.nvidia.com/compute"
)
set
(
CUSPARSELT_F
"libcusparse_lt-linux-x86_64-0.2.0.1.tar.gz"
)
set
(
CUSPARSELT_F
"libcusparse_lt-linux-x86_64-0.2.0.1.tar.gz"
)
...
@@ -37,22 +38,60 @@ set(CUSPARSELT_INC_DIR
...
@@ -37,22 +38,60 @@ set(CUSPARSELT_INC_DIR
set
(
CUSPARSELT_LIB_DIR
set
(
CUSPARSELT_LIB_DIR
"
${
CUSPARSELT_INSTALL_DIR
}
/lib64"
"
${
CUSPARSELT_INSTALL_DIR
}
/lib64"
CACHE PATH
"sparselt lib directory."
FORCE
)
CACHE PATH
"sparselt lib directory."
FORCE
)
set
(
CUSPARSELT_CACHE_FILENAME
"
${
CUSPARSELT_F
}
"
)
set
(
CUSPARSELT_URL_MD5
"4f72f469e9cb1a85b09017fbace733d7"
)
set_directory_properties
(
PROPERTIES CLEAN_NO_CUSTOM 1
)
set_directory_properties
(
PROPERTIES CLEAN_NO_CUSTOM 1
)
include_directories
(
${
CUSPARSELT_INC_DIR
}
)
include_directories
(
${
CUSPARSELT_INC_DIR
}
)
function
(
download_cusparselt
)
message
(
STATUS
"Downloading
${
CUSPARSELT_URL
}
to
${
CUSPARSELT_DOWNLOAD_DIR
}
/
${
CUSPARSELT_CACHE_FILENAME
}
"
)
# NOTE: If the version is updated, consider emptying the folder; maybe add timeout
file
(
DOWNLOAD
${
CUSPARSELT_URL
}
${
CUSPARSELT_DOWNLOAD_DIR
}
/
${
CUSPARSELT_CACHE_FILENAME
}
EXPECTED_MD5
${
CUSPARSELT_URL_MD5
}
STATUS ERR
)
if
(
ERR EQUAL 0
)
message
(
STATUS
"Download
${
CUSPARSELT_CACHE_FILENAME
}
success"
)
else
()
message
(
FATAL_ERROR
"Download failed, error:
${
ERR
}
\n
You can try downloading
${
CUSPARSELT_CACHE_FILENAME
}
again"
)
endif
()
endfunction
()
find_file
(
LOCAL_CUSPARSELT_LIB_ZIP
NAMES
${
CUSPARSELT_CACHE_FILENAME
}
PATHS
${
CUSPARSELT_DOWNLOAD_DIR
}
NO_DEFAULT_PATH
)
if
(
LOCAL_CUSPARSELT_LIB_ZIP
)
file
(
MD5
${
CUSPARSELT_DOWNLOAD_DIR
}
/
${
CUSPARSELT_CACHE_FILENAME
}
CUSPARSELT_MD5
)
if
(
NOT CUSPARSELT_MD5 EQUAL CUSPARSELT_URL_MD5
)
download_cusparselt
()
endif
()
else
()
download_cusparselt
()
endif
()
ExternalProject_Add
(
ExternalProject_Add
(
${
CUSPARSELT_PROJECT
}
${
CUSPARSELT_PROJECT
}
${
EXTERNAL_PROJECT_LOG_ARGS
}
${
EXTERNAL_PROJECT_LOG_ARGS
}
URL
${
CUSPARSELT_
URL
}
URL
${
CUSPARSELT_
DOWNLOAD_DIR
}
/
${
CUSPARSELT_CACHE_FILENAME
}
PREFIX
${
CUSPARSELT_PREFIX_DIR
}
PREFIX
${
CUSPARSELT_PREFIX_DIR
}
DOWNLOAD_DIR
${
CUSPARSELT_DOWNLOAD_DIR
}
DOWNLOAD_NO_PROGRESS 1
DOWNLOAD_NO_PROGRESS 1
SOURCE_DIR
${
CUSPARSELT_INSTALL_DIR
}
CONFIGURE_COMMAND
""
CONFIGURE_COMMAND
""
BUILD_COMMAND
""
BUILD_COMMAND
""
INSTALL_COMMAND
INSTALL_COMMAND
""
${
CMAKE_COMMAND
}
-E copy_directory
${
CUSPARSELT_PREFIX_DIR
}
/src/extern_cusparselt/lib64
${
CUSPARSELT_LIB_DIR
}
&&
${
CMAKE_COMMAND
}
-E copy_directory
${
CUSPARSELT_PREFIX_DIR
}
/src/extern_cusparselt/include
${
CUSPARSELT_INC_DIR
}
UPDATE_COMMAND
""
)
UPDATE_COMMAND
""
)
add_library
(
cusparselt INTERFACE
)
add_library
(
cusparselt INTERFACE
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录