aclrtCheckMemType

Applicable Products

Product

Supported

Ascend 950PR / Ascend 950DT

√

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

√

Function

Checks the device memory type.

In the Ascend 950PR / Ascend 950DT , there is no separate device memory for DVPP (ACL_RT_MEM_TYPE_DVPP). Instead, there is only common device memory.

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, ACL_RT_MEM_TYPE_DEV | ACL_RT_MEM_TYPE_DVPP.

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).
  • 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; otherwise, failure. For details, see aclError.