Skip to content
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

[feat] Rotate4D #368

Merged
merged 9 commits into from
Feb 26, 2025
Merged

[feat] Rotate4D #368

merged 9 commits into from
Feb 26, 2025

Conversation

hharryz
Copy link
Contributor

@hharryz hharryz commented Aug 15, 2024

Finish Rotate4D Operation in DIP dialect.

  1. [feat] slightly accelerate rotate2d (rearrange memory layout)
  2. [bugfix] fix the bug of rotate2d (create right way of padding)
  3. [feat] finish rotate4d and do acceleration, now supporting nhwc & nchw format
  4. [feat] add rotate4d example

run commands (in buddy-mlir dir)
$ cd build
$ cmake -G Ninja .. -DBUDDY_EXAMPLES=ON -DBUDDY_ENABLE_OPENCV=ON -DBUDDY_MLIR_ENABLE_DIP_LIB=ON
$ ninja rotation4D
$ cd bin
$ ./rotation4D ../../examples/images/YuTu.png result-dip-rotate.png

Copy link
Member

@zhanghb97 zhanghb97 left a comment

Choose a reason for hiding this comment

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

Giving quick feedback. Please add unit test for your operation and vectorization pass.

testImplementation(argc, argv);

return 0;
}
Copy link
Member

Choose a reason for hiding this comment

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

Please add an empty line here.

@hharryz
Copy link
Contributor Author

hharryz commented Jan 24, 2025

The following function will cause linker failure if the DIP related header files are included multiple times.
an inline notation has to be added to avoid redefinition!
inline void FillPalette(PaletteBlock *palette, int bpp, bool negative = false);

@zhanghb97 zhanghb97 merged commit 1ec1dde into buddy-compiler:main Feb 26, 2025
1 check passed
asdf1113 pushed a commit to asdf1113/buddy-mlir that referenced this pull request Mar 3, 2025
* [feat] accelerate rotate2d, add rotate4d affine part.

* [feat] finish rotate_4d(nhwc and nchw format)

* [modify] add test, fix code format.

* clean up code format using pre-commit

* [fix] force inline in DIP header file to avoid link failure

* [fix] format code with pre-commit
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.

2 participants