-
Notifications
You must be signed in to change notification settings - Fork 244
Create a learning path for Function Multiversioning. #1196
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
42 changes: 42 additions & 0 deletions
42
content/learning-paths/smartphones-and-mobile/function-multiversioning/_index.md
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,42 @@ | ||
| --- | ||
| title: Function Multiversioning | ||
|
|
||
| minutes_to_complete: 30 | ||
|
|
||
| who_is_this_for: Developers who want to optimize their C/C++ applications across various Arm64 targets. | ||
|
|
||
| learning_objectives: | ||
| - Take advantage of hardware features for tuning your applications at function level granularity. | ||
| - Create multiple versions of C/C++ functions for the targets you intend to run your applications on. | ||
| - Assist the compiler in generating better code for those targets, or provide your own optimized versions at the source level. | ||
| - Automatically select the most appropriate function version for your host target at runtime. | ||
| - Reuse your optimized application binaries across various targets. | ||
|
|
||
| prerequisites: | ||
| - Basic knowledge of GNU function attributes. Familiarity with indirect functions (ifuncs) is a plus. | ||
| - Basic understanding of loop vectorization. | ||
| - Familiarity with Arm assembly. | ||
| - LLVM 19 compiler with runtime library support or GCC 14. | ||
|
|
||
| author_primary: Arm | ||
|
|
||
| ### Tags | ||
| skilllevels: Intermediate | ||
| subjects: Tuning | ||
| armips: | ||
| - Armv8 | ||
| - Armv9 | ||
| tools_software_languages: | ||
| - C/C++ | ||
| operatingsystems: | ||
| - Linux | ||
| - Android | ||
| - macOS | ||
|
|
||
| # ================================================================================ | ||
| # FIXED, DO NOT MODIFY | ||
| # ================================================================================ | ||
| weight: 1 # _index.md always has weight of 1 to order correctly | ||
| layout: "learningpathall" # All files under learning paths have this same wrapper | ||
| learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content. | ||
| --- |
18 changes: 18 additions & 0 deletions
18
...t/learning-paths/smartphones-and-mobile/function-multiversioning/_next-steps.md
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,18 @@ | ||
| --- | ||
| next_step_guidance: | ||
|
|
||
| recommended_path: /learning-paths/PLACEHOLDER_CATEGORY/PLACEHOLDER_LEARNING_PATH/ | ||
|
|
||
| further_reading: | ||
| - resource: | ||
| title: Arm C Language Extensions | ||
| link: https://arm-software.github.io/acle/main/acle.html | ||
| type: documentation | ||
|
|
||
| # ================================================================================ | ||
| # FIXED, DO NOT MODIFY | ||
| # ================================================================================ | ||
| weight: 21 # set to always be larger than the content in this path, and one more than 'review' | ||
| title: "Next Steps" # Always the same | ||
| layout: "learningpathall" # All files under learning paths have this same wrapper | ||
| --- |
29 changes: 29 additions & 0 deletions
29
content/learning-paths/smartphones-and-mobile/function-multiversioning/_review.md
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,29 @@ | ||
| --- | ||
| review: | ||
| - questions: | ||
| question: > | ||
| What is the main benefit of Function Multiversioning? | ||
| answers: | ||
| - I may reuse my binaries on different targets without sacrificing runtime performance. | ||
| - My application binaries will be smaller in size. | ||
| correct_answer: 1 | ||
| explanation: > | ||
| The produced binaries can be reused on different targets, but they may be larger in size. | ||
|
|
||
| - questions: | ||
| question: > | ||
| Can I implement versions of a function in separate translation units? | ||
| answers: | ||
| - Yes, function versions can spread across different translations units. | ||
| - No, all of them must be in the same translation unit. | ||
| correct_answer: 1 | ||
| explanation: > | ||
| There is no requirement for function versions to be defined in the same translation unit. However, all of them must be declared in the translation unit which contains the definition of the default version. | ||
|
|
||
| # ================================================================================ | ||
| # FIXED, DO NOT MODIFY | ||
| # ================================================================================ | ||
| title: "Review" # Always the same title | ||
| weight: 20 # Set to always be larger than the content in this path | ||
| layout: "learningpathall" # All files under learning paths have this same wrapper | ||
| --- | ||
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.
We did that for clang, but (and I don't know if you care...) did gcc get the same feature?
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.
We do care about GCC, this learning path is for both toolchains. We made this design decision part of ACLE so GCC will have to adhere to it. Adding @andrewcarlotti for more visibility.