acldvppMallocWithCfg

Applicability

Product

Supported (Yes/No)

Atlas 350 Accelerator Card

x

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Function Description

Allocates device memory for media processing. The allocated huge page memory meets the data processing requirements (for example, the start address is 128-byte aligned). The restrictions are the same as those of acldvppMalloc. Unlike acldvppMalloc, this API can also specify memory configuration when allocating memory.

Prototype

1
aclError acldvppMallocWithCfg(void **devPtr, size_t size, aclrtMemMallocPolicy policy, aclrtMallocConfig *cfg)

Parameters

Parameter

Input/Output

Description

devPtr

Output

Pointer to the pointer to the allocated device memory

size

Input

Allocated memory size, in bytes.

The size cannot be 0.

policy

Input

Memory allocation policy.

If the configured memory allocation rule exceeds the value range of aclrtMemMallocPolicy and size is greater than or equal to 2 MB, memory is allocated based on huge pages. Otherwise, memory is allocated based on normal pages.

cfg

Input

Memory configuration. For the type definition, see aclrtMallocConfig.

If it is not specified, NULL can be passed.

Returns

0 on success; otherwise, failure. For details, see aclError.