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

Implement csqrt #619

Merged
merged 4 commits into from
May 13, 2024
Merged

Implement csqrt #619

merged 4 commits into from
May 13, 2024

Conversation

tylera-nvidia
Copy link
Collaborator

@tylera-nvidia tylera-nvidia commented May 10, 2024

Add a complex sqrt function equivalent to the C++ functionality of csqrt,

The high-level functionality supported is to always generate a complex return, even if the input is only real. I've come across situations where users sqrt negative data, with the expectation of getting complex from real.

@tylera-nvidia
Copy link
Collaborator Author

@cliffburdick @luitjens. This is the implementation of csqrt we discussed in 2022. There is a C++ implementation of csqrt, however I was not able to get that function to compile in a .cu file, as it doesn't look like nvcc supports it. I was able to get equivalent functionality using a static cast prior to making the sqrt call, however I imagine this does leave us open to a divergent behavior to the C++ csqrt if that behavior ever changes. Any thoughts on if that makes this function still "worth it"?

Copy link
Collaborator

@cliffburdick cliffburdick left a comment

Choose a reason for hiding this comment

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

2 comments left

@tylera-nvidia tylera-nvidia marked this pull request as ready for review May 10, 2024 22:17
@cliffburdick
Copy link
Collaborator

/blossom-ci

@cliffburdick
Copy link
Collaborator

/blossom-ci

1 similar comment
@tylera-nvidia
Copy link
Collaborator Author

/blossom-ci

@tylera-nvidia tylera-nvidia removed the request for review from luitjens May 13, 2024 21:36
@tylera-nvidia tylera-nvidia merged commit 480dab7 into main May 13, 2024
1 check passed
@tylera-nvidia tylera-nvidia deleted the addcsqrt branch May 13, 2024 21:43
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.

2 participants