Skip to content

Commit

Permalink
install cuda via pyproject; add cupy test
Browse files Browse the repository at this point in the history
  • Loading branch information
flexatone committed Aug 28, 2023
1 parent 720f5b5 commit 36d345e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ jobs:
run: |
nvidia-smi
python3 -m pip install --upgrade pip
pip3 install cupy-cuda114
pip install -e .[test]
pip install -e .[test-cuda114]
pytest test
env:
REPO_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ test = [
'pytest==7.4.*',
'invoke==2.2.*',
]
test-cuda114 = [
'cupy-cuda114==10.6.*',
'pytest==7.4.*',
'invoke==2.2.*',
]

# [project.scripts]
# my-script = "my_package.module:function"
9 changes: 9 additions & 0 deletions test/unit/test_curay.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
from hyray import ndcuray
import hyray as hr

# NOTE: these tests require CUDA

# pytest -W ignore::DeprecationWarning test/test_unit.py


def test_cupy():
# this test is to proove that cupy is intalled and working
import cupy as cp
print('cupy version:', cp.__version__)
a1 = cp.array([0, 1])

#-------------------------------------------------------------------------------
# test ndcurayFlags object

Expand Down
2 changes: 2 additions & 0 deletions test/unit/test_hyray.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import hyray as hr
import numpy as np

# NOTE: this test can be run (and should pass) without CUDA

MODULES = (hr, np)

@pytest.mark.parametrize('mod', MODULES)
Expand Down

0 comments on commit 36d345e

Please sign in to comment.