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 a way to compare resources #148

Merged
merged 45 commits into from
May 7, 2024
Merged

Add a way to compare resources #148

merged 45 commits into from
May 7, 2024

Conversation

kab163
Copy link
Collaborator

@kab163 kab163 commented Apr 12, 2024

This compare function will compare 2 different resources.

I need this because Umpire would like to add a resource aware pool, but in order to do that we need to know if the resources that are being passed into the pool per allocate call are the same or different. (We handle each case differently.)

  • Double check that my Omp compare is sufficient (see TODO statement)
  • Add Doxygen comments to compare functions
  • Test this with my resource aware pool prototype - this will act as another check to see if the compare function behave as expected.

include/camp/resource.hpp Outdated Show resolved Hide resolved
test/resource.cpp Outdated Show resolved Hide resolved
Co-authored-by: Jason Burmark <MrBurmark@users.noreply.github.com>
trws
trws previously approved these changes Apr 23, 2024
test/resource.cpp Outdated Show resolved Hide resolved
@kab163
Copy link
Collaborator Author

kab163 commented Apr 25, 2024

@trws , @mdavis36 , @rhornung67 - Any ideas how to move forward here? The sycl and windows docker tests are complaining about ambiguous overloads.. I get an error message similar to:

D:\a\1\s\include\camp/resource.hpp(154,1): error C2666: 'camp::resources::v1::operator ==': 3 overloads have similar conversions
could be 'bool camp::resources::v1::operator ==(const camp::resources::v1::Host &,const camp::resources::v1::Host &)' [found using argument-dependent lookup]
or 'bool camp::resources::v1::operator ==<T,0x0>(const T &,const camp::resources::v1::Resource &)'

test/resource.cpp Outdated Show resolved Hide resolved
test/resource.cpp Outdated Show resolved Hide resolved
Copy link
Member

@rhornung67 rhornung67 left a comment

Choose a reason for hiding this comment

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

A couple of comments about comments. Plus, one earlier comment I made (about m_value in == operator comment) still to address. Otherwise, this looks good.

No more comments. 😄

@kab163 kab163 requested review from MrBurmark and trws May 2, 2024 17:25
ASSERT_TRUE(r1 == r1);
ASSERT_TRUE(r2 == r2);
ASSERT_TRUE(s == s);
ASSERT_TRUE(h == h);
Copy link
Member

Choose a reason for hiding this comment

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

This should be above, and there should be a != test.

@trws trws merged commit 38743b6 into main May 7, 2024
14 checks passed
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.

5 participants