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

More traits for unary and binary operations #119

Merged
merged 4 commits into from
Jul 23, 2024

Conversation

yasahi-hpc
Copy link
Collaborator

@yasahi-hpc yasahi-hpc commented Jul 15, 2024

This PR aims at adding more traits for unary and binary operations to KokkosFFT_traits.hpp.
This will be applied in another PR to improve error handlings as commented in #80

Following modifications are made

Static assertion to Unary (fftshift, ifftshift) and Binary (Plan and fft functions) APIs. Applications of new traits (unchecked tasks) would be done in another PR.

  • Introduce is_view_operatable_v for Unary operation (Views can be accessible from Execspace and the base value types are float/double/Kokkos::complex<float>/Kokkos::complex<double>. In addition, layout is either Kokkos::LayoutLeft or Kokkos::LayoutRight.
  • Introduce are_views_operatable_v for Binary operation (Both Views are operatable and have the same precision, layout and rank)
  • Introduce have_same_precision_v have_same_base_floating_point_type_v for Binary operation (the values have the same precision base floating point type. For example, float and Kokkos::complex<float> have the same precision)
  • Introduce have_same_layout_v for Binary operation
  • Introduce have_same_rank_v for Binary operation
  • Apply are_views_operatable_v to binary APIs. Exec space and memory space consistency, precision consistency, layout consistency and rank consistency.
  • Apply is_view_operatable_v to unary APIs. Exec space and memory space consistency.

@yasahi-hpc yasahi-hpc self-assigned this Jul 15, 2024
@yasahi-hpc yasahi-hpc added enhancement New feature or request cleanup labels Jul 15, 2024
Copy link
Member

@cedricchevalier19 cedricchevalier19 left a comment

Choose a reason for hiding this comment

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

Looks ok, but I am not sure about the PR description, a lot of items are not checked. I think it is ok to merge if you plan to put the other parts in a separate PR.

common/src/KokkosFFT_traits.hpp Outdated Show resolved Hide resolved
common/unit_test/Test_Traits.cpp Show resolved Hide resolved
@yasahi-hpc
Copy link
Collaborator Author

Looks ok, but I am not sure about the PR description, a lot of items are not checked. I think it is ok to merge if you plan to put the other parts in a separate PR.

Sorry description was unclear. I have updated the description.
As you said, this PR aims to introduce new traits. These traits are then applied in a separate PR.

@yasahi-hpc yasahi-hpc merged commit bab1620 into kokkos:main Jul 23, 2024
19 checks passed
@yasahi-hpc yasahi-hpc deleted the improve-error-handlings branch July 23, 2024 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants