summaryrefslogtreecommitdiff
path: root/xmake/templates/cuda/console/project/xmake.lua
blob: 6521e605c72a031bf962f226961afbc772c105dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

-- add modes: debug and release
add_rules("mode.debug", "mode.release")

-- define target
target("${TARGETNAME}")

    -- set kind
    set_kind("binary")

    -- generate relocatable device code for device linker of dependents.
    -- if __device__ or __global__ functions will be called cross file,
    -- or dynamic parallelism will be used,
    -- this instruction should be opted in.
    -- add_cuflags("-rdc=true")

    -- add files
    add_files("src/*.cu")

    -- generate SASS code for SM architecture of current host
    add_cugencodes("native")

    -- generate PTX code for the virtual architecture to guarantee compatibility
    add_cugencodes("compute_30")

    -- -- 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")

    -- -- generate PTX code from the highest SM architecture to guarantee forward-compatibility
    -- add_cugencodes("compute_75")

${FAQ}