From 949795859315dbe358e3340967e35b09811fcbb8 Mon Sep 17 00:00:00 2001 From: Hoildkv <42310255+xq114@users.noreply.github.com> Date: Fri, 25 Feb 2022 13:50:30 +0800 Subject: fix find_cudadevice on windows x86 --- xmake/modules/lib/detect/find_cudadevices.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xmake/modules/lib/detect/find_cudadevices.lua b/xmake/modules/lib/detect/find_cudadevices.lua index dcf4a4229..fac3c8a21 100644 --- a/xmake/modules/lib/detect/find_cudadevices.lua +++ b/xmake/modules/lib/detect/find_cudadevices.lua @@ -131,6 +131,11 @@ function _find_devices(verbose, envs) { function () local args = { sourcefile, "-run", "-o", outfile , '-DPRINT_SUFFIX="' .. _PRINT_SUFFIX .. '"' } + if is_arch("x86") then + table.insert(args, "-m32") + elseif is_arch("x64") then + table.insert(args, "-m64") + end return os.iorunv(nvcc.program, args, {envs = envs}) end, catch -- cgit v1.3.1