|
|
@ -24,7 +24,7 @@ limitations under the License. */
|
|
|
|
#include <unordered_map>
|
|
|
|
#include <unordered_map>
|
|
|
|
|
|
|
|
|
|
|
|
inline bool is_aligned(void const *p, const size_t n) {
|
|
|
|
inline bool is_aligned(void const *p, const size_t n) {
|
|
|
|
return 0 == (reinterpret_cast<uintptr_t>(p) % n);
|
|
|
|
return 0 == (reinterpret_cast<uintptr_t>(p) & 0x3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
size_t align(size_t size, paddle::platform::CPUPlace place) {
|
|
|
|
size_t align(size_t size, paddle::platform::CPUPlace place) {
|
|
|
@ -34,8 +34,6 @@ size_t align(size_t size, paddle::platform::CPUPlace place) {
|
|
|
|
return remaining == 0 ? size : size + (alignment - remaining);
|
|
|
|
return remaining == 0 ? size : size + (alignment - remaining);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void update_size(size_t &total_size, const size_t size) {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST(BuddyAllocator, CPUAllocation) {
|
|
|
|
TEST(BuddyAllocator, CPUAllocation) {
|
|
|
|
void *p = nullptr;
|
|
|
|
void *p = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|