Skip to content

Make some offset indexer classes constexpr #1534

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

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

oleksandr-pavlyk
Copy link
Contributor

@oleksandr-pavlyk oleksandr-pavlyk commented Feb 7, 2024

Making NoOpIndexer constructor and the call operator a constexpr allows compiler to completely inline its definition at earlier optimization stages.

Also replaced stray py::ssize_t with ssize_t.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an 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 opening the PR as a draft?

Making NoOpIndexer constexpr allows compiler to completely inline
its definition at earlier optimization stages.

Also replaced stray py::ssize with ssize_t
Copy link

github-actions bot commented Feb 7, 2024

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 91.145%. remained the same
when pulling 2c7609a on make-some-offset-classes-constexpr
into e2d9640 on master.

Copy link

github-actions bot commented Feb 7, 2024

Array API standard conformance tests for dpctl=0.15.1dev3=py310h15de555_92 ran successfully.
Passed: 908
Failed: 1
Skipped: 86

Copy link
Collaborator

@ndgrigorian ndgrigorian left a comment

Choose a reason for hiding this comment

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

LGTM, this is a smart change! I'd like to note here that the constexpr calls to the getters are enabled by the constexpr constructors.

@oleksandr-pavlyk oleksandr-pavlyk merged commit ad98b19 into master Feb 7, 2024
@oleksandr-pavlyk oleksandr-pavlyk deleted the make-some-offset-classes-constexpr branch February 7, 2024 21:23
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