From dee5ebd8220b3695a0ebf43d88fee06d910766ee Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 25 Jan 2022 00:27:06 +0800 Subject: improve find cuda devices --- xmake/modules/lib/detect/find_cudadevices.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'xmake/modules/lib') 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 -- cgit v1.3.1