aclnninit

Function Usage

Initializes aclnn before any aclnn API is called. It is the initialization API of the single-operator API execution framework.

Either aclnnInit or aclInit can be called to initialize aclnn. The difference is that aclnnInit initializes only aclnn, while aclInit initializes aclnn and all sub-functions in AscendCL.

Compared with the aclInit API, aclnnInit is more lightweight.

Constraints

  • This API must be used together with aclnnFinalize.
  • aclnnInit can be called only once per process.

Prototype

aclnnStatus aclnnInit(const char *configPath)

Parameters

Parameter

Input/Output

Description

configPath

Input

Path (including the file name) of the aclnn initialization configuration file. Developers can enable the debugging capability of the aclnn API through this configuration. The default value is NULL.

The configuration file must be in JSON format. For example, if the value of configPath is /home/acl.json, the configuration example of acl.json is as follows:

1
2
3
4
5
{
   "op_debug_config":{
           "enable_debug_kernel":"on",
    }
}

The values of enable_debug_kernel are as follows:

  • on: The debugging capability of the aclnn API is enabled. That is, during operator execution, the system checks whether memory overwriting occurs in the global memory and whether the internal pipeline is synchronized.
  • off: The debugging capability of the aclnn API is disabled. Defaults to off.

Returns

0 on success; else, failure.