aclopCreateKernel
Description
Creates the kernel function of a dynamic-shape operator for operator execution.
Prototype
aclError aclopCreateKernel(const char *opType,
const char *kernelId,
const char *kernelName,
void *binData,
int binSize,
aclopEngineType enginetype,
aclDataDeallocator deallocator)
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
opType |
Input |
Pointer to the operator type. |
|
kernelId |
Input |
Pointer to the kernel ID. |
|
kernelName |
Input |
Pointer to the operator kernel name, which must be the same as the kernelName argument in the operator binary file. |
|
binData |
Input |
Pointer to the memory address of the operator kernel file. |
|
binSize |
Input |
Memory size (in bytes) of the operator kernel file. |
|
enginetype |
Input |
Operator execution engine. typedef enum aclEngineType {
ACL_ENGINE_SYS, //Set when the execution engine is not concerned.
ACL_ENGINE_AICORE, //Compile the operator into an AI Core operator.
ACL_ENGINE_VECTOR, //Compile the operator into a Vector Core operator.
} aclopEngineType; |
|
deallocator |
Input |
Callback function to free binData memory. The callback function is set based on the construction of binData by the caller. If the data is freed by the caller, leave this parameter empty. The function signature is as follows: typedef void (*aclDataDeallocator)(void *data, size_t length); |
Returns
The value 0 indicates success, and other values indicate failure. For details, see aclError.