Skip to content

Add a different implementation of Differentiation #33941

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

Conversation

edymtt
Copy link
Contributor

@edymtt edymtt commented Sep 14, 2020

In the long term, the tgmath derivatives currently implemented in
Differentation will be migrated to a separate overlay.

In anticipation of this, provide an implementation of Differentation
without such functions which is exposed through a feature flag.

Addresses rdar://68471851

In the long term, the tgmath derivatives currently implemented in
Differentation will be migrated to a separate overlay.

In anticipation of this, provide an implementation of Differentation
without such functions which is exposed through a feature flag.

Addresses rdar://68471851
@edymtt
Copy link
Contributor Author

edymtt commented Sep 14, 2020

@swift-ci please smoke test

@rxwei
Copy link
Contributor

rxwei commented Sep 14, 2020

Note for reviewers: Since differentiation is platform-independent, it shouldn't need to depend on platform runtime libraries like Darwin and Glibc. Here we are just adding an option to disable the tgmath parts in the build. One possible future direction is to move tgmath derivatives to a cross-import overlay for Darwin/Glibc and _Differentiation.

@edymtt
Copy link
Contributor Author

edymtt commented Sep 14, 2020

@swift-ci please smoke test

@edymtt
Copy link
Contributor Author

edymtt commented Sep 14, 2020

@swift-ci please test Windows

@edymtt edymtt requested review from rxwei and dan-zheng September 14, 2020 19:46
@edymtt
Copy link
Contributor Author

edymtt commented Sep 14, 2020

In addition to moving the option at the stdlib level, I also took some offline feedback from @gottesmm and moved the new implementation to a separate CMakeLists.txt file -- this should make the diff clearer and the code more readable overall.

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

Thanks!

@edymtt
Copy link
Contributor Author

edymtt commented Sep 15, 2020

@swift-ci please smoke test macOS

1 similar comment
@edymtt
Copy link
Contributor Author

edymtt commented Sep 15, 2020

@swift-ci please smoke test macOS

@@ -0,0 +1,20 @@
set(SOURCES_FOLDER ../Differentiation)
Copy link
Member

Choose a reason for hiding this comment

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

This seems in conflict with the comment in the parent CMakeLists, that this code should not be shared.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is indeed confusing -- my concern was around the CMake code, but the comment is not clear in this regard

I will sit a bit on the PR to see if I can improve the wording and/or the overall readability of the code

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 went ahead and did some rewording -- for the sake of clarify, did that in a new PR, #34116

@edymtt edymtt changed the base branch from master to main September 28, 2020 18:28
@edymtt
Copy link
Contributor Author

edymtt commented Sep 29, 2020

To avoid piling up many commits and to address properly the merge conflicts, close this PR in favor of

#34116

@edymtt edymtt closed this Sep 29, 2020
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.

4 participants