提交 21b7915d 编写于 作者: L liaogang

Fix condition compile

上级 365b457a
......@@ -34,13 +34,6 @@ size_t align(size_t size, paddle::platform::CPUPlace place) {
return remaining == 0 ? size : size + (alignment - remaining);
}
size_t align(size_t size, paddle::platform::GPUPlace place) {
size += sizeof(paddle::memory::detail::Metadata);
size_t alignment = paddle::platform::GpuMinChunkSize();
size_t remaining = size % alignment;
return remaining == 0 ? size : size + (alignment - remaining);
}
void update_size(size_t &total_size, const size_t size) {}
TEST(BuddyAllocator, CPUAllocation) {
......@@ -91,6 +84,13 @@ TEST(BuddyAllocator, CPUMultAlloc) {
#ifndef PADDLE_ONLY_CPU
size_t align(size_t size, paddle::platform::GPUPlace place) {
size += sizeof(paddle::memory::detail::Metadata);
size_t alignment = paddle::platform::GpuMinChunkSize();
size_t remaining = size % alignment;
return remaining == 0 ? size : size + (alignment - remaining);
}
TEST(BuddyAllocator, GPUAllocation) {
void *p = nullptr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册