forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 77
[Comgr] Add an unpackaging action #668
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
Open
MixedMatched
wants to merge
10
commits into
ROCm:amd-staging
Choose a base branch
from
MixedMatched:comgr-package
base: amd-staging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
cc95df7
[comgr] Initial package support for comgr
MixedMatched 84c1443
comgr-compiler build fixes
MixedMatched 5e286c5
more comgr-compiler build fixes
MixedMatched c545ea6
comgr-compiler build fixes 3
MixedMatched a090bbd
create initial test infrastructure
alsimmon 393b869
add test infrastructure and do a few small fixes
alsimmon ee584d8
fix instances of "bundle" that should be "package"
alsimmon 2682844
fix a few more erroneous instances of "bundle"
alsimmon db128dd
Merge branch 'amd-staging' into comgr-package
MixedMatched 3651b15
add missing break in case statement
alsimmon 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -399,10 +399,14 @@ typedef enum amd_comgr_data_kind_s { | |
| * The data is SPIR-V IR | ||
| */ | ||
| AMD_COMGR_DATA_KIND_SPIRV = 0x15, | ||
| /** | ||
| * The data is an llvm-offload-binary package. | ||
| */ | ||
| AMD_COMGR_DATA_KIND_PACKAGE = 0x16, | ||
| /** | ||
| * Marker for last valid data kind. | ||
| */ | ||
| AMD_COMGR_DATA_KIND_LAST = AMD_COMGR_DATA_KIND_SPIRV | ||
| AMD_COMGR_DATA_KIND_LAST = AMD_COMGR_DATA_KIND_PACKAGE | ||
| } amd_comgr_data_kind_t; | ||
|
|
||
| /** | ||
|
|
@@ -1432,6 +1436,93 @@ amd_comgr_action_info_get_bundle_entry_id( | |
| size_t *size, | ||
| char *bundle_entry_id) AMD_COMGR_VERSION_2_8; | ||
|
|
||
| /** | ||
| * @brief Set the package entry IDs of an action info object. | ||
| * | ||
| * When an action info object is created it has no package entry IDs. Some | ||
| * actions require that the action info object has package entry IDs | ||
| * defined. | ||
| * | ||
| * @param[in] action_info A handle to the action info object to be | ||
| * updated. | ||
| * | ||
| * @param[in] package_entry_ids An array of strings containing one or more | ||
| * package entry ID strings. If NULL then the package entry ID strings are | ||
| * cleared. These IDs are described at | ||
| * | ||
| * | ||
| * @retval ::AMD_COMGR_STATUS_SUCCESS The function has | ||
| * been executed successfully. | ||
| * | ||
| * @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p | ||
| * action_info is an invalid action info object. @p contains an invalid | ||
| * package ID not supported by this version of the code object manager | ||
| * library. | ||
| * | ||
| * @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES | ||
| * Unable to update action info object as out of resources. | ||
| */ | ||
| amd_comgr_status_t AMD_COMGR_API | ||
| amd_comgr_action_info_set_package_entry_ids( | ||
| amd_comgr_action_info_t action_info, | ||
| const char *package_entry_ids[], | ||
| size_t count) AMD_COMGR_VERSION_3_1; | ||
|
|
||
| /** | ||
| * @brief Get number of package entry IDs | ||
| * | ||
| * @param[in] action_info The action info object to query. | ||
| * | ||
| * @param[out] count The number of package entry IDs availible. This value | ||
| * can be used as an upper bound to the Index provided to the corresponding | ||
| * amd_comgr_get_package_entry_id() call. | ||
| * | ||
| * @retval ::AMD_COMGR_STATUS_SUCCESS The function has | ||
| * been executed successfully. | ||
| * | ||
| * @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p | ||
| * action_info is an invalid action info object. @p size is NULL. | ||
| * | ||
| * @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES | ||
| * Unable to update the data object as out of resources. | ||
| */ | ||
| amd_comgr_status_t AMD_COMGR_API | ||
| amd_comgr_action_info_get_package_entry_id_count( | ||
| amd_comgr_action_info_t action_info, | ||
| size_t *count) AMD_COMGR_VERSION_3_1; | ||
|
|
||
| /** | ||
| * @brief Fetch the Nth specific package entry ID or that ID's length. | ||
| * | ||
| * @param[in] action_info The action info object to query. | ||
| * | ||
| * @param[in] index The index of the package entry ID to be returned. | ||
| * | ||
| * @param[in, out] size For out, the size of @p package_entry_id. For in, | ||
| * if @package_entry_id is NULL, set to the size of the Nth ID string including | ||
| * the terminating null character. | ||
| * | ||
| * @param[out] package_entry_id If not NULL, then the first @p size characters of | ||
| * the Nth package entry ID string are copied into @p package_entry_id. If NULL, | ||
| * no package entry ID is copied, and only @p size is updated (useful in order | ||
| * to find the size of the buffer requried to copy the package_entry_id string). | ||
| * | ||
| * @retval ::AMD_COMGR_STATUS_SUCCESS The function has | ||
| * been executed successfully. | ||
| * | ||
| * @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p | ||
| * action_info is an invalid action info object. @p size is NULL. | ||
| * | ||
| * @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES | ||
| * Unable to update the data object as out of resources. | ||
| */ | ||
| amd_comgr_status_t AMD_COMGR_API | ||
| amd_comgr_action_info_get_package_entry_id( | ||
| amd_comgr_action_info_t action_info, | ||
| size_t index, | ||
| size_t *size, | ||
| char *package_entry_id) AMD_COMGR_VERSION_3_1; | ||
|
|
||
| /** | ||
| * @brief Set whether the specified action should use an | ||
| * in-memory virtual file system (VFS). | ||
|
|
@@ -1838,10 +1929,23 @@ typedef enum amd_comgr_action_kind_s { | |
| */ | ||
| AMD_COMGR_ACTION_COMPILE_SOURCE_TO_SPIRV = 0x14, | ||
|
|
||
| /** | ||
| * Unpackage each source data object in @p input. For each successful | ||
| * unpackaging, add a bc object or archive object to @p result, depending on | ||
| * the corresponding input. | ||
| * | ||
| * Return @p AMD_COMGR_STATUS_ERROR if any unpackaging | ||
| * fails. | ||
| * | ||
| * Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT | ||
| * if @p is not a package. | ||
| */ | ||
| AMD_COMGR_ACTION_UNPACKAGE = 0x15, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly here, we could use |
||
|
|
||
| /** | ||
| * Marker for last valid action kind. | ||
| */ | ||
| AMD_COMGR_ACTION_LAST = AMD_COMGR_ACTION_COMPILE_SOURCE_TO_SPIRV | ||
| AMD_COMGR_ACTION_LAST = AMD_COMGR_ACTION_UNPACKAGE | ||
| } amd_comgr_action_kind_t; | ||
|
|
||
| /** | ||
|
|
||
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.
Should we use
0xAwhich is currently unused ? We have a hole from0x9to0x10(decimal9to16). @lamb-jThere 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.
I'm not opposed to backfilling the hole