aclrtBinaryLoadOptionType/aclrtBinaryLoadOptionValue

aclrtBinaryLoadOptionType

aclrtBinaryLoadOptionValue

ACL_RT_BINARY_LOAD_OPT_LAZY_LOAD = 1

Whether to load the operator to the device after the operator binary is parsed and the operator is registered.

The values are as follows:

  • 0: Do not load the operator to the device. This is the default value. If ACL_RT_BINARY_LOAD_OPT_LAZY_LOAD is not specified, the system uses the default value.
  • 1: Load the operator to the device. At this time, the system loads the operator only to the device corresponding to the current context. Therefore, when acl.rt.launch_kernel_with_config is called to start the compute task for the operator, the device on which the task is performed must be the same as the device to which the operator is loaded.

ACL_RT_LOAD_BINARY_OPT_MAGIC = 2

Magic number that identifies the operator type. This is not supported currently.

ACL_RT_BINARY_LOAD_OPT_CPU_KERNEL_MODE = 3

AI CPU operator registration mode.

The values are as follows:

  • 0: When the acl.rt.binary_load_from_file API is called to load an operator, the operator information library file (.json) is used to register the operator. In this scenario, the AI CPU operator library file (.so) has been loaded to the device when the acl.rt.set_device API is called. This mode is applicable to the loading of built-in CANN operators.
  • 1: When the acl.rt.binary_load_from_file API is called to load an operator, the operator information library file (.json) is used to register the operator. In this scenario, the acl.rt.binary_load_from_file API searches for the AI CPU operator library file (.so) with the same name as the operator information library file. This mode is applicable to the loading of custom operators.
  • 2: Call the acl.rt.binary_load_from_data API to load an operator and the acl.rt.register_cpu_func API to register AI CPU operator information. This mode is applicable to the scenario where neither the operator information library file nor the operator library file is available.