MallocMem

Applicability

Product

Supported (√/x)

Ascend 950PR/Ascend 950DT

x

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

x

Atlas 200I/500 A2 inference products

x

Atlas inference products

x

Atlas training products

x

Note: For Atlas A2 training products/Atlas A2 inference products, only the Atlas 800I A2 inference server and A200I A2 Box heterogeneous subrack are supported.

Function Description

Allocates memory.

Prototype

Status MallocMem(MemType type, size_t size, void **ptr);

Parameters

Parameter

Input/Output

Description

type

Input

Memory type.

size

Input

Memory size.

ptr

Output

Pointer to the allocated memory.

Returns

  • SUCCESS: Success.
  • Other values: Failure.

Constraints

Only the host memory can be allocated.