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

Histogram2d #2262

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Histogram2d #2262

wants to merge 9 commits into from

Conversation

AlexanderKalistratov
Copy link
Collaborator

@AlexanderKalistratov AlexanderKalistratov commented Jan 14, 2025

Implementation of histogram2d via already existing functionality of histogramdd.

histogram2d accepts 2 different arrays, while histogramdd accepts single two-dimensional array.
In order to avoid double copy (first to single array, second to supported type) histogram2d perform type checks before calling to histogramdd.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • If this PR is a work in progress, are you filing the PR as a draft?

@AlexanderKalistratov AlexanderKalistratov force-pushed the histogram2d branch 3 times, most recently from 8cfd5db to 541e7d9 Compare January 15, 2025 02:16
@coveralls
Copy link
Collaborator

coveralls commented Jan 15, 2025

Coverage Status

coverage: 71.241% (+0.06%) from 71.181%
when pulling b5627dc on histogram2d
into 451c2b3 on master.

@AlexanderKalistratov
Copy link
Collaborator Author

@antonwolfy @vlad-perevezentsev ready for review

@AlexanderKalistratov
Copy link
Collaborator Author

dpnp/dpnp_iface_histograms.py Outdated Show resolved Hide resolved
dpnp/dpnp_iface_histograms.py Outdated Show resolved Hide resolved
dpnp/dpnp_iface_histograms.py Outdated Show resolved Hide resolved
dpnp/dpnp_iface_histograms.py Outdated Show resolved Hide resolved
dpnp/dpnp_iface_histograms.py Outdated Show resolved Hide resolved
dpnp/dpnp_iface_histograms.py Outdated Show resolved Hide resolved
dpnp/dpnp_iface_histograms.py Outdated Show resolved Hide resolved
dpnp/dpnp_iface_histograms.py Outdated Show resolved Hide resolved
dpnp/dpnp_iface_histograms.py Outdated Show resolved Hide resolved
dpnp/dpnp_iface_histograms.py Outdated Show resolved Hide resolved
@AlexanderKalistratov
Copy link
Collaborator Author

@antonwolfy please re-review

Copy link
Contributor

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

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

I left one minor comment, but overall LGTM! Thank you @AlexanderKalistratov

dpnp/dpnp_iface_histograms.py Outdated Show resolved Hide resolved
Copy link
Contributor

Array API standard conformance tests for dpnp=0.17.0dev4=py312he4f9c94_24 ran successfully.
Passed: 954
Failed: 0
Skipped: 46

@@ -54,6 +54,19 @@ def to_supported_dtypes(dtypes, supported_types, device):
def is_castable(dtype, stype):
return _can_cast(dtype, stype, has_fp16, has_fp64)

if not isinstance(supported_types, Iterable):
supported_types = (supported_types,)
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems missing to be covered by a test

if isinstance(dtypes, Iterable):
sdtypes_elem = supported_types[0]
if not isinstance(sdtypes_elem, Iterable):
raise ValueError(
Copy link
Contributor

Choose a reason for hiding this comment

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

And that error case as well

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