Skip to content

Commit

Permalink
Merge pull request #15 from fjarri/multi-device
Browse files Browse the repository at this point in the history
Add a second virtual device and run examples as a part of POCL test
  • Loading branch information
fjarri authored Jul 26, 2024
2 parents 9284f13 + 1f693bd commit dbf2ea1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,11 @@ jobs:
run: |
pdm sync -G tests,pyopencl
- name: Test with pytest
# Create two POCL devices so that we could run multi-device tests
run: |
pdm run py.test --cov=grunnur --cov-report=xml tests
env POCL_DEVICES="cpu cpu" pdm run py.test --cov=grunnur --cov-report=xml tests
- name: Run examples
# Create two POCL devices so that we could run multi-device tests
run: |
env POCL_DEVICES="cpu cpu" pdm run examples/multi_device_comparison.py
env POCL_DEVICES="cpu cpu" pdm run examples/temporary_allocations.py
8 changes: 4 additions & 4 deletions examples/multi_device_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ def test_multi_device(
assert (a_ref == a_res).all()


test_single_device(0, 2**20)
test_single_device(1, 2**20)
test_single_device(2, 2**20)
test_multi_device([1, 2], 2**20)
test_multi_device([0, 1], 2**20)

test_single_device(0, 2**24, benchmark=True)
test_single_device(1, 2**24, benchmark=True)
test_single_device(2, 2**24, benchmark=True)
test_multi_device([1, 2], 2**24, benchmark=True)
test_multi_device([0, 1], 2**24, benchmark=True)

0 comments on commit dbf2ea1

Please sign in to comment.