-
Notifications
You must be signed in to change notification settings - Fork 24
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 memspace filter functions #743
base: main
Are you sure you want to change the base?
Conversation
5bd462c
to
e20ea81
Compare
10880c3
to
fd6a18a
Compare
include/umf/memspace.h
Outdated
umf_result_t umfMemspaceClone(umf_const_memspace_handle_t hMemspace, | ||
umf_memspace_handle_t *hNewMemspace); | ||
|
||
/// \brief custom filter function for umfMemspaceUserFilter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Custom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
include/umf/memspace.h
Outdated
/// \param hMemspace handle to memspace | ||
/// \param hMemtarget handle to memory target | ||
/// \param args - user provided arguments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use dashes -
always or never in all places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
umf_result_t umfMemspaceFilterById(umf_memspace_handle_t hMemspace, | ||
unsigned *ids, size_t size); | ||
|
||
/// \brief Filters out memory targets that capacity is less than specified size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so maybe umfMemspaceFilterByCapacityLT
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't know..... I do not like this LT. Looks to much like assert.
src/libumf.def.in
Outdated
umfMemtargetGetCapacity | ||
umfMemspaceFilterByCapacity | ||
umfMemspaceFilterById | ||
umfMemspaceNew |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
umfMemspaceNew
should be moved after umfMemspaceMemtargetRemove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/libumf.map.in
Outdated
umfMemspaceCreateFromNumaArray; | ||
umfMemspaceDestroy; | ||
umfMemspaceFilterByCapacity; | ||
umfMemspaceFilterById; | ||
umfMemspaceNew; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/memspace.c
Outdated
} | ||
|
||
size_t *targetCapacity = args; | ||
return capacity >= *targetCapacity ? 1 : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe (capacity >= *targetCapacity) ? 1 : 0;
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/memspace.c
Outdated
filter_by_id_args_t args = {ids, size}; | ||
int ret = umfMemspaceFilterHelper(memspace, &filterById, &args); | ||
|
||
// if umfMemspaceFilter() returned negative umf_result change it to positive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
umf_result_t
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
TEST_F(numaNodesCapacityTest, CapacityFilter) { | ||
if (capacities.size() <= 1) { | ||
GTEST_SKIP() << "Not enough numa nodes"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Not enough numa nodes - skipping the test ... "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
test/memspaces/memspace_numa.cpp
Outdated
|
||
TEST_F(numaNodesTest, idfilter) { | ||
if (nodeIds.size() <= 1) { | ||
GTEST_SKIP() << "Not enough numa nodes"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
test/memspaces/memspace_numa.cpp
Outdated
|
||
TEST_F(numaNodesTest, customfilter) { | ||
if (nodeIds.size() <= 1) { | ||
GTEST_SKIP() << "Not enough numa nodes"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Description
Checklist