From 49f14868b5fa9bca4aa2f51ea2b70f9edae89cb6 Mon Sep 17 00:00:00 2001 From: OpportunityLiu Date: Tue, 23 Jul 2019 12:01:45 +0800 Subject: remove unused code --- xmake/modules/core/tools/cl.lua | 2 +- xmake/modules/core/tools/nvcc.lua | 2 +- xmake/rules/cuda/gencodes/xmake.lua | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index 06fb9e2fc..0c139fc63 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -104,7 +104,7 @@ function nf_symbol(self, level, target) -- check and add symbol output file flags = "-Zi -Fd" .. path.join(symboldir, "compile." .. path.filename(symbolfile)) - if self:has_flags({"-Zi", "-FS", "-Fd" .. os.nuldev() .. ".pdb"}, "cxflags", { flagskey = "-Zi -FS -Fd" }) then + if self:has_flags({"-Zi", "-FS", "-Fd" .. os.nuldev() .. ".pdb"}, "cxflags", { flagskey = "-Zi -FS -Fd" }) then flags = "-FS " .. flags end else diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua index 17ad802b6..b863058e6 100644 --- a/xmake/modules/core/tools/nvcc.lua +++ b/xmake/modules/core/tools/nvcc.lua @@ -80,7 +80,7 @@ function nf_symbol(self, level, target) -- check and add symbol output file host_flags = "-Zi -Fd" .. path.join(symboldir, "compile." .. path.filename(symbolfile)) - if self:has_flags({'-Xcompiler "-Zi -FS -Fd' .. os.nuldev() .. '.pdb"'}, "cuflags", { flagskey = '-Xcompiler "-Zi -FS -Fd"' }) then + if self:has_flags({'-Xcompiler "-Zi -FS -Fd' .. os.nuldev() .. '.pdb"'}, "cuflags", { flagskey = '-Xcompiler "-Zi -FS -Fd"' }) then host_flags = "-FS " .. host_flags end else diff --git a/xmake/rules/cuda/gencodes/xmake.lua b/xmake/rules/cuda/gencodes/xmake.lua index d1a1dc277..09e45ed72 100644 --- a/xmake/rules/cuda/gencodes/xmake.lua +++ b/xmake/rules/cuda/gencodes/xmake.lua @@ -98,7 +98,6 @@ rule("cuda.gencodes") end end - local result = { clang = {}, nvcc = {} } if v_arch == nil and #r_archs == 0 then return nil end @@ -111,15 +110,16 @@ rule("cuda.gencodes") if v_arch then table.insert(r_archs, v_arch) + else + v_arch = math.min(unpack(r_archs)) end r_archs = table.unique(r_archs) + local clang_flags = {} for _, r_arch in ipairs(r_archs) do table.insert(clang_flags, '--cuda-gpu-arch=sm_' .. r_arch) end - r_archs = table.unique(r_archs) - v_arch = v_arch or math.min(unpack(r_archs)) local nvcc_flags = nil if #r_archs == 1 then nvcc_flags = '-gencode arch=compute_' .. v_arch .. ',code=sm_' .. r_archs[1] -- cgit v1.3.1