Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions
caffe2::PinnedCPUAllocator Struct Referencefinal

An allocator that does the CPU memory allocation with pinned memory. More...

#include <context_gpu.h>

Inheritance diagram for caffe2::PinnedCPUAllocator:
caffe2::CPUAllocator

Public Member Functions

std::pair< void *, MemoryDeleter > New (size_t nbytes) override
 
MemoryDeleter GetDeleter () override
 

Detailed Description

An allocator that does the CPU memory allocation with pinned memory.

This is needed because if we want to do any asynchronous cuda memcpy, the underlying CPU memory also needs to be allocated into pinned memory space. As a result, whenever Caffe2 is built with GPU and there is GPU present during runtime, at global initialization time we will set the CPU memory allocator to allocate pinned memory.

Definition at line 301 of file context_gpu.h.


The documentation for this struct was generated from the following file: