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

cleaning(simple-kernel-timer): promote find_index to kp_shared.hpp #227

Merged
merged 1 commit into from
Dec 28, 2023

Conversation

romintomasetti
Copy link
Contributor

As suggested by @masterleinad in #225.

@romintomasetti
Copy link
Contributor Author

@masterleinad I have clang-format-14, not 8... So I don't know what changes are required... Do you know how we could make the action show a suggested diff in the action log? Thanks!

@masterleinad
Copy link
Contributor

@masterleinad I have clang-format-14, not 8... So I don't know what changes are required... Do you know how we could make the action show a suggested diff in the action log? Thanks!

See #228.

@romintomasetti
Copy link
Contributor Author

@dalg24 Could you have a look and merge if all is fine for you? Thanks !

Comment on lines 47 to 51
const auto it =
std::find_if(kernels.begin(), kernels.end(), [&](const auto& kernel) {
return strcmp(kernel->getName(), kernelName) == 0;
});
return it == kernels.cend() ? -1 : std::distance(kernels.begin(), it);
Copy link
Member

Choose a reason for hiding this comment

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

I see little benefit from changing the original implementation

Suggested change
const auto it =
std::find_if(kernels.begin(), kernels.end(), [&](const auto& kernel) {
return strcmp(kernel->getName(), kernelName) == 0;
});
return it == kernels.cend() ? -1 : std::distance(kernels.begin(), it);
for (unsigned int i = 0; i < kernels.size(); i++) {
KernelPerformanceInfo* nextKernel = kernels[i];
if (strcmp(nextKernel->getName(), kernelName) == 0) {
return i;
}
}
return -1;

Copy link
Member

Choose a reason for hiding this comment

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

I meant to apply the suggestion and merge but somehow I don't see the option to do so in the GH interface.

@@ -17,8 +17,11 @@
#ifndef _H_KOKKOSP_KERNEL_SHARED
#define _H_KOKKOSP_KERNEL_SHARED

#include <algorithm>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#include <algorithm>

@dalg24 dalg24 merged commit 0becae4 into kokkos:develop Dec 28, 2023
7 checks passed
@romintomasetti romintomasetti deleted the cleanup branch December 28, 2023 14:55
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.

3 participants