MallocAdvise

Applicability

Product

Supported or Not

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

√

Header File

#include <ge/ge_allocator.h>

Function Usage

Allocates device memory in the user memory pool based on the specified size. The recommended memory address is the value of addr.

Prototype

1
virtual MemBlock *MallocAdvise(size_t size, void *addr)

Parameters

Parameter

Input/Output

Description

size

Input

Size of the memory to be allocated.

addr

Input

Recommended address (value of addr) of the memory to be allocated.

Returns

Pointer to MemBlock.

Constraints

Virtual functions need to be implemented by users. If such a function is not implemented, it is equal to Malloc by default.