Skip to content

Conversation

Alexandr-Solovev
Copy link
Contributor

Description


Checklist:

Completeness and readability

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes or created a separate PR with updates and provided its number in the description, if necessary.
  • Git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details).
  • I have resolved any merge conflicts that might occur with the base branch.

Testing

  • I have run it locally and tested the changes extensively.
  • All CI jobs are green or I have provided justification why they aren't.
  • I have extended testing suite if new functionality was introduced in this PR.

Performance

  • I have measured performance for affected algorithms using scikit-learn_bench and provided at least a summary table with measured data, if performance change is expected.
  • I have provided justification why performance and/or quality metrics have changed or why changes are not expected.
  • I have extended the benchmarking suite and provided a corresponding scikit-learn_bench PR if new measurable functionality was introduced in this PR.

@@ -0,0 +1,60 @@
/*******************************************************************************
* Copyright 2021 Intel Corporation
Copy link
Contributor

Choose a reason for hiding this comment

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


ONEDAL_ASSERT(min_observations > 0);
ONEDAL_ASSERT(
min_observations <= BEST_CAP &&
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like it should be a runtime error rather than an assertion that is disabled by default.

const std::int64_t i = idx[0];
const std::int64_t j = idx[1];

if (i <= j) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You could also make the loop over a 1d array only and then get the (i,j) indices from the corresponding 1d index. Would likely parallelize better.

for (int i = 0; i < n; i++)
for (int j = i + 1; j < n; j++)
edges.emplace_back(i, j, data[i * n + j]);
std::sort(edges.begin(), edges.end(), [](auto& a, auto& b) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this execute on GPU? If so, shouldn't it use oneDPL?

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