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

[onert-micro] Reduce duplicate code in binary kernels #12459

Merged

Conversation

ragmani
Copy link
Contributor

@ragmani ragmani commented Jan 12, 2024

This commit reduces duplicate code in binary kernels.

  • Introduce PALBinaryOpCommon.h that has common functions for binary kernels.
    • Introduce binary function objects.
    • Introduce BinaryOp() that unifies binary kernels without broadcast.
    • Introduce BroadcastBinaryOp4DSlow() that unifies binary kernels with broadcast.
  • Apply common functions for binary kernels.
  • Introduce areShapesEqual() that unifies duplicated codes related to checking shapes.

ONE-DCO-1.0-Signed-off-by: ragmani [email protected]


For #11744

@ragmani ragmani added the PR/ready for review It is ready to review. Please review it. label Jan 12, 2024
@ragmani ragmani force-pushed the onert-micro/Reduce_DC_biaryops branch from 9ada010 to 1976f83 Compare January 12, 2024 11:07
BalyshevArtem
BalyshevArtem previously approved these changes Jan 16, 2024
Copy link
Contributor

@BalyshevArtem BalyshevArtem left a comment

Choose a reason for hiding this comment

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

LGTM, thank you

@ragmani
Copy link
Contributor Author

ragmani commented Jan 16, 2024

PTAL @chunseoklee

chunseoklee
chunseoklee previously approved these changes Jan 17, 2024
This commit reduces duplicate code in binary kernels.
  - Introduce PALBinaryOpCommon.h that has common functions for binary kernels.
    - Introduce binary function objects.
    - Introduce `BinaryOp()` that unifies binary kernels without broadcast.
    - Introduce `BroadcastBinaryOp4DSlow()` that unifies binary kernels with broadcast.
  - Apply common functions for binary kernels.
  - Introduce `areShapesEqual()` that unifies duplicated codes related to checking shapes.

ONE-DCO-1.0-Signed-off-by: ragmani <[email protected]>
@ragmani ragmani dismissed stale reviews from chunseoklee and BalyshevArtem via 88c6e17 January 18, 2024 03:27
@ragmani ragmani force-pushed the onert-micro/Reduce_DC_biaryops branch from 1976f83 to 88c6e17 Compare January 18, 2024 03:27
@ragmani
Copy link
Contributor Author

ragmani commented Jan 18, 2024

Resolved conflict.

@BalyshevArtem BalyshevArtem merged commit 637d7de into Samsung:master Jan 19, 2024
4 checks passed
@ragmani ragmani deleted the onert-micro/Reduce_DC_biaryops branch July 3, 2024 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR/ready for review It is ready to review. Please review it.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants