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

Explicitly include headers used in the c++ file pertaining to reduction #1802

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

oleksandr-pavlyk
Copy link
Collaborator

This is a good, recommended practice.

Moved global definition of namespaces td_ns and su_ns in 'reductions.hpp' into namespace.

Fixed resulting build breakage by including needed headers and defining those namespaces locally in affected files.

Changed definition of logaddexp in math_utils.hpp to use selector instead of if/else branches to improve performance. Switch revealed silent inefficiency from using std::log1p for all types (for sycl::half it would silently upcast to float and evaluate std::log1p<float>(sycl::half)).

Used if constexpr to use sycl::log1p for half and single FP types. For double, use std::log1p until the issue is fixed.

  • 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?

This is a good, recommended practice.

Moved global definition of namespaces td_ns and su_ns in reductions.hpp
into namespace.

Fixed resulting build breakage by including needed headers and defining
those namespaces locally in affected files.

Changed definition of logaddexp in math_utils to use selector instead
of if/else branches to improve performance. Switch revealed silent
inefficiency from using std::log1p for all types (for sycl::half it
would silently upcast to float and evaluate std::log1p<float>(sycl::half)).

Used `if constexpr` to use sycl::log1p for half and single FP types.
For double, use std::log1p until the issue is fixed.
Copy link

github-actions bot commented Aug 19, 2024

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

Copy link

Array API standard conformance tests for dpctl=0.18.0dev0=py310hdf72452_324 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 87.91%. remained the same
when pulling 146f66e on clean-up-reduction-headers
into 0b9cec8 on master.

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.

Test failures are unrelated, this LGTM.

Good catch on the namespaces!

@oleksandr-pavlyk oleksandr-pavlyk merged commit 63ffaba into master Aug 19, 2024
39 of 53 checks passed
@oleksandr-pavlyk oleksandr-pavlyk deleted the clean-up-reduction-headers branch August 19, 2024 16:16
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