Skip to content

Conversation

@lucbv
Copy link
Contributor

@lucbv lucbv commented Sep 15, 2025

This simply moves the class to a new namespace to avoid having it in the Kokkos namespace.

@lucbv lucbv self-assigned this Sep 15, 2025
@lucbv lucbv added the Cleanup Code maintenance that isn't a bugfix or new feature label Sep 15, 2025
Copy link
Member

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

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

Any chance to deprecate the header as well and redirect to a new header with appropriate prefix?

namespace Details {
template <typename T>
using ArithTraits [[deprecated("Use Kokkos::ArithTraits instead")]] = ::Kokkos::ArithTraits<T>;
using ArithTraits [[deprecated("Use KokkosKernels::ArithTraits instead")]] = ::KokkosKernels::ArithTraits<T>;
Copy link
Member

Choose a reason for hiding this comment

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

How long ago did you deprecate this alias?
Is removing it an option?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are pretty close to 5.0.0, why would we do a backward breaking change against our policies at this point?

Copy link
Member

Choose a reason for hiding this comment

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

I am talking about the alias in Details:: that was already marked as deprecated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I understand and what I said above still stands, do we really need to be removed before 5.0.0? That's only a few months away...

Copy link
Member

Choose a reason for hiding this comment

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

What do you mean "before 5.0"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't want to remove this until after the last release in the 4.7 series

Copy link
Member

Choose a reason for hiding this comment

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

4.7 was the last minor release in the 4.x series

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay so not 4.7.2 right? straight to 5.0.0?

Copy link
Member

Choose a reason for hiding this comment

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

4.7.2 would come from 4.7.1 not develop

This simply moves the class to a new namespace to avoid having it
in the Kokkos namespace.

Signed-off-by: Luc Berger-Vergiat <lberge@sandia.gov>
Signed-off-by: Luc Berger-Vergiat <lberge@sandia.gov>
Signed-off-by: Luc Berger-Vergiat <lberge@sandia.gov>
Signed-off-by: Luc Berger-Vergiat <lberge@sandia.gov>
KOKKOS_IF_ON_HOST((using std::isinf;))
KOKKOS_IF_ON_DEVICE((using Kokkos::isinf;))
return isinf(real(x)) || isinf(imag(x));
return std::isinf(std::real(x)) || std::isinf(std::imag(x));
Copy link
Member

Choose a reason for hiding this comment

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

Why std::?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Honestly I am not sure I understand how the hole thing works on device but if you look further down, real and imag function are implemented by call std::real and std::imag.
So for now it's not worse than it was and it allows to complete the scope I defined for this PR.
Of course these functions could easily cause problem down the line and opening an issue to work on it is appropriate.

@dalg24
Copy link
Member

dalg24 commented Sep 30, 2025

Any chance to deprecate the header as well and redirect to a new header with appropriate prefix?

Would you be willing to move the traits definition to a new <KokkosKernels_ArithTraits.hpp>header and have < Kokkos_ArithTraits.hpp > just include it along with a using directive in the Kokkos:: namespace.

This avoid having us use the naming convention of Kokkos Core
for something that lives in Kokkos Kernels.
Next, I will modify header inclusions in the library to reflect
this change.

Signed-off-by: Luc Berger-Vergiat <lberge@sandia.gov>
Signed-off-by: Luc Berger-Vergiat <lberge@sandia.gov>
Signed-off-by: Luc Berger-Vergiat <lberge@sandia.gov>
@lucbv lucbv merged commit 14f8cbe into kokkos:develop Sep 30, 2025
24 of 25 checks passed
@lucbv lucbv deleted the move_arith_traits branch September 30, 2025 22:23
@ndellingwood
Copy link
Contributor

We'll need to fix Trilinos for these changes, e.g.

In file included from /root/Trilinos/packages/stokhos/src/sacado/kokkos/vector/tpetra/Stokhos_Tpetra_MP_Vector.hpp:29:
/root/Trilinos/packages/stokhos/src/sacado/kokkos/vector/linalg/Kokkos_ArithTraits_MP_Vector.hpp:24:7: error: cannot specialize a dependent template
   24 | class ArithTraits< Sacado::MP::Vector<S> > {

@ndellingwood
Copy link
Contributor

@lucbv just to check, these changes only apply to versions >= 5.0 ? (So I know how to guard in Trilinos)

@dalg24
Copy link
Member

dalg24 commented Oct 1, 2025

I suppose you could do

#if __has_include(KokkosKernels_ArithTraits.hpp)  // since 5.0

ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
…40799

Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
ndellingwood added a commit to ndellingwood/Trilinos that referenced this pull request Oct 1, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
@lucbv
Copy link
Contributor Author

lucbv commented Oct 1, 2025

Yes this would only apply to versions of Kokkos >= 5.0 so for a 4.7.2 release we would not want this change.

eeprude pushed a commit to eeprude/Trilinos that referenced this pull request Oct 9, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
eeprude pushed a commit to eeprude/Trilinos that referenced this pull request Oct 9, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
eeprude pushed a commit to eeprude/Trilinos that referenced this pull request Oct 9, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
eeprude pushed a commit to eeprude/Trilinos that referenced this pull request Oct 9, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
eeprude pushed a commit to eeprude/Trilinos that referenced this pull request Oct 9, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
eeprude pushed a commit to eeprude/Trilinos that referenced this pull request Oct 9, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
eeprude pushed a commit to eeprude/Trilinos that referenced this pull request Oct 9, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
eeprude pushed a commit to eeprude/Trilinos that referenced this pull request Oct 9, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
eeprude pushed a commit to eeprude/Trilinos that referenced this pull request Oct 9, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
eeprude pushed a commit to eeprude/Trilinos that referenced this pull request Oct 9, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
eeprude pushed a commit to eeprude/Trilinos that referenced this pull request Oct 9, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
eeprude pushed a commit to eeprude/Trilinos that referenced this pull request Oct 9, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
eeprude pushed a commit to eeprude/Trilinos that referenced this pull request Oct 9, 2025
…40799

Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
eeprude pushed a commit to eeprude/Trilinos that referenced this pull request Oct 9, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
eeprude pushed a commit to eeprude/Trilinos that referenced this pull request Oct 9, 2025
Compatibility update corresponding to kokkos/kokkos-kernels#2771

Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cleanup Code maintenance that isn't a bugfix or new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants