aclrtMallocAttrValue

typedef union {
    uint16_t moduleId; 
    uint32_t deviceId;  
    uint32_t vaFlag;
    uint8_t rsv[8]; 
} aclrtMallocAttrValue;

Member

Description

moduleId

Module ID. You are advised to set this parameter to 33, indicating the application. In this situation, the memory is allocated by the user application, which facilitates fault locating in maintenance and debugging scenarios.

deviceId

Device ID. If the device ID configured here is different from the device ID used for compute, an error is reported. You are advised not to set this parameter.

vaFlag

Whether to use the virtual address (VA) consistency function when the host memory is allocated by using the aclrtMallocHostWithCfg call.

  • 0 (default value): The function is not used.
  • 1: The function is used. After the host memory is registered by using the aclrtHostRegister call, the returned devPtr is the same as the ptr (indicating the host memory address). The host and device can use the same VA for access.

Only some product models support the VA consistency function. For those not supporting this function, an error is reported when this function is used. The following product models support this function:

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

rsv

Reserved. The value is fixed at 0.