Skip to content

Use base allocator in memory pool, provider, target and memspace #184

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 Jan 29, 2024

No description provided.

@ldorau ldorau requested a review from a team as a code owner January 29, 2024 12:16
@ldorau ldorau force-pushed the Use_base_allocator_in_memory_pool_provider_and_target branch from cf2bf0c to a1670bd Compare January 29, 2024 12:57
@ldorau ldorau force-pushed the Use_base_allocator_in_memory_pool_provider_and_target branch from a1670bd to 31f3db7 Compare January 29, 2024 15:33
@ldorau ldorau changed the title Use base allocator in memory pool, provider and target Use base allocator in memory pool, provider, target and memspace Jan 29, 2024
@ldorau ldorau force-pushed the Use_base_allocator_in_memory_pool_provider_and_target branch 5 times, most recently from 9d07d72 to f53288e Compare February 1, 2024 12:05
@ldorau
Copy link
Contributor Author

ldorau commented Feb 1, 2024

I will squash the commits when it is approved.


assert(sizeof(umf_memory_pool_t) < SIZE_BA_POOL_CHUNK);

umf_memory_pool_handle_t pool = umf_ba_alloc(BA_pool);
Copy link
Contributor

Choose a reason for hiding this comment

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

How many base allocators will we have after merging this PR? Single? If so we could change this function to accept zero arguments and make it use BA_pool internally.

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

@igchor
Copy link
Member

igchor commented Feb 2, 2024

@ldorau @bratpiorka please see: #203 With those changes we can just use umf__ba_alloc(size) whenever needed and there is no need to create additional pools manually.

@ldorau ldorau force-pushed the Use_base_allocator_in_memory_pool_provider_and_target branch 3 times, most recently from e81f370 to ac9591b Compare February 5, 2024 13:50
// saved pointer to the global base allocator
umf_ba_pool_t *base_allocator;

// saved pointer to the memspace linear base allocator
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you could write here "TODO this is a private copy of linear allocator - optimize this"

Copy link
Contributor Author

@ldorau ldorau Feb 5, 2024

Choose a reason for hiding this comment

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

Removed.
Done.

@ldorau ldorau force-pushed the Use_base_allocator_in_memory_pool_provider_and_target branch from ac9591b to c85b936 Compare February 5, 2024 14:35
@ldorau ldorau force-pushed the Use_base_allocator_in_memory_pool_provider_and_target branch from c85b936 to 7beb87a Compare February 5, 2024 14:42
Copy link
Contributor

@lukaszstolarczuk lukaszstolarczuk left a comment

Choose a reason for hiding this comment

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

👍

@ldorau ldorau requested a review from igchor February 5, 2024 16:19
@ldorau
Copy link
Contributor Author

ldorau commented Feb 5, 2024

@igchor review again, please

@ldorau ldorau merged commit c7cf5ad into oneapi-src:main Feb 5, 2024
@ldorau ldorau deleted the Use_base_allocator_in_memory_pool_provider_and_target branch February 6, 2024 07:18
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