Skip to content

Commit 5b957bb

Browse files
committed
update cuda sdkver
1 parent c0afa19 commit 5b957bb

File tree

4 files changed

+34
-144
lines changed

4 files changed

+34
-144
lines changed

docs/examples/other-languages/cuda.md

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -37,43 +37,16 @@ $ xmake
3737

3838
### Specify CUDA SDK Version
3939

40-
Starting from v3.0.5, you can specify the CUDA SDK version for a specific target via the `cuda.sdkver` configuration option, giving you precise control over CUDA compilation:
40+
Starting from v3.0.5, you can specify the CUDA SDK version via the `--cuda_sdkver` command-line option, giving you precise control over CUDA compilation:
4141

42-
```lua
43-
target("cuda_app")
44-
set_kind("binary")
45-
add_files("src/*.cu")
46-
add_rules("cuda")
47-
set_values("cuda.sdkver", "12.0") -- Specify CUDA SDK version
48-
```
49-
50-
You can also combine it with compute capability settings for specific GPU architectures:
51-
52-
```lua
53-
target("cuda_app")
54-
set_kind("binary")
55-
add_files("src/*.cu")
56-
add_rules("cuda")
57-
set_values("cuda.sdkver", "12.0")
58-
set_values("cuda.arch", "sm_75", "sm_80", "sm_86")
42+
```bash
43+
$ xmake f --cuda_sdkver=11.8
44+
$ xmake
5945
```
6046

61-
Different targets can use different CUDA versions:
62-
63-
```lua
64-
-- Target using CUDA 11.8
65-
target("cuda11_app")
66-
set_kind("binary")
67-
add_files("src/cuda11/*.cu")
68-
add_rules("cuda")
69-
set_values("cuda.sdkver", "11.8")
70-
71-
-- Target using CUDA 12.0
72-
target("cuda12_app")
73-
set_kind("binary")
74-
add_files("src/cuda12/*.cu")
75-
add_rules("cuda")
76-
set_values("cuda.sdkver", "12.0")
77-
```
47+
Supported version values include:
48+
- `11.8` - Specify CUDA 11.8 version
49+
- `11.x` - Specify CUDA 11.x series version
50+
- `auto` - Auto detect (default)
7851

7952
If you want to known more information, you can see [#158](https://github.com/xmake-io/xmake/issues/158) and [#6964](https://github.com/xmake-io/xmake/pull/6964).

docs/posts/xmake-update-v3.0.5.md

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -321,52 +321,24 @@ For more details, see: [#7024](https://github.com/xmake-io/xmake/pull/7024)
321321

322322
### Support specifying CUDA SDK version
323323

324-
We have added support for specifying the CUDA SDK version via the `cuda_sdkver` configuration option, giving you precise control over CUDA compilation. This is essential when working with multiple CUDA installations or when you need to target a specific CUDA version for compatibility.
324+
We have added support for specifying the CUDA SDK version via the `--cuda_sdkver` command-line option, giving you precise control over CUDA compilation. This is essential when working with multiple CUDA installations or when you need to target a specific CUDA version for compatibility.
325325

326-
You can specify the CUDA SDK version for a target:
326+
You can specify the CUDA SDK version via command-line:
327327

328-
```lua
329-
target("cuda_app")
330-
set_kind("binary")
331-
add_files("src/*.cu")
332-
add_rules("cuda")
333-
set_values("cuda.sdkver", "12.0") -- Specify CUDA SDK version
334-
```
335-
336-
You can also combine it with compute capability settings for specific GPU architectures:
337-
338-
```lua
339-
target("cuda_app")
340-
set_kind("binary")
341-
add_files("src/*.cu")
342-
add_rules("cuda")
343-
set_values("cuda.sdkver", "12.0")
344-
set_values("cuda.arch", "sm_75", "sm_80", "sm_86")
328+
```bash
329+
$ xmake f --cuda_sdkver=11.8
330+
$ xmake
345331
```
346332

347-
Different targets can use different CUDA versions:
348-
349-
```lua
350-
-- Target using CUDA 11.8
351-
target("cuda11_app")
352-
set_kind("binary")
353-
add_files("src/cuda11/*.cu")
354-
add_rules("cuda")
355-
set_values("cuda.sdkver", "11.8")
356-
357-
-- Target using CUDA 12.0
358-
target("cuda12_app")
359-
set_kind("binary")
360-
add_files("src/cuda12/*.cu")
361-
add_rules("cuda")
362-
set_values("cuda.sdkver", "12.0")
363-
```
333+
Supported version values include:
334+
- `11.8` - Specify CUDA 11.8 version
335+
- `11.x` - Specify CUDA 11.x series version
336+
- `auto` - Auto detect (default)
364337

365338
This feature is particularly useful for:
366339
- Projects requiring specific CUDA versions for compatibility
367340
- Multi-version CUDA development environments
368341
- Ensuring consistent CUDA compilation across different systems
369-
- Targeting specific GPU architectures with appropriate CUDA features
370342

371343
For more details, see: [#6964](https://github.com/xmake-io/xmake/pull/6964)
372344

docs/zh/examples/other-languages/cuda.md

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -36,43 +36,16 @@ $ xmake
3636

3737
### 指定 CUDA SDK 版本
3838

39-
从 v3.0.5 开始,您可以通过 `cuda.sdkver` 配置选项为特定目标指定 CUDA SDK 版本,让您对 CUDA 编译有精确的控制:
39+
从 v3.0.5 开始,您可以通过 `--cuda_sdkver` 命令行选项指定 CUDA SDK 版本,让您对 CUDA 编译有精确的控制:
4040

41-
```lua
42-
target("cuda_app")
43-
set_kind("binary")
44-
add_files("src/*.cu")
45-
add_rules("cuda")
46-
set_values("cuda.sdkver", "12.0") -- 指定 CUDA SDK 版本
47-
```
48-
49-
您也可以将其与针对特定 GPU 架构的计算能力设置结合使用:
50-
51-
```lua
52-
target("cuda_app")
53-
set_kind("binary")
54-
add_files("src/*.cu")
55-
add_rules("cuda")
56-
set_values("cuda.sdkver", "12.0")
57-
set_values("cuda.arch", "sm_75", "sm_80", "sm_86")
41+
```bash
42+
$ xmake f --cuda_sdkver=11.8
43+
$ xmake
5844
```
5945

60-
不同的目标可以使用不同的 CUDA 版本:
61-
62-
```lua
63-
-- 使用 CUDA 11.8 的目标
64-
target("cuda11_app")
65-
set_kind("binary")
66-
add_files("src/cuda11/*.cu")
67-
add_rules("cuda")
68-
set_values("cuda.sdkver", "11.8")
69-
70-
-- 使用 CUDA 12.0 的目标
71-
target("cuda12_app")
72-
set_kind("binary")
73-
add_files("src/cuda12/*.cu")
74-
add_rules("cuda")
75-
set_values("cuda.sdkver", "12.0")
76-
```
46+
支持的版本值包括:
47+
- `11.8` - 指定 CUDA 11.8 版本
48+
- `11.x` - 指定 CUDA 11.x 系列版本
49+
- `auto` - 自动检测(默认值)
7750

7851
更多详情可以参考:[#158](https://github.com/xmake-io/xmake/issues/158)[#6964](https://github.com/xmake-io/xmake/pull/6964)

docs/zh/posts/xmake-update-v3.0.5.md

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -321,52 +321,24 @@ TARGET_NAME=$(echo $TARGET_INFO | jq -r '.targets[0].name')
321321

322322
### 支持指定 CUDA SDK 版本 {#support-specify-cuda-sdk-version}
323323

324-
我们添加了通过 `cuda_sdkver` 配置选项指定 CUDA SDK 版本的支持,让您对 CUDA 编译有精确的控制。这在处理多个 CUDA 安装或需要针对特定 CUDA 版本以确保兼容性时非常重要。
324+
我们添加了通过 `--cuda_sdkver` 命令行选项指定 CUDA SDK 版本的支持,让您对 CUDA 编译有精确的控制。这在处理多个 CUDA 安装或需要针对特定 CUDA 版本以确保兼容性时非常重要。
325325

326-
您可以为目标指定 CUDA SDK 版本:
326+
您可以通过命令行参数指定 CUDA SDK 版本:
327327

328-
```lua
329-
target("cuda_app")
330-
set_kind("binary")
331-
add_files("src/*.cu")
332-
add_rules("cuda")
333-
set_values("cuda.sdkver", "12.0") -- 指定 CUDA SDK 版本
334-
```
335-
336-
您也可以将其与针对特定 GPU 架构的计算能力设置结合使用:
337-
338-
```lua
339-
target("cuda_app")
340-
set_kind("binary")
341-
add_files("src/*.cu")
342-
add_rules("cuda")
343-
set_values("cuda.sdkver", "12.0")
344-
set_values("cuda.arch", "sm_75", "sm_80", "sm_86")
328+
```bash
329+
$ xmake f --cuda_sdkver=11.8
330+
$ xmake
345331
```
346332

347-
不同的目标可以使用不同的 CUDA 版本:
348-
349-
```lua
350-
-- 使用 CUDA 11.8 的目标
351-
target("cuda11_app")
352-
set_kind("binary")
353-
add_files("src/cuda11/*.cu")
354-
add_rules("cuda")
355-
set_values("cuda.sdkver", "11.8")
356-
357-
-- 使用 CUDA 12.0 的目标
358-
target("cuda12_app")
359-
set_kind("binary")
360-
add_files("src/cuda12/*.cu")
361-
add_rules("cuda")
362-
set_values("cuda.sdkver", "12.0")
363-
```
333+
支持的版本值包括:
334+
- `11.8` - 指定 CUDA 11.8 版本
335+
- `11.x` - 指定 CUDA 11.x 系列版本
336+
- `auto` - 自动检测(默认值)
364337

365338
这个特性特别适用于:
366339
- 需要特定 CUDA 版本以确保兼容性的项目
367340
- 多版本 CUDA 开发环境
368341
- 确保在不同系统上一致的 CUDA 编译
369-
- 针对特定 GPU 架构使用相应的 CUDA 特性
370342

371343
更多详情,请参考:[#6964](https://github.com/xmake-io/xmake/pull/6964)
372344

0 commit comments

Comments
 (0)