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

Add equalize CPU variant #4742

Merged
merged 4 commits into from
Mar 27, 2023
Merged

Add equalize CPU variant #4742

merged 4 commits into from
Mar 27, 2023

Conversation

stiepan
Copy link
Member

@stiepan stiepan commented Mar 24, 2023

Category:

New feature (non-breaking change which adds functionality)

Description:

The PR adds CPU variant for fn.experimental.equalize operator. It simply wraps opencv call to cv::equalizeHist.

Additional information:

Affected modules and functionalities:

Key points relevant for the review:

Tests:

  • Existing tests apply
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A

Checklist

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: DALI-3264

@stiepan stiepan changed the title Equalize cpu op Add equalize CPU variant Mar 24, 2023
for (int sample_idx = 0; sample_idx < num_samples; sample_idx++) {
tp.AddWork([this, sample_idx, &in_view, &out_view](int) {
RunSample(in_view, out_view, sample_idx);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

use num_elements() of each sample as priority for the task, so that the larger samples are executed first (better thread utilization)

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Comment on lines 77 to 78
void RunSample(TensorListView<StorageCPU, const uint8_t, ndim> &in_view,
TensorListView<StorageCPU, uint8_t, ndim> &out_view, int sample_idx) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: Accept TensorView's instead of TLV, and get rid of sample_idx argument.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Signed-off-by: Kamil Tokarski <ktokarski@nvidia.com>
Signed-off-by: Kamil Tokarski <ktokarski@nvidia.com>
Signed-off-by: Kamil Tokarski <ktokarski@nvidia.com>
Signed-off-by: Kamil Tokarski <ktokarski@nvidia.com>
@stiepan
Copy link
Member Author

stiepan commented Mar 27, 2023

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [7724818]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [7724818]: BUILD PASSED

@stiepan stiepan merged commit e6cd50b into NVIDIA:main Mar 27, 2023
@JanuszL JanuszL mentioned this pull request Sep 6, 2023
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.

4 participants