Function: dvpp_malloc_with_cfg

Applicability

Product

Supported

Ascend 950PR / Ascend 950DT

x

Atlas A3 training products / Atlas A3 inference products

√

Atlas A2 training products / Atlas A2 inference products

√

Atlas training products

√

Atlas inference products

√

Atlas 200I/500 A2 inference products

√

Description

Allocates device memory for media processing. The allocated huge page memory meets the data processing requirements. The usage restrictions of this API are the same as those of the acl.media.dvpp_malloc API. Unlike the acl.media.dvpp_malloc API, this API can also specify memory configuration when allocating memory.

Prototype

  • C Prototype
    1
    aclError acldvppMallocWithCfg(void **devPtr, size_t size, aclrtMemMallocPolicy policy, aclrtMallocConfig *cfg)
    
  • Python Function
    1
    dev_ptr, retacl.media.dvpp_malloc_with_cfg(size, policy, cfg)
    

Parameters

Parameter

Description

size

Int, allocated memory size, in bytes. Must not be 0.

policy

Int, 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

Dict, memory configuration. If no configuration is specified, an empty dictionary can be transferred. For details, see aclrtMallocConfig.

Return Value

Return Value

Description

dev_ptr

Int, pointer address of the allocated device memory.

ret

Int, error code. 0 on success; else, failure.