An allocator that does the CPU memory allocation with pinned memory. More...
#include <context_gpu.h>
Public Member Functions | |
void * | New (size_t nbytes) override |
void | Delete (void *data) override |
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 236 of file context_gpu.h.