Skip to content

OPT: eliminating temp buffer in cascading joins #3145

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 1 commit into from
Jun 22, 2021

Conversation

willyborn
Copy link
Contributor

It is faster to join multiple array's directly into the final buffer, iso using temp buffers with cascading joins
Previous flow:

  • join (array A & array B) into temp buffer
  • join (temp & array C) into final buffer
    New flow:
  • join (array A, array B & array C) into final buffer

Performance improvement for gray2rgb & ycbr2rgb are:

  • vector [16M,1,1,1] --> 1.5x (OCL) & 2.0x (CUDA)
  • vector [1,16M,1,1] --> 1.7x (OCL) & 1.7x (CUDA)
    When combined with PR#3144 (join optimization)
  • vector [16M,1,1,1] --> 4.1x (OCL) & 3.3x (CUDA)
  • vector [1,16M,1,1] --> 59x (OCL) & 75x (CUDA)

Description

Performance improvement for gray2rgb & ycbr2rgb functions.
Less memory consumption, since 1 intermediate buffer is eliminated by this PR, and 3 extra intermediate buffers by PR3144.

Changes to Users

No functional changes.

Checklist

  • [ x ] Rebased on latest master
  • [ x ] Code compiles
  • [ x ] Tests pass
  • Functions added to unified API
  • Functions documented

@9prady9 9prady9 added this to the 3.8.1 milestone Jun 14, 2021
Copy link
Member

@9prady9 9prady9 left a comment

Choose a reason for hiding this comment

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

Change looks simple and good. However, many linux CUDA/OpenCL tests failed. Did all the tests pass for your local build ? @willyborn

It is faster to join multiple array's directly into the final buffer, iso using temp buffers.
Previous flow:
- join (array A & array B) into temp buffer
- join (temp & array C) into final buffer
New flow:
- join (array A, array B & array C) into final buffer
@willyborn
Copy link
Contributor Author

willyborn commented Jun 21, 2021 via email

Copy link
Member

@9prady9 9prady9 left a comment

Choose a reason for hiding this comment

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

@willyborn That is fine. I just wanted to make sure failures aren't related to the change by any chance.

@9prady9 9prady9 merged commit 57082c9 into arrayfire:master Jun 22, 2021
@willyborn willyborn deleted the join-tempBuffer branch September 29, 2022 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants