MallocMem

Applicability

Product

Supported (√/x)

Atlas 350 Accelerator Card

x

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

x

Atlas 200I/500 A2 inference product

x

Atlas inference product

x

Atlas training product

x

Note: For Atlas A2 training product/Atlas A2 inference product, 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.

Example

None

Returns

  • SUCCESS: Success.
  • Other values: Failure.

Restrictions

Only the host memory can be allocated.