acldvppMallocWithCfg

Applicable Products

Product

Supported

Ascend 950PR / Ascend 950DT

x

Atlas A3 training products / Atlas A3 inference products

√

Atlas A2 training products / Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

√

Atlas inference products

√

Atlas training products

√

Function

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 buffer.

size

Input

Buffer size to allocate, in bytes.

Must not be 0.

policy

Input

Memory allocation policy.

If the configured memory allocation policy is not within the value range of aclrtMemMallocPolicy, and the size is greater than or equal to 2 MB, the huge page memory is allocated; otherwise, the common page memory is allocated.

cfg

Input

Memory configuration. For details, see aclrtMallocConfig.

If no configuration is specified, NULL can be passed.

Returns

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