aclrtBinaryLoadFromData
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Description
Loads and parses the operator binary data from the memory and outputs the binHandle that points to the operator binary 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
1 | 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. For details about the type definition, see aclrtBinaryLoadOptions. |
binHandle |
Output |
Handle of the operator binary file. For details about the type definition, see aclrtBinHandle. |
Returns
0 on success; otherwise, failure. For details, see aclError.