Skip to content

Add tests for alignment in OS memory provider #93

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

Conversation

ldorau
Copy link
Contributor

@ldorau ldorau commented Dec 21, 2023

Add tests for alignment in OS memory provider and refactor tests to use gtest's TEST_P().

@ldorau ldorau requested a review from a team as a code owner December 21, 2023 15:21
@ldorau ldorau force-pushed the Add_tests_for_alignment_in_OS_memory_provider branch 5 times, most recently from 1424c1e to c425f01 Compare December 28, 2023 14:39
@ldorau
Copy link
Contributor Author

ldorau commented Dec 28, 2023

Add tests for alignment in OS memory provider and refactor tests to use gtest's TEST_P().

@ldorau ldorau force-pushed the Add_tests_for_alignment_in_OS_memory_provider branch from c425f01 to 9d818ee Compare December 28, 2023 14:45
// wrong NUMA flags
os_memory_provider_params.numa_flags = (unsigned int)-1;
// capture provider and destroy it
auto providerDestructor = [](umf_memory_provider_handle_t hProvider) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: you don't need to create a custom destructor here, you can just pass umfMemoryProviderDestroy directly to unique_ptr ctor, like this: return umf::provider_unique_handle_t(hProvider, &umfMemoryProviderDestroy);

This was needed for poolCreateExt because we wanted to destroy both pool and provider at the same time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

ASSERT_EQ(umf_result, UMF_RESULT_SUCCESS);
ASSERT_NE(os_memory_provider, nullptr);
ASSERT_LE(min_page_size, SIZE_4100);
Copy link
Member

Choose a reason for hiding this comment

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

Why compare with 4100? Should we even have a hardcoded page size here? There can be some systems with different page sizes right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@ldorau
Copy link
Contributor Author

ldorau commented Jan 3, 2024

@igchor review again, please

@ldorau ldorau force-pushed the Add_tests_for_alignment_in_OS_memory_provider branch 2 times, most recently from a8813e9 to b0552b8 Compare January 3, 2024 09:05
Add tests for alignment in OS memory provider
and refactor tests to use gtest's TEST_P().

Signed-off-by: Lukasz Dorau <[email protected]>
@ldorau ldorau force-pushed the Add_tests_for_alignment_in_OS_memory_provider branch from b0552b8 to d611e28 Compare January 3, 2024 10:42
@bratpiorka bratpiorka merged commit a33442e into oneapi-src:main Jan 3, 2024
@ldorau ldorau deleted the Add_tests_for_alignment_in_OS_memory_provider branch January 3, 2024 10:48
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