diff options
| author | Hoildkv <[email protected]> | 2022-02-25 20:27:54 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-02-25 20:27:54 +0800 |
| commit | 304904858f9bec29aeaed8c1b646fba15ae025fb (patch) | |
| tree | 031efde03a211ced568cb6c390386e23c0ca2fb4 | |
| parent | 0722a44d0c64f78b019c7f439ed240e7d7bf3f96 (diff) | |
Update find_cudadevices.lua
| -rw-r--r-- | xmake/modules/lib/detect/find_cudadevices.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/xmake/modules/lib/detect/find_cudadevices.lua b/xmake/modules/lib/detect/find_cudadevices.lua index fac3c8a21..71ee12e3b 100644 --- a/xmake/modules/lib/detect/find_cudadevices.lua +++ b/xmake/modules/lib/detect/find_cudadevices.lua @@ -113,7 +113,7 @@ function _parse_result(lines, verbose) end -- find devices -function _find_devices(verbose, envs) +function _find_devices(verbose, opt) -- find nvcc local nvcc = assert(find_tool("nvcc"), "nvcc not found") @@ -131,12 +131,12 @@ function _find_devices(verbose, envs) { function () local args = { sourcefile, "-run", "-o", outfile , '-DPRINT_SUFFIX="' .. _PRINT_SUFFIX .. '"' } - if is_arch("x86") then + if opt.arch == "x86" then table.insert(args, "-m32") - elseif is_arch("x64") then + elseif opt.arch == "x64" or opt.arch == "x86_64" then table.insert(args, "-m64") end - return os.iorunv(nvcc.program, args, {envs = envs}) + return os.iorunv(nvcc.program, args, {envs = opt.envs}) end, catch { @@ -192,7 +192,7 @@ function _get_devices(opt) end local verbose = opt.verbose or option.get("verbose") or option.get("diagnosis") - local devices = _find_devices(verbose, opt.envs) + local devices = _find_devices(verbose, opt) if devices then cachedata = { succeed = true, data = devices } else |
