Skip to content

Commit 2780efd

Browse files
authored
Use pathfinder nvcc for object-code test fixture (#2284)
1 parent 7ff3774 commit 2780efd

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

cuda_core/tests/test_binaries/build_test_binaries.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ if [[ "${OS:-}" == "Windows_NT" ]]; then
1414
NVCC_EXTRA_FLAGS+=(-Xcompiler /Zc:preprocessor)
1515
fi
1616

17-
nvcc -dc "${NVCC_EXTRA_FLAGS[@]}" -arch=all-major \
17+
NVCC="${NVCC:-nvcc}"
18+
19+
"${NVCC}" -dc "${NVCC_EXTRA_FLAGS[@]}" -arch=all-major \
1820
-o "${SCRIPTPATH}/saxpy.o" "${SCRIPTPATH}/saxpy.cu"
1921

2022
ls -lah "${SCRIPTPATH}/saxpy.o"

cuda_core/tests/test_module.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,18 @@ def get_saxpy_object():
189189
obj_path = binaries_dir / "saxpy.o"
190190

191191
if not obj_path.is_file():
192-
if find_nvidia_binary_utility("nvcc") is None:
192+
nvcc_path = find_nvidia_binary_utility("nvcc")
193+
if nvcc_path is None:
193194
pytest.skip(
194195
f"saxpy.o not found at {obj_path} and nvcc is unavailable. "
195196
"In CI this is downloaded from the build stage."
196197
)
198+
env = os.environ.copy()
199+
env["NVCC"] = nvcc_path
197200
subprocess.run( # noqa: S603
198201
["bash", str(binaries_dir / "build_test_binaries.sh")], # noqa: S607
199202
check=True,
200-
env=os.environ,
203+
env=env,
201204
)
202205

203206
return obj_path.read_bytes()

0 commit comments

Comments
 (0)