MGfoundation / mgcpp

A C++ Math Library Based on CUDA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Review, improve the allocator interface

Red-Portal opened this issue · comments

Review, improve the allocator interface

  1. Removing get_allocator
    accessing member type variable ::allocator_type should now replace this metafunction.

struct change_allocator_type<Allocator<OldType, DeviceId>,

2. Moving, renaming change_allocator_type
The C++ standard term for something like this is 'rebind'. Should be renamed accordingly.
and it should probably be a member metafunction of default_allocator.
(the C++ standard uses std::allocator_trait as indirection, but it seems to be overkill for our case)

Done