From 903403b2e1cb4c0259d1324712d228485da3c7d8 Mon Sep 17 00:00:00 2001 From: Yi Wang Date: Sat, 7 Apr 2018 18:25:46 -0700 Subject: [PATCH] Fix errors --- paddle/fluid/memory/detail/memory_block.cc | 2 +- paddle/fluid/memory/detail/memory_block.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/memory/detail/memory_block.cc b/paddle/fluid/memory/detail/memory_block.cc index 79f65f1eb8b..f34b922b25a 100644 --- a/paddle/fluid/memory/detail/memory_block.cc +++ b/paddle/fluid/memory/detail/memory_block.cc @@ -27,7 +27,7 @@ void MemoryBlock::init(MetadataCache* cache, Type t, size_t index, size_t size, static_cast(right_buddy))); } -MemoryBlock::Type MemoryBlock::type(MetadataCache& cache) const { +MemoryBlock::Type MemoryBlock::type(const MetadataCache& cache) const { return cache.load(this).type; } diff --git a/paddle/fluid/memory/detail/memory_block.h b/paddle/fluid/memory/detail/memory_block.h index f0a06577a50..5cceba659be 100644 --- a/paddle/fluid/memory/detail/memory_block.h +++ b/paddle/fluid/memory/detail/memory_block.h @@ -13,7 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include +#include +#include namespace paddle { namespace memory { @@ -37,7 +38,7 @@ struct MemoryBlock { // MemoryBlock::Desc to the beginning of the block; or, if it is a GPU memory // block, the MetadataCache writes the Meatadata to a std::map in // the CPU. - void init(MemoryBlock::DescCache* cache, Type t, size_t index, size_t size, + void init(MetadataCache* cache, Type t, size_t index, size_t size, void* left_buddy, void* right_buddy); // All these accessors returns fields in the MemoryBlock::Desc of the memory -- GitLab