Skip to content

Always raise SubDeviceCreationError even when counts are zero - #622

Merged
diptorupd merged 1 commit into
masterfrom
fix-error-handling-create_sub_devices
Oct 5, 2021
Merged

diptorupd merged 1 commit into
masterfrom
fix-error-handling-create_sub_devices

Conversation

@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor

This now passes

SYCL_ENABLE_HOST_DEVICE=1 SYCL_DEVICE_FILTER=host:host python -m pytest dpctl/tests/test_sycl_device.py

@coveralls

coveralls commented Oct 5, 2021 •

Copy link
Copy Markdown
Collaborator

Coverage Status

Coverage decreased (-0.4%) to 74.042% when pulling cf618ec on fix-error-handling-create_sub_devices into d469c84 on master.

@oleksandr-pavlyk
oleksandr-pavlyk force-pushed the fix-error-handling-create_sub_devices branch from 3666293 to cf618ec Compare October 5, 2021 21:30
Comment thread dpctl/_sycl_device.pyx
if DVRef is NULL:
raise SubDeviceCreationError("Sub-devices were not created.")
raise SubDeviceCreationError(
"Sub-devices were not created." if (count > 0) else

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The line is magic! :) Python 🥇

@diptorupd
diptorupd merged commit 112b6be into master Oct 5, 2021
@diptorupd
diptorupd deleted the fix-error-handling-create_sub_devices branch October 5, 2021 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants