Unverified Commit ba8ae1d8 authored by bnellnm's avatar bnellnm Committed by GitHub
Browse files

Check for _is_cuda() in compute_num_jobs (#3481)

parent 84eaa684
...@@ -61,12 +61,12 @@ class cmake_build_ext(build_ext): ...@@ -61,12 +61,12 @@ class cmake_build_ext(build_ext):
except AttributeError: except AttributeError:
num_jobs = os.cpu_count() num_jobs = os.cpu_count()
nvcc_cuda_version = get_nvcc_cuda_version() nvcc_threads = None
if nvcc_cuda_version >= Version("11.2"): if _is_cuda():
nvcc_threads = int(os.getenv("NVCC_THREADS", 8)) nvcc_cuda_version = get_nvcc_cuda_version()
num_jobs = max(1, round(num_jobs / (nvcc_threads / 4))) if nvcc_cuda_version >= Version("11.2"):
else: nvcc_threads = int(os.getenv("NVCC_THREADS", 8))
nvcc_threads = None num_jobs = max(1, round(num_jobs / (nvcc_threads / 4)))
return num_jobs, nvcc_threads return num_jobs, nvcc_threads
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment