Skip to content

Commit 9597299

Browse files
Test to expect error creating context from all devices
Devices from different platforms can not be used to create a sycl context
1 parent 5a1798a commit 9597299

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

dpctl/tests/test_sycl_context.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
""" Defines unit test cases for the SyclContxt class.
17+
""" Defines unit test cases for the :class:`dpctl.SyclContext` class.
1818
"""
1919

2020
import pytest
@@ -218,3 +218,10 @@ def test_invalid_capsule():
218218
cap = create_invalid_capsule()
219219
with pytest.raises(ValueError):
220220
dpctl.SyclContext(cap)
221+
222+
223+
def test_multi_device_different_platforms():
224+
devs = dpctl.get_devices() # all devices
225+
if len(devs) > 1:
226+
with pytest.raises(ValueError):
227+
dpctl.SyclContext(devs)

0 commit comments

Comments
 (0)