Add device-aware output dtype for dpt.round() with boolean input#2851
Merged
vlad-perevezentsev merged 4 commits intoinclude-dpctl-tensorfrom Apr 15, 2026
Merged
Add device-aware output dtype for dpt.round() with boolean input#2851vlad-perevezentsev merged 4 commits intoinclude-dpctl-tensorfrom
dpt.round() with boolean input#2851vlad-perevezentsev merged 4 commits intoinclude-dpctl-tensorfrom
Conversation
Collaborator
ndgrigorian
reviewed
Apr 14, 2026
Contributor
|
Array API standard conformance tests for dpnp=0.20.0dev6=py313h509198e_58 ran successfully. |
ndgrigorian
reviewed
Apr 15, 2026
ndgrigorian
reviewed
Apr 15, 2026
ndgrigorian
previously approved these changes
Apr 15, 2026
Collaborator
ndgrigorian
left a comment
There was a problem hiding this comment.
aside from above points LGTM
Contributor
|
View rendered docs @ https://intelpython.github.io/dpnp/index.html |
antonwolfy
approved these changes
Apr 15, 2026
Contributor
antonwolfy
left a comment
There was a problem hiding this comment.
LGTM
Thank you @vlad-perevezentsev
549e940
into
include-dpctl-tensor
67 of 71 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR proposes device-aware output dtype resolution for
dpnp.tensor.round()withbooleaninput to handle devices that do not supportfloat16Boolean support for round() was originally added in #2817 6f5a792 to match NumPy behavior where numpy.round(bool) returns float16 rather than an integral type like int8.
However on devices without fp16 support, returning float16 is not viable.
The bool type mapping was removed from the round kernel and an acceptance
function
_acceptance_fn_roundwas added to ensure the fallback in_find_buf_dtypeprefers floating-point output over integral types for boolean input
result
fp16 devices: round(bool) -> float16
non-fp16 devices: round(bool) -> float32