Skip to content

Commit dbf2ea1

Browse files
authored
Merge pull request #15 from fjarri/multi-device
Add a second virtual device and run examples as a part of POCL test
2 parents 9284f13 + 1f693bd commit dbf2ea1

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.github/workflows/tests.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,11 @@ jobs:
6262
run: |
6363
pdm sync -G tests,pyopencl
6464
- name: Test with pytest
65+
# Create two POCL devices so that we could run multi-device tests
6566
run: |
66-
pdm run py.test --cov=grunnur --cov-report=xml tests
67+
env POCL_DEVICES="cpu cpu" pdm run py.test --cov=grunnur --cov-report=xml tests
68+
- name: Run examples
69+
# Create two POCL devices so that we could run multi-device tests
70+
run: |
71+
env POCL_DEVICES="cpu cpu" pdm run examples/multi_device_comparison.py
72+
env POCL_DEVICES="cpu cpu" pdm run examples/temporary_allocations.py

examples/multi_device_comparison.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ def test_multi_device(
101101
assert (a_ref == a_res).all()
102102

103103

104+
test_single_device(0, 2**20)
104105
test_single_device(1, 2**20)
105-
test_single_device(2, 2**20)
106-
test_multi_device([1, 2], 2**20)
106+
test_multi_device([0, 1], 2**20)
107107

108+
test_single_device(0, 2**24, benchmark=True)
108109
test_single_device(1, 2**24, benchmark=True)
109-
test_single_device(2, 2**24, benchmark=True)
110-
test_multi_device([1, 2], 2**24, benchmark=True)
110+
test_multi_device([0, 1], 2**24, benchmark=True)

0 commit comments

Comments
 (0)