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

Hotfix shape arg #93

Merged
merged 5 commits into from
Apr 5, 2024
Merged

Hotfix shape arg #93

merged 5 commits into from
Apr 5, 2024

Conversation

yasahi-hpc
Copy link
Collaborator

@yasahi-hpc yasahi-hpc commented Mar 25, 2024

This PR aims at fixing the behavior of APIs with optional shape arguments.
Following modifications are made:

  1. Fix the function to compute a new shape to work on the specified axis (KokkosFFT_padding.hpp)
  2. Update tests accordingly (Test_Padding.cpp)
  3. Behaviors in FFT APIs with shape args are fixed (KokkosFFT_Transform.hpp)
  4. Update tests accordingly (Test_Transform.cpp)

In detail, shape argument n or s should work on the specified axis.
For example, shapes would change in the following manner.

# 2D FFT on 2D View
x = np.random.rand(4, 3) + 1j * np.random.rand() # shape (4, 3) 
x_hat = np.fft.irfft2(x, axes=(-1, -2)) # shape (6, 3)
x_hat = np.fft.irfft2(x, axes=(-1, -2), s=(4, 3)) # shape (3, 4)
x_hat = np.fft.irfft2(x, axes=(-1, -2), s=(6, 3)) # shape (3, 6)
x_hat = np.fft.irfft2(x, axes=(-1, -2), s=(6, 5)) # shape (5, 6)

Although this functionality may be not that useful,
it can be reused to accept Views with LayoutStrided

@yasahi-hpc yasahi-hpc self-assigned this Mar 25, 2024
@yasahi-hpc yasahi-hpc added the bug Something isn't working label Mar 25, 2024
@yasahi-hpc yasahi-hpc merged commit a322cb5 into main Apr 5, 2024
20 checks passed
@yasahi-hpc yasahi-hpc deleted the hotfix-shape-arg branch April 5, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant