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

Improve memory allocator #369

Merged
merged 8 commits into from Mar 6, 2019

Conversation

Projects
None yet
2 participants
@TE-TakuyaNarihira
Copy link
Contributor

TE-TakuyaNarihira commented Mar 6, 2019

This PR adds a new memory allocation framework. In this framwrok, memory allocator can be implemented in a device-agnostic way.

TE-TakuyaNarihira added some commits Feb 11, 2019

[C++] Improve Memory Allocator interface and implementation
* Allocator interface
* Memory interface
* CpuMemory implementation
* NaiveCachingAllocator implementation
* CachingAllocatorWithBuckets implementation

tmp remove old memory api

tmp update

tmp succeed building

tmp allocator callback

tmp fix allocator runtime issues

[c++] Prevent 0 size memory

tmp count device memory used

tmp shared_ptr<CachingAllocator>

tmp assert if freeing intermediate poitner

[c++] Add NBLA_API to memory interfaces

tmp NBLA_API fixing

tmp fix NBLA_API

tmp document C++

tmp Rename

CachingAllocator --> Allocator
CachedMemory --> AllocatorMemory
Allocator::get --> alloc
Allocator::get_impl --> alloc_impl
Allocator::cache --> free
Allocator::cache_impl --> free_impl
template <typename MEMORY> --> MemoryType

tmp rename allocator classes

[c++][tmp] Verbose allocator failure

[review] CachedMemory --> AllocatorMemory

[review] proper access level

[review] Use make_shared

[review] Fix typo resiponsible

[review] Comment

[review] Avoid unordered_map lookup

[review] use iterator returned by erase

[review] Use Preincrement

https://stackoverflow.com/questions/1077026/incrementing-iterators-is-it-more-efficient-than-it

[review] safer rounding

[tmp] fix emplace return

[review] static member functions to inline locals

[review] roudning as constexpr

@TE-KazukiYoshiyama TE-KazukiYoshiyama merged commit 523bf53 into master Mar 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.