|
|
|
@ -33,9 +33,9 @@ typedef void (*aclDataDeallocator)(void *data, size_t length);
|
|
|
|
|
static const int ACL_COMPILE_FLAG_BIN_SELECTOR = 1;
|
|
|
|
|
|
|
|
|
|
typedef enum aclEngineType {
|
|
|
|
|
ACL_ENGINE_SYS,
|
|
|
|
|
ACL_ENGINE_AICORE,
|
|
|
|
|
ACL_ENGINE_VECTOR,
|
|
|
|
|
ACL_ENGINE_SYS,
|
|
|
|
|
ACL_ENGINE_AICORE,
|
|
|
|
|
ACL_ENGINE_VECTOR,
|
|
|
|
|
} aclopEngineType;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -148,7 +148,7 @@ ACL_FUNC_VISIBILITY aclError aclopSetAttrString(aclopAttr *attr, const char *att
|
|
|
|
|
* @retval OtherValues Failure
|
|
|
|
|
*/
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopSetAttrListBool(aclopAttr *attr, const char *attrName, int numValues,
|
|
|
|
|
const uint8_t *values);
|
|
|
|
|
const uint8_t *values);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup AscendCL
|
|
|
|
@ -163,7 +163,7 @@ ACL_FUNC_VISIBILITY aclError aclopSetAttrListBool(aclopAttr *attr, const char *a
|
|
|
|
|
* @retval OtherValues Failure
|
|
|
|
|
*/
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopSetAttrListInt(aclopAttr *attr, const char *attrName, int numValues,
|
|
|
|
|
const int64_t *values);
|
|
|
|
|
const int64_t *values);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup AscendCL
|
|
|
|
@ -178,7 +178,7 @@ ACL_FUNC_VISIBILITY aclError aclopSetAttrListInt(aclopAttr *attr, const char *at
|
|
|
|
|
* @retval OtherValues Failure
|
|
|
|
|
*/
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopSetAttrListFloat(aclopAttr *attr, const char *attrName, int numValues,
|
|
|
|
|
const float *values);
|
|
|
|
|
const float *values);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup AscendCL
|
|
|
|
@ -193,7 +193,7 @@ ACL_FUNC_VISIBILITY aclError aclopSetAttrListFloat(aclopAttr *attr, const char *
|
|
|
|
|
* @retval OtherValues Failure
|
|
|
|
|
*/
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopSetAttrListString(aclopAttr *attr, const char *attrName, int numValues,
|
|
|
|
|
const char **values);
|
|
|
|
|
const char **values);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup AscendCL
|
|
|
|
@ -208,11 +208,8 @@ ACL_FUNC_VISIBILITY aclError aclopSetAttrListString(aclopAttr *attr, const char
|
|
|
|
|
* @retval ACL_SUCCESS The function is successfully executed.
|
|
|
|
|
* @retval OtherValues Failure
|
|
|
|
|
*/
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopSetAttrListListInt(aclopAttr *attr,
|
|
|
|
|
const char *attrName,
|
|
|
|
|
int numLists,
|
|
|
|
|
const int *numValues,
|
|
|
|
|
const int64_t *const values[]);
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopSetAttrListListInt(aclopAttr *attr, const char *attrName, int numLists,
|
|
|
|
|
const int *numValues, const int64_t *const values[]);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup AscendCL
|
|
|
|
@ -242,15 +239,10 @@ ACL_FUNC_VISIBILITY aclError aclopSetAttrListListInt(aclopAttr *attr,
|
|
|
|
|
* @retval OtherValues Failure
|
|
|
|
|
*/
|
|
|
|
|
ACL_DEPRECATED_MESSAGE("aclopExecute is deprecated, use aclopExecuteV2 instead")
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopExecute(const char *opType,
|
|
|
|
|
int numInputs,
|
|
|
|
|
const aclTensorDesc *const inputDesc[],
|
|
|
|
|
const aclDataBuffer *const inputs[],
|
|
|
|
|
int numOutputs,
|
|
|
|
|
const aclTensorDesc *const outputDesc[],
|
|
|
|
|
aclDataBuffer *const outputs[],
|
|
|
|
|
const aclopAttr *attr,
|
|
|
|
|
aclrtStream stream);
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopExecute(const char *opType, int numInputs, const aclTensorDesc *const inputDesc[],
|
|
|
|
|
const aclDataBuffer *const inputs[], int numOutputs,
|
|
|
|
|
const aclTensorDesc *const outputDesc[], aclDataBuffer *const outputs[],
|
|
|
|
|
const aclopAttr *attr, aclrtStream stream);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup AscendCL
|
|
|
|
@ -280,15 +272,9 @@ ACL_FUNC_VISIBILITY aclError aclopExecute(const char *opType,
|
|
|
|
|
* @retval ACL_SUCCESS The function is successfully executed.
|
|
|
|
|
* @retval OtherValues Failure
|
|
|
|
|
*/
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopExecuteV2(const char *opType,
|
|
|
|
|
int numInputs,
|
|
|
|
|
aclTensorDesc *inputDesc[],
|
|
|
|
|
aclDataBuffer *inputs[],
|
|
|
|
|
int numOutputs,
|
|
|
|
|
aclTensorDesc *outputDesc[],
|
|
|
|
|
aclDataBuffer *outputs[],
|
|
|
|
|
aclopAttr *attr,
|
|
|
|
|
aclrtStream stream);
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopExecuteV2(const char *opType, int numInputs, aclTensorDesc *inputDesc[],
|
|
|
|
|
aclDataBuffer *inputs[], int numOutputs, aclTensorDesc *outputDesc[],
|
|
|
|
|
aclDataBuffer *outputs[], aclopAttr *attr, aclrtStream stream);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup AscendCL
|
|
|
|
@ -306,12 +292,9 @@ ACL_FUNC_VISIBILITY aclError aclopExecuteV2(const char *opType,
|
|
|
|
|
* @retval ACL_SUCCESS The function is successfully executed.
|
|
|
|
|
* @retval OtherValues Failure
|
|
|
|
|
*/
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopCreateHandle(const char *opType,
|
|
|
|
|
int numInputs,
|
|
|
|
|
const aclTensorDesc *const inputDesc[],
|
|
|
|
|
int numOutputs,
|
|
|
|
|
const aclTensorDesc *const outputDesc[],
|
|
|
|
|
const aclopAttr *opAttr,
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopCreateHandle(const char *opType, int numInputs,
|
|
|
|
|
const aclTensorDesc *const inputDesc[], int numOutputs,
|
|
|
|
|
const aclTensorDesc *const outputDesc[], const aclopAttr *opAttr,
|
|
|
|
|
aclopHandle **handle);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -343,12 +326,9 @@ ACL_FUNC_VISIBILITY void aclopDestroyHandle(aclopHandle *handle);
|
|
|
|
|
*
|
|
|
|
|
* @see aclopCreateHandle | aclCreateDataBuffer
|
|
|
|
|
*/
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopExecWithHandle(aclopHandle *handle,
|
|
|
|
|
int numInputs,
|
|
|
|
|
const aclDataBuffer *const inputs[],
|
|
|
|
|
int numOutputs,
|
|
|
|
|
aclDataBuffer *const outputs[],
|
|
|
|
|
aclrtStream stream);
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopExecWithHandle(aclopHandle *handle, int numInputs,
|
|
|
|
|
const aclDataBuffer *const inputs[], int numOutputs,
|
|
|
|
|
aclDataBuffer *const outputs[], aclrtStream stream);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup AscendCL
|
|
|
|
@ -364,11 +344,8 @@ ACL_FUNC_VISIBILITY aclError aclopExecWithHandle(aclopHandle *handle,
|
|
|
|
|
* @retval ACL_SUCCESS The function is successfully executed.
|
|
|
|
|
* @retval OtherValues Failure
|
|
|
|
|
*/
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopCast(const aclTensorDesc *srcDesc,
|
|
|
|
|
const aclDataBuffer *srcBuffer,
|
|
|
|
|
const aclTensorDesc *dstDesc,
|
|
|
|
|
aclDataBuffer *dstBuffer,
|
|
|
|
|
uint8_t truncate,
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopCast(const aclTensorDesc *srcDesc, const aclDataBuffer *srcBuffer,
|
|
|
|
|
const aclTensorDesc *dstDesc, aclDataBuffer *dstBuffer, uint8_t truncate,
|
|
|
|
|
aclrtStream stream);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -383,12 +360,9 @@ ACL_FUNC_VISIBILITY aclError aclopCast(const aclTensorDesc *srcDesc,
|
|
|
|
|
* @retval ACL_SUCCESS The function is successfully executed.
|
|
|
|
|
* @retval OtherValues Failure
|
|
|
|
|
*/
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopCreateHandleForCast(aclTensorDesc *srcDesc,
|
|
|
|
|
aclTensorDesc *dstDesc,
|
|
|
|
|
uint8_t truncate,
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopCreateHandleForCast(aclTensorDesc *srcDesc, aclTensorDesc *dstDesc, uint8_t truncate,
|
|
|
|
|
aclopHandle **handle);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup AscendCL
|
|
|
|
|
* @brief create kernel
|
|
|
|
@ -407,15 +381,10 @@ ACL_FUNC_VISIBILITY aclError aclopCreateHandleForCast(aclTensorDesc *srcDesc,
|
|
|
|
|
*
|
|
|
|
|
* @see aclopCompile
|
|
|
|
|
*/
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopCreateKernel(const char *opType,
|
|
|
|
|
const char *kernelId,
|
|
|
|
|
const char *kernelName,
|
|
|
|
|
void *binData,
|
|
|
|
|
int binSize,
|
|
|
|
|
aclopEngineType enginetype,
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopCreateKernel(const char *opType, const char *kernelId, const char *kernelName,
|
|
|
|
|
void *binData, int binSize, aclopEngineType enginetype,
|
|
|
|
|
aclDataDeallocator deallocator);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup AscendCL
|
|
|
|
|
* @brief create kernel
|
|
|
|
@ -430,11 +399,8 @@ ACL_FUNC_VISIBILITY aclError aclopCreateKernel(const char *opType,
|
|
|
|
|
* @retval ACL_SUCCESS The function is successfully executed.
|
|
|
|
|
* @retval OtherValues Failure
|
|
|
|
|
*/
|
|
|
|
|
typedef aclError (*aclopCompileFunc)(int numInputs,
|
|
|
|
|
const aclTensorDesc *const inputDesc[],
|
|
|
|
|
int numOutputs,
|
|
|
|
|
const aclTensorDesc *const outputDesc[],
|
|
|
|
|
const aclopAttr *opAttr,
|
|
|
|
|
typedef aclError (*aclopCompileFunc)(int numInputs, const aclTensorDesc *const inputDesc[], int numOutputs,
|
|
|
|
|
const aclTensorDesc *const outputDesc[], const aclopAttr *opAttr,
|
|
|
|
|
aclopKernelDesc *aclopKernelDesc);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -475,11 +441,8 @@ ACL_FUNC_VISIBILITY aclError aclopUnregisterCompileFunc(const char *opType);
|
|
|
|
|
* @retval ACL_SUCCESS The function is successfully executed.
|
|
|
|
|
* @retval OtherValues Failure
|
|
|
|
|
*/
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopSetKernelArgs(aclopKernelDesc *kernelDesc,
|
|
|
|
|
const char *kernelId,
|
|
|
|
|
uint32_t blockDim,
|
|
|
|
|
const void *args,
|
|
|
|
|
uint32_t argSize);
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopSetKernelArgs(aclopKernelDesc *kernelDesc, const char *kernelId, uint32_t blockDim,
|
|
|
|
|
const void *args, uint32_t argSize);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup AscendCL
|
|
|
|
@ -510,12 +473,9 @@ ACL_FUNC_VISIBILITY aclError aclopSetKernelWorkspaceSizes(aclopKernelDesc *kerne
|
|
|
|
|
* @retval ACL_SUCCESS The function is successfully executed.
|
|
|
|
|
* @retval OtherValues Failure
|
|
|
|
|
*/
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopUpdateParams(const char *opType,
|
|
|
|
|
int numInputs,
|
|
|
|
|
const aclTensorDesc *const inputDesc[],
|
|
|
|
|
int numOutputs,
|
|
|
|
|
const aclTensorDesc *const outputDesc[],
|
|
|
|
|
const aclopAttr *attr);
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopUpdateParams(const char *opType, int numInputs,
|
|
|
|
|
const aclTensorDesc *const inputDesc[], int numOutputs,
|
|
|
|
|
const aclTensorDesc *const outputDesc[], const aclopAttr *attr);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup AscendCL
|
|
|
|
@ -533,17 +493,12 @@ ACL_FUNC_VISIBILITY aclError aclopUpdateParams(const char *opType,
|
|
|
|
|
* @retval ACL_SUCCESS The function is successfully executed.
|
|
|
|
|
* @retval OtherValues Failure
|
|
|
|
|
*/
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopInferShape(const char *opType,
|
|
|
|
|
int numInputs,
|
|
|
|
|
aclTensorDesc *inputDesc[],
|
|
|
|
|
aclDataBuffer *inputs[],
|
|
|
|
|
int numOutputs,
|
|
|
|
|
aclTensorDesc *outputDesc[],
|
|
|
|
|
ACL_FUNC_VISIBILITY aclError aclopInferShape(const char *opType, int numInputs, aclTensorDesc *inputDesc[],
|
|
|
|
|
aclDataBuffer *inputs[], int numOutputs, aclTensorDesc *outputDesc[],
|
|
|
|
|
aclopAttr *attr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif // INC_EXTERNAL_ACL_ACL_OP_H_
|
|
|
|
|
#endif // INC_EXTERNAL_ACL_ACL_OP_H_
|
|
|
|
|