-
Notifications
You must be signed in to change notification settings - Fork 300
Introduce wrapper library #1071
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 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e5f05e7
Introduce wrapper library
bartekxk f741895
Merge branch 'develop' into barkocot/lwpck-1063-dev
bartekxk c27f88b
Update cmake files
bartekxk 53fdf36
Revert "Update cmake files"
bartekxk 0dc0af2
Fix comments
bartekxk bc367a7
Merge branch 'develop' into barkocot/lwpck-1063-dev
bartekxk 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 |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| add_executable(client_tensor_transform tensor_transform.cpp) | ||
| target_include_directories(client_tensor_transform INTERFACE composable_kernel::wrapper) | ||
| add_executable(client_tensor_transform_using_wrapper tensor_transform_using_wrapper.cpp) | ||
| target_include_directories(client_tensor_transform_using_wrapper INTERFACE composable_kernel::wrapper) |
File renamed without changes.
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
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 |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| =============== | ||
| Wrapper | ||
| =============== | ||
|
|
||
| ------------------------------------- | ||
| Description | ||
| ------------------------------------- | ||
| Note: Wrapper is currently under development. At the moment, its functionality | ||
| is limited. | ||
|
|
||
|
bartekxk marked this conversation as resolved.
Outdated
|
||
| CK provides a lightweight wrapper for more complex operations implemented in | ||
| the library. It allows indexing of nested layouts using a simple interface | ||
| (avoiding complex descriptor transformations). | ||
|
|
||
| Example: | ||
|
|
||
| .. code-block:: c | ||
|
|
||
| const auto shape_4x2x4 = ck::make_tuple(4, ck::make_tuple(2, 4)); | ||
| const auto strides_s2x1x8 = ck::make_tuple(2, ck::make_tuple(1, 8)); | ||
| const auto layout = ck::wrapper::make_layout(shape_4x2x4, strides_s2x1x8); | ||
|
|
||
| std::cout << "dims:4,(2,4) strides:2,(1,8)" << std::endl; | ||
| for(ck::index_t h = 0; h < ck::wrapper::size<0>(layout); h++) | ||
| { | ||
| for(ck::index_t w = 0; w < ck::wrapper::size<1>(layout); w++) | ||
| { | ||
| std::cout << layout(ck::make_tuple(h, w)) << " "; | ||
| } | ||
| std::cout << std::endl; | ||
| } | ||
|
|
||
| Output:: | ||
|
|
||
| dims:4,(2,4) strides:2,(1,8) | ||
| Print2d | ||
|
bartekxk marked this conversation as resolved.
Outdated
|
||
| 0 1 8 9 16 17 24 25 | ||
| 2 3 10 11 18 19 26 27 | ||
| 4 5 12 13 20 21 28 29 | ||
| 6 7 14 15 22 23 30 31 | ||
|
|
||
| ------------------------------------- | ||
| Layout | ||
| ------------------------------------- | ||
|
|
||
| .. doxygenstruct:: ck::wrapper::Layout | ||
|
|
||
| ------------------------------------- | ||
| Layout helpers | ||
| ------------------------------------- | ||
|
|
||
| .. doxygenfile:: layout_utils.hpp | ||
This file was deleted.
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 @@ | ||
| add_subdirectory(wrapper) |
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 |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| add_library(wrapper INTERFACE) | ||
| add_library(composable_kernel::wrapper ALIAS wrapper) | ||
|
|
||
| target_include_directories(wrapper INTERFACE | ||
| $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ck> | ||
| $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ck/utility> | ||
| $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ck/tensor_description> | ||
| $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ck/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.
Uh oh!
There was an error while loading. Please reload this page.