summaryrefslogtreecommitdiff
path: root/xmake/modules/lib/detect
diff options
context:
space:
mode:
authorruki <[email protected]>2022-01-25 00:27:06 +0800
committerruki <[email protected]>2022-01-25 00:27:06 +0800
commitdee5ebd8220b3695a0ebf43d88fee06d910766ee (patch)
treecdb1641b18baced30fbad284fa29455395454f7f /xmake/modules/lib/detect
parenta1ecc4de70ff0e108bcf89fbccfd25189239071c (diff)
improve find cuda devices
Diffstat (limited to 'xmake/modules/lib/detect')
-rw-r--r--xmake/modules/lib/detect/find_cudadevices.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/xmake/modules/lib/detect/find_cudadevices.lua b/xmake/modules/lib/detect/find_cudadevices.lua
index c55cc26f8..d2c83c663 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)
+function _find_devices(verbose, envs)
-- find nvcc
local nvcc = assert(find_tool("nvcc"), "nvcc not found")
@@ -131,7 +131,7 @@ function _find_devices(verbose)
{
function ()
local args = { sourcefile, "-run", "-o", outfile , '-DPRINT_SUFFIX="' .. _PRINT_SUFFIX .. '"' }
- return os.iorunv(nvcc.program, args)
+ return os.iorunv(nvcc.program, args, {envs = envs})
end,
catch
{
@@ -187,7 +187,7 @@ function _get_devices(opt)
end
local verbose = opt.verbose or option.get("verbose") or option.get("diagnosis")
- local devices = _find_devices(verbose)
+ local devices = _find_devices(verbose, opt.envs)
if devices then
cachedata = { succeed = true, data = devices }
else