Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL] Throw exception for unsupported UR features #12361

Open
wants to merge 2 commits into
base: sycl
Choose a base branch
from

Conversation

martygrant
Copy link
Contributor

Stemming from removing die calls in unsupported UR entry points (oneapi-src/unified-runtime#1127) and a spin-out issue discussing how to handle these errors in intel-llvm (oneapi-src/unified-runtime#1161).

This PR changes various PI entry points to interpret PI_ERROR_INVALID_OPERATION as receiving UR_RESULT_ERROR_UNSUPPORTED_FEATURE and will throw a SYCL exception with error code sycl::errc::feature_not_supported.

A new e2e test has been added (Plugin/ur_unsupported_feature.cpp) which is meant to purposely call an unsupported UR entry point and will assert that an exception is thrown specifically with code sycl::errc::feature_not_supported to ensure we are handling unsupported features from UR in intel-llvm appropriately.

"Platform create with native handle command not supported by backend.");
} else {
Plugin->checkPiResult(Result);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This pattern seems to repeat a lot. Could we maybe make a new call_optional or call_ext or something along those lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your suggestion, it certainly would be good to refactor out the repetitiveness here. I wonder if it might be worth putting the check inside the pre-existing call or call_nocheck functions?

…TION as receiving UR_RESULT_ERROR_UNSUPPORTED_FEATURE from Unified Runtime

and throw an appropriate exception. Added a new e2e test to check the error is handled correctly.
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.

2 participants