summaryrefslogtreecommitdiff
path: root/xmake
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2025-12-01 12:47:59 +0800
committerOpportunityLiu <[email protected]>2025-12-01 12:47:59 +0800
commit4846ee47d9f0bbe2cf05daa6e4fbbdd202cd86da (patch)
treee9e7e1244ee4c525b38655ea900c5f50ac87ee26 /xmake
parentc7e1e6519762517d87e366a9ec7569aa49273f48 (diff)
feat: add support for cuda 11~13; update templates and examples
Diffstat (limited to 'xmake')
-rw-r--r--xmake/modules/lib/detect/find_cudadevices.lua6
-rw-r--r--xmake/rules/cuda/gencodes/xmake.lua6
-rw-r--r--xmake/templates/cuda/console/project/xmake.lua6
-rw-r--r--xmake/templates/cuda/shared/project/xmake.lua6
-rw-r--r--xmake/templates/cuda/static/project/xmake.lua6
5 files changed, 19 insertions, 11 deletions
diff --git a/xmake/modules/lib/detect/find_cudadevices.lua b/xmake/modules/lib/detect/find_cudadevices.lua
index 0f459c711..a6ae606a6 100644
--- a/xmake/modules/lib/detect/find_cudadevices.lua
+++ b/xmake/modules/lib/detect/find_cudadevices.lua
@@ -228,6 +228,7 @@ end
function _order_by_flops(devices)
+ -- See https://github.com/NVIDIA/cuda-samples/blob/master/Common/helper_cuda_drvapi.h#L100
local ngpu_arch_cores_per_sm =
{
[30] = 192
@@ -248,6 +249,11 @@ function _order_by_flops(devices)
, [87] = 128
, [89] = 128
, [90] = 128
+ , [100] = 128
+ , [103] = 128
+ , [110] = 128
+ , [120] = 128
+ , [121] = 128
}
for _, dev in ipairs(devices) do
diff --git a/xmake/rules/cuda/gencodes/xmake.lua b/xmake/rules/cuda/gencodes/xmake.lua
index 902e932db..0da3deb56 100644
--- a/xmake/rules/cuda/gencodes/xmake.lua
+++ b/xmake/rules/cuda/gencodes/xmake.lua
@@ -43,8 +43,10 @@ rule("cuda.gencodes")
-- sm_20 and compute_20 is supported until CUDA 8
-- sm_30 and compute_30 is supported until CUDA 10
- local known_v_archs = hashset.of(20, 30, 32, 35, 37, 50, 52, 53, 60, 61, 62, 70, 72, 75, 80, 86, 87, 89, 90)
- local known_r_archs = hashset.of(20, 30, 32, 35, 37, 50, 52, 53, 60, 61, 62, 70, 72, 75, 80, 86, 87, 89, 90)
+ -- sm_37 and compute_37 is supported until CUDA 11
+ -- sm_72 and compute_72 is supported until CUDA 12
+ local known_v_archs = hashset.of(20, 30, 32, 35, 37, 50, 52, 53, 60, 61, 62, 70, 72, 75, 80, 86, 87, 89, 90, 100, 103, 110, 120, 121)
+ local known_r_archs = hashset.of(20, 30, 32, 35, 37, 50, 52, 53, 60, 61, 62, 70, 72, 75, 80, 86, 87, 89, 90, 100, 103, 110, 120, 121)
local function nf_cugencode(archs)
if type(archs) ~= "string" then
diff --git a/xmake/templates/cuda/console/project/xmake.lua b/xmake/templates/cuda/console/project/xmake.lua
index 70967535d..5cfdad354 100644
--- a/xmake/templates/cuda/console/project/xmake.lua
+++ b/xmake/templates/cuda/console/project/xmake.lua
@@ -8,12 +8,12 @@ target("${TARGETNAME}")
add_cugencodes("native")
-- generate PTX code for the virtual architecture to guarantee compatibility
- add_cugencodes("compute_35")
+ add_cugencodes("compute_75")
-- -- generate SASS code for each SM architecture
- -- add_cugencodes("sm_35", "sm_37", "sm_50", "sm_52", "sm_60", "sm_61", "sm_70", "sm_75")
+ -- add_cugencodes("sm_75", "sm_80", "sm_89", "sm_90", "sm_100")
-- -- generate PTX code from the highest SM architecture to guarantee forward-compatibility
- -- add_cugencodes("compute_75")
+ -- add_cugencodes("compute_100")
${FAQ}
diff --git a/xmake/templates/cuda/shared/project/xmake.lua b/xmake/templates/cuda/shared/project/xmake.lua
index c24fdb0d8..45c27363f 100644
--- a/xmake/templates/cuda/shared/project/xmake.lua
+++ b/xmake/templates/cuda/shared/project/xmake.lua
@@ -9,12 +9,12 @@ target("${TARGETNAME}")
add_cugencodes("native")
-- generate PTX code for the virtual architecture to guarantee compatibility
- add_cugencodes("compute_30")
+ add_cugencodes("compute_75")
-- -- generate SASS code for each SM architecture
- -- add_cugencodes("sm_30", "sm_35", "sm_37", "sm_50", "sm_52", "sm_60", "sm_61", "sm_70", "sm_75")
+ -- add_cugencodes("sm_75", "sm_80", "sm_89", "sm_90", "sm_100")
-- -- generate PTX code from the highest SM architecture to guarantee forward-compatibility
- -- add_cugencodes("compute_75")
+ -- add_cugencodes("compute_100")
${FAQ}
diff --git a/xmake/templates/cuda/static/project/xmake.lua b/xmake/templates/cuda/static/project/xmake.lua
index ec663ae28..6d84c3b92 100644
--- a/xmake/templates/cuda/static/project/xmake.lua
+++ b/xmake/templates/cuda/static/project/xmake.lua
@@ -9,12 +9,12 @@ target("${TARGETNAME}")
add_cugencodes("native")
-- generate PTX code for the virtual architecture to guarantee compatibility
- add_cugencodes("compute_30")
+ add_cugencodes("compute_75")
-- -- generate SASS code for each SM architecture
- -- add_cugencodes("sm_30", "sm_35", "sm_37", "sm_50", "sm_52", "sm_60", "sm_61", "sm_70", "sm_75")
+ -- add_cugencodes("sm_75", "sm_80", "sm_89", "sm_90", "sm_100")
-- -- generate PTX code from the highest SM architecture to guarantee forward-compatibility
- -- add_cugencodes("compute_75")
+ -- add_cugencodes("compute_100")
${FAQ}