From 770cec4e316b0a0b35c85fe263048fe5d1ffcbea Mon Sep 17 00:00:00 2001 From: Yi Wang Date: Sat, 7 Apr 2018 22:33:41 -0700 Subject: [PATCH] Fix compilation errors --- paddle/fluid/memory/detail/buddy_allocator.cc | 2 +- paddle/fluid/memory/malloc.cc | 2 +- paddle/fluid/memory/memory.h | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 paddle/fluid/memory/memory.h diff --git a/paddle/fluid/memory/detail/buddy_allocator.cc b/paddle/fluid/memory/detail/buddy_allocator.cc index d1f0d1755..4194ba197 100644 --- a/paddle/fluid/memory/detail/buddy_allocator.cc +++ b/paddle/fluid/memory/detail/buddy_allocator.cc @@ -195,7 +195,7 @@ BuddyAllocator::PoolSet::iterator BuddyAllocator::RefillPool() { VLOG(10) << "Creating and inserting new block " << p << " from system allocator"; - static_cast(p)->init(cache_, MemoryBlock::FREE_CHUNK, index, + static_cast(p)->init(&cache_, MemoryBlock::FREE_CHUNK, index, max_chunk_size_, nullptr, nullptr); // gpu fallback allocation diff --git a/paddle/fluid/memory/malloc.cc b/paddle/fluid/memory/malloc.cc index 2c13dbc6d..0c74f62de 100644 --- a/paddle/fluid/memory/malloc.cc +++ b/paddle/fluid/memory/malloc.cc @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "paddle/fluid/memory/memory.h" +#include "paddle/fluid/memory/malloc.h" #include "glog/logging.h" diff --git a/paddle/fluid/memory/memory.h b/paddle/fluid/memory/memory.h new file mode 100644 index 000000000..8d904e3be --- /dev/null +++ b/paddle/fluid/memory/memory.h @@ -0,0 +1,18 @@ +/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#pragma once + +#include "paddle/fluid/memory/malloc.h" +#include "paddle/fluid/memory/memcpy.h" -- GitLab