aclrtBinaryLoadFromData
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Description
Loads and parses the operator binary data from the memory, copies the data to the device corresponding to the current context by default, and outputs the binHandle that points to the data.
When calling this API to load an AI CPU operator (aclrtBinaryLoadOption.type contains ACL_RT_BINARY_LOAD_OPT_CPU_KERNEL_MODE), call aclrtRegisterCpuFunc to register the operator.
The system only loads the operator to the device corresponding to the current context. Therefore, when aclrtLaunchKernelWithConfig 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.
Prototype
aclError aclrtBinaryLoadFromData(const void *data, size_t length, const aclrtBinaryLoadOptions *options, aclrtBinHandle *binHandle)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
data |
Input |
Address of the host memory for storing the operator binary data. The value cannot be null. |
length |
Input |
Memory size of the operator binary data, in bytes. The value must be greater than 0. |
options |
Input |
Optional parameter for loading the operator binary file. |
binHandle |
Output |
Handle of the operator binary file. |
Returns
0 on success; else, failure. For details, see aclError.