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 options 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. In this case, the system loads the operator only to the device corresponding to the current context. Therefore, when the acl.rt.launch_kernel_with_config API is called to start an operator computation task, the device where the operator is located must be the same as the device where 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 options are as follows:

  • 0: The acl.rt.binary_load_from_file API is called to load an operator, and the operator information library file (.json) is used to register the operator. In this mode, 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: The acl.rt.binary_load_from_file API is called to load an operator, and the operator information library file (.json) is used to register the operator. In this mode, 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: The acl.rt.binary_load_from_data API is called to load an operator, and the acl.rt.register_cpu_func API is called to register the 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.