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

Add __*_finite versions of derivatives #1853

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

ivanradanov
Copy link
Collaborator

From my understanding, the __*_finite versions of math functions are either aliases to the normal ones or faster versions that can assume no infinite operands. This automatically generates the same derivatives for them as the normal function.

@wsmoses How do you think we should handle this? Currently it would also generate derivatives for ___nv_asin_finite for example, which doesn't exist.

@ivanradanov ivanradanov requested a review from wsmoses April 28, 2024 04:41
@ivanradanov
Copy link
Collaborator Author

ivanradanov commented Apr 28, 2024

We could either have separate fields for names we want to generate __*_finite versions for, and ones that we don't. Or we could leave it as is and assume people would not define custom functions with names such as ___nv_asin_finite

@wsmoses
Copy link
Member

wsmoses commented Apr 28, 2024

Slightly generalizing, maybe we could add a "suffixof" tablegen command. Specifically since this same dupliaction also is required for cos, cosf, cosl,etc.

So maybe something like here

[(FDiv (DiffeRet), (FMul(Call<(SameTypesFunc<"coshf">), [ReadNone,NoUnwind]> $x):$c, $c))],

but now

SameTypesSuffixFunc<"tanh", "cosh"> which will take the actual name of the function (tanhf), and remplace the prefix tanh with cosh.

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