diff options
| author | OpportunityLiu <opportunity@live.in> | 2019-06-02 15:26:26 +0800 |
|---|---|---|
| committer | OpportunityLiu <opportunity@live.in> | 2019-06-02 15:26:26 +0800 |
| commit | 8cb46236f41ac5476f2fe38353156db4c8195325 (patch) | |
| tree | dbfdcebcbad16003659403b66b96236f50f3f7a3 /README.md | |
| parent | 57095aa985ac1526240563ae1845e360c81db708 (diff) | |
| download | xmake-docs-8cb46236f41ac5476f2fe38353156db4c8195325.tar.gz xmake-docs-8cb46236f41ac5476f2fe38353156db4c8195325.zip | |
add docs for find_cudadevices; improve docs for cuda templates
Related: xmake-io/xmake#430, xmake-io/xmake#431
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -222,6 +222,7 @@ Support languages: * c/c++ * objc/c++ +* cuda * asm * swift * dlang @@ -422,20 +423,16 @@ $ xmake ``` ```lua +-- add helper function add_cugencode +includes('add_cugencode.lua') +-- define target target("cuda_console") set_kind("binary") add_files("src/*.cu") - - -- generate SASS code for each SM architecture - for _, sm in ipairs({"30", "35", "37", "50", "52", "60", "61", "70"}) do - add_cuflags("-gencode arch=compute_" .. sm .. ",code=sm_" .. sm) - add_ldflags("-gencode arch=compute_" .. sm .. ",code=sm_" .. sm) - end - - -- generate PTX code from the highest SM architecture to guarantee forward-compatibility - sm = "70" - add_cuflags("-gencode arch=compute_" .. sm .. ",code=compute_" .. sm) - add_ldflags("-gencode arch=compute_" .. sm .. ",code=compute_" .. sm) + -- generate SASS code for SM architecture of current host + add_cugencode("native") + -- generate PTX code for the virtual architecture to guarantee compatibility + add_cugencode("compute_30") ``` xmake will detect Cuda SDK automatically and we can also set the SDK directory manually. @@ -740,6 +737,7 @@ $ xmake | [--rc-ld](#-rc-ld) | Set `rust` linker | | [--rc-sh](#-rc-sh) | Set `rust` shared library linker | | [--rc-ar](#-rc-ar) | Set `rust` static library archiver | +| [--cu-cxx](#-cu-cxx) | Set `cuda` host compiler | | [--cu-ld](#-cu-ld) | Set `cuda` linker | | [--cu-sh](#-cu-sh) | Set `cuda` shared library linker | | [--cu-ar](#-cu-ar) | Set `cuda` static library archiver | |
