aclrtCheckMemType

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Description

Checks the device memory type.

Prototype

1
aclError aclrtCheckMemType(void** addrList, uint32_t size, uint32_t memType, uint32_t *checkResult, uint32_t reserve)

Parameters

Parameter

Input/Output

Description

addrList

Input

Device memory address array.

size

Input

Size of the addrList array.

memType

Input

Device memory type. If the addrList array contains different types of memory addresses, the value of memType must be set to bitwise OR of the memory types. For example, RT_MEM_MASK_DEV_TYPE | RT_MEM_MASK_DVPP_TYPE.

The following macros are supported:

  • ACL_RT_MEM_TYPE_DVPP: Dedicated device memory for DVPP. The memory can be allocated by calling a memory allocation API (for example, hi_mpi_dvpp_malloc). In Atlas 350 Accelerator Card, there is no separate device memory for DVPP. Instead, there is only common device memory.
  • ACL_RT_MEM_TYPE_RSVD: Virtual memory reserved by calling aclrtReserveMemAddress.

The macros are defined as follows:

#define ACL_RT_MEM_TYPE_DEV   (0X2U)
#define ACL_RT_MEM_TYPE_DVPP  (0X8U)
#define ACL_RT_MEM_TYPE_RSVD  (0X10U)

checkResult

Output

Whether the memory address type in the addrList array matches the value of memType.

  • 1: match
  • 0: not match

reserve

Input

Reserved. The value is fixed at 0.

Returns

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