[SYCL] optimized calling UR functions #20776
Merged
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Change summary
checkUrResult function was made as short as possible by moving away all error handling to a separate non-inlined function and keeping common success path tiny and additionally optimized by compiler __builtin_expect. Also a few more simple inlines were added.
Performance impact
checkUrResult function is widely used in all paths including common path. My optimization positive impact on performance is visible in almost all metrics.
Some examples are below:
SYCL instructions reduced from 153.9k to 151.8k over UR (130.9), that is overhead over UR reduced by 9.1%, see:

SYCL instructions reduced from 133.5k to 132.2k over UR (119.2), that is overhead over UR reduced by 9.1%, see:

SYCL instructions reduced from 145.9k to 143.9k over UR (118.4), that is overhead over UR reduced by 7.3%, see:

SYCL time reduced from 202.1 to 194.6 over UR (155.0), that is overhead over UR reduced by 15.9%, see:
