File Allocator.h

Defines the public C interface to NVCV resource allocators.

Definition (nvcv_types/include/nvcv/alloc/Allocator.h)

Detailed Description

Allocators objects allow users to override the resource allocation strategy used by several NVCV entities, such as images, operators, etc.

NVCV currently support three resource types:

  • host memory: memory directly accessible by CPU.

  • cuda memory : memory directly accessible by cuda-enabled GPU.

  • host pinned memory: memory directly accessible by both CPU and cuda-enabled GPU.

By default, the following functions are used to allocate and deallocate resourcees for these types.

Resource type Malloc Free

host memory malloc free

cuda memory cudaMalloc cudaFree

host pinned memory cudaHostAlloc cudaHostFree

By using defining custom resource allocators, user can override the allocation and deallocation functions used for each resource type. When overriding, they can pass a pointer to some user-defined context. It’ll be passed unchanged to the corresponding malloc and free function. This allows passing, for instance, a pointer to an object whose methods will be called from inside the overriden functions.

Includes

Included By

Classes

Enums

Functions

Defines

Typedefs

Unions