change use_pinned_memory to true for cpu

revert-3824-remove_grad_op_type
liaogang 8 years ago
parent ac02fb82d7
commit 2f7489fbd5

@ -27,7 +27,7 @@ limitations under the License. */
// between host and device. Allocates too much would reduce the amount
// of memory available to the system for paging. So, by default, we
// should set false to use_pinned_memory.
DEFINE_bool(use_pinned_memory, false, "If set, allocate cpu pinned memory.");
DEFINE_bool(use_pinned_memory, true, "If set, allocate cpu pinned memory.");
namespace paddle {
namespace memory {

@ -63,7 +63,7 @@ size_t Used<platform::CPUPlace>(platform::CPUPlace place) {
BuddyAllocator* GetGPUBuddyAllocator(int gpu_id) {
using BuddyAllocVec = std::vector<BuddyAllocator*>;
static std::unique_ptr<BuddyAllocVec, void (*)(BuddyAllocVec * p)> as{
new std::vector<BuddyAllocator*>, [](BuddyAllocVec* p) {
new BuddyAllocVec, [](BuddyAllocVec* p) {
std::for_each(p->begin(), p->end(),
[](BuddyAllocator* p) { delete p; });
}};

Loading…
Cancel
Save