-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fast atan and atan2 functions. #8388
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
Closed
Closed
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
4e99a3e
Fast vectorizable atan and atan2 functions.
mcourteaux 0f00cb1
Default to not using fast atan versions if on CUDA.
mcourteaux 6af7972
Finished fast atan/atan2 functions and tests.
mcourteaux 7cabaa3
Correct attribution.
mcourteaux 2850da3
Clang-format
mcourteaux 4297809
Weird WebAssembly limits...
mcourteaux 18bc63c
Small improvements to the optimization script.
mcourteaux d73177c
Polynomial optimization for log, exp, sin, cos with correct ranges.
mcourteaux a146f57
Improve fast atan performance tests for GPU.
mcourteaux 4814c37
Bugfix fast_atan approximation. Fix correctness test to exceed the ra…
mcourteaux 803a762
Cleanup
mcourteaux 2a9b506
Enum class instead of enum for ApproximationPrecision.
mcourteaux dfb2264
Weird Metal limits. There should be a better way...
mcourteaux 746337b
Skip test for WebGPU.
mcourteaux 614abc2
Fast atan/atan2 polynomials reoptimized. New optimization strategy: ULP.
mcourteaux 5163d78
Feedback Steven.
mcourteaux 091ab5c
More comments and test mantissa error.
mcourteaux 05ecbb6
Do not error when testing arctan performance on Metal / WebGPU.
mcourteaux bc2ed82
Rework precision specification. Generalize towards using this for oth…
mcourteaux 5a5cb27
Clang-format.
mcourteaux 58cb828
Fix makefile and clang-tidy.
mcourteaux 735c431
Fix incorrect approximation selection when required precision is not …
mcourteaux f598106
Feedback from Steven.
mcourteaux 20f9187
Implemented approximation tables for sin, cos, exp, log fast variants…
mcourteaux 05ebf8d
Clang-format.
mcourteaux cf4ef47
Move Polynomial Optimizer Python script to tools/ directory.
mcourteaux 7156130
Enable performance test for fast_atan and fast_atan2.
mcourteaux 302534b
LLVM upper-limit 99 (CMake needs an upper limit).
mcourteaux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| #ifndef HALIDE_APPROXIMATION_TABLES_H | ||
| #define HALIDE_APPROXIMATION_TABLES_H | ||
|
|
||
| #include <vector> | ||
|
|
||
| #include "IROperator.h" | ||
|
|
||
| namespace Halide { | ||
| namespace Internal { | ||
|
|
||
| struct Approximation { | ||
| ApproximationPrecision::OptimizationObjective objective; | ||
| struct Metrics { | ||
| double mse; | ||
| double mae; | ||
| double mulpe; | ||
| } metrics_f32, metrics_f64; | ||
| std::vector<double> coefficients; | ||
| }; | ||
|
|
||
| const Approximation *best_atan_approximation(Halide::ApproximationPrecision precision, Type type); | ||
| const Approximation *best_sin_approximation(Halide::ApproximationPrecision precision, Type type); | ||
| const Approximation *best_cos_approximation(Halide::ApproximationPrecision precision, Type type); | ||
| const Approximation *best_log_approximation(Halide::ApproximationPrecision precision, Type type); | ||
| const Approximation *best_exp_approximation(Halide::ApproximationPrecision precision, Type type); | ||
| const Approximation *best_expm1_approximation(Halide::ApproximationPrecision precision, Type type); | ||
|
|
||
| } // namespace Internal | ||
| } // namespace Halide | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you alter the comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because there are no headers in that list. That comments is clearly outdated. Unless I'm wildly misunderstanding something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcourteaux -- you understand it fine, the comment is out of date. The list of headers is right above.