aclrtCheckMemType

Applicability

Product

Supported

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

Description

Checks the device memory type.

Prototype

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.

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.
    #define ACL_RT_MEM_TYPE_RSVD  (0X10U)

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.

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.