aboutsummaryrefslogtreecommitdiff
path: root/zh/manual.md
diff options
context:
space:
mode:
authorruki <waruqi@gmail.com>2019-06-02 20:12:58 +0800
committerGitHub <noreply@github.com>2019-06-02 20:12:58 +0800
commitb910c53c312dbed5ec7d6c680f8a6ca1fd56d537 (patch)
treedf6b5867ea6e2a8ee9e66914a85103f2f7b21c95 /zh/manual.md
parent57095aa985ac1526240563ae1845e360c81db708 (diff)
parent94f53689aa201025bd7e384197320dcf0889c022 (diff)
downloadxmake-docs-b910c53c312dbed5ec7d6c680f8a6ca1fd56d537.tar.gz
xmake-docs-b910c53c312dbed5ec7d6c680f8a6ca1fd56d537.zip
Merge pull request #6 from OpportunityLiu/cuda-doc
add docs for find_cudadevices; improve docs for cuda templates
Diffstat (limited to 'zh/manual.md')
-rw-r--r--zh/manual.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/zh/manual.md b/zh/manual.md
index d1cbb270..4fc58bcf 100644
--- a/zh/manual.md
+++ b/zh/manual.md
@@ -7632,6 +7632,7 @@ environment.leave("toolchains")
| [detect.find_package](#detect-find_package) | 查找包文件,包含库文件和搜索路径 | >= 2.1.5 |
| [detect.find_tool](#detect-find_tool) | 查找工具 | >= 2.1.5 |
| [detect.find_toolname](#detect-find_toolname) | 查找工具名 | >= 2.1.5 |
+| [detect.find_cudadevices](#detect-find_cudadevices) | 查找本机的 CUDA 设备 | >= 2.2.7 |
| [detect.features](#detect-features) | 获取指定工具的所有特性 | >= 2.1.5 |
| [detect.has_features](#detect-has_features) | 判断指定特性是否支持 | >= 2.1.5 |
| [detect.has_flags](#detect-has_flags) | 判断指定参数选项是否支持 | >= 2.1.5 |
@@ -8162,6 +8163,23 @@ end
toolname相比program,更能唯一标示某个工具,也方便查找和加载对应的脚本`find_xxx.lua`。
+###### detect.find_cudadevices
+
+- 查找本机的 CUDA 设备
+
+通过 CUDA Runtime API 枚举本机的 CUDA 设备,并查询其属性。
+
+```lua
+import("lib.detect.find_cudadevices")
+
+local devices = find_cudadevices({ skip_compute_mode_prohibited = true })
+local devices = find_cudadevices({ min_sm_arch = 35, order_by_flops = true })
+```
+
+返回的结果为:`{ { ['$id'] = 0, name = "GeForce GTX 960M", major = 5, minor = 0, ... }, ... }`
+
+包含的属性依据当前 CUDA 版本会有所不同,可以参考 [CUDA 官方文档](https://docs.nvidia.com/cuda/cuda-runtime-api/structcudaDeviceProp.html#structcudaDeviceProp)及其历史版本。
+
###### detect.features
- 获取指定工具的所有特性