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

void * New (size_t nbytes) override
 
void Delete (void *data) 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 236 of file context_gpu.h.


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