Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cuda_core/tests/test_binaries/build_test_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ if [[ "${OS:-}" == "Windows_NT" ]]; then
NVCC_EXTRA_FLAGS+=(-Xcompiler /Zc:preprocessor)
fi

nvcc -dc "${NVCC_EXTRA_FLAGS[@]}" -arch=all-major \
NVCC="${NVCC:-nvcc}"

"${NVCC}" -dc "${NVCC_EXTRA_FLAGS[@]}" -arch=all-major \
-o "${SCRIPTPATH}/saxpy.o" "${SCRIPTPATH}/saxpy.cu"

ls -lah "${SCRIPTPATH}/saxpy.o"
7 changes: 5 additions & 2 deletions cuda_core/tests/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,18 @@ def get_saxpy_object():
obj_path = binaries_dir / "saxpy.o"

if not obj_path.is_file():
if find_nvidia_binary_utility("nvcc") is None:
nvcc_path = find_nvidia_binary_utility("nvcc")
if nvcc_path is None:
pytest.skip(
f"saxpy.o not found at {obj_path} and nvcc is unavailable. "
"In CI this is downloaded from the build stage."
)
env = os.environ.copy()
env["NVCC"] = nvcc_path
Comment on lines +198 to +199

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

subprocess.run( # noqa: S603
["bash", str(binaries_dir / "build_test_binaries.sh")], # noqa: S607
check=True,
env=os.environ,
env=env,
)

return obj_path.read_bytes()
Expand Down
Loading