Skip to content

Extend _tensor_elementwise_impl with binary functions part 2#2804

Open
vlad-perevezentsev wants to merge 204 commits intoinclude-dpctl-tensorfrom
move_elementwise_binary_impl_part_2
Open

Extend _tensor_elementwise_impl with binary functions part 2#2804
vlad-perevezentsev wants to merge 204 commits intoinclude-dpctl-tensorfrom
move_elementwise_binary_impl_part_2

Conversation

@vlad-perevezentsev
Copy link
Contributor

@vlad-perevezentsev vlad-perevezentsev commented Mar 5, 2026

This PR extends _tensor_elementwise_impl with part of binary functions :

divide,
equal,
floor_divide,
greater,
greater_equal,
hypot,
less,
less_equal,
logaddexp

  • 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?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

@vlad-perevezentsev vlad-perevezentsev marked this pull request as ready for review March 11, 2026 15:56
@vlad-perevezentsev vlad-perevezentsev force-pushed the move_elementwise_binary_impl_part_2 branch from a3b2d00 to 608802a Compare March 11, 2026 18:53
ndgrigorian
ndgrigorian previously approved these changes Mar 12, 2026
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.

I looked over includes and nothing stood out, this one LGTM

@ndgrigorian ndgrigorian self-requested a review March 12, 2026 01:11
@ndgrigorian ndgrigorian dismissed their stale review March 12, 2026 01:11

was put in wrong PR

Base automatically changed from move_elementwise_binary_impl to include-dpctl-tensor March 18, 2026 14:23
Comment on lines +186 to +194
std::complex<float>,
T2,
std::complex<float>,
bool>,
td_ns::BinaryTypeMapResultEntry<T1,
std::complex<double>,
T2,
std::complex<double>,
bool>,
Copy link
Contributor

Choose a reason for hiding this comment

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

The following kernel header files use std::complex and std::complex in their type mappings but are missing the <complex> include:

dpctl_ext/tensor/libtensor/include/kernels/elementwise_functions/equal.hpp
dpctl_ext/tensor/libtensor/include/kernels/elementwise_functions/greater.hpp
dpctl_ext/tensor/libtensor/include/kernels/elementwise_functions/greater_equal.hpp
dpctl_ext/tensor/libtensor/include/kernels/elementwise_functions/less.hpp
dpctl_ext/tensor/libtensor/include/kernels/elementwise_functions/less_equal.hpp
dpctl_ext/tensor/libtensor/include/kernels/elementwise_functions/true_divide.hpp

/// extension, specifically functions for elementwise operations.
//===---------------------------------------------------------------------===//

#include <complex>
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing <algorithm> for std::copy (used at line 405)
Missing <string> for std::to_string (used at line 360)

#include "kernels/dpctl_tensor_types.hpp"
#include "kernels/elementwise_functions/common.hpp"

#include "utils/offset_utils.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

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

All 8 kernel header files include utils/offset_utils.hpp but never use it directly:

equal.hpp
floor_divide.hpp
greater.hpp
greater_equal.hpp
hypot.hpp
less.hpp
less_equal.hpp
true_divide.hpp

// init_logical_and(m);
init_logaddexp(m);
init_logical_not(m);
// init_logical_or(m);
Copy link
Contributor

Choose a reason for hiding this comment

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

Was it removed by mistake or intentionally?

@github-actions
Copy link
Contributor

Array API standard conformance tests for dpnp=0.20.0dev3=py313h509198e_227 ran successfully.
Passed: 1355
Failed: 2
Skipped: 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