aclopCreateKernel

Applicability

Product

Supported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

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.

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.

Prototype:

typedef void (*aclDataDeallocator)(void *data, size_t length);

Returns

0 on success; else, failure. For details, see aclError.