提交 d1fbec4f 编写于 作者: M Megvii Engine Team

feat(dnn/atlas): add atlas stub

GitOrigin-RevId: c63294378e49732a7a41b0b6672a070a518c7882
上级 a85531dd
......@@ -507,8 +507,8 @@ endif ()
if(MGE_WITH_ATLAS)
include(cmake/aclrt.cmake)
list(APPEND MGE_ATLAS_LIBS libascendcl)
add_subdirectory(dnn/atlas-stub)
list(APPEND MGE_ATLAS_LIBS atlas-stub)
set(MGE_ATLAS_LIBS "${MGE_ATLAS_LIBS}")
set(MGB_ATLAS ${MGE_WITH_ATLAS})
endif()
......
add_library(atlas-stub STATIC src/libatlas-wrap.cpp)
target_include_directories(atlas-stub PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
install(TARGETS atlas-stub EXPORT ${MGE_EXPORT_TARGETS})
add_library(acl-cblas STATIC src/libacl_cblas-wrap.cpp)
target_include_directories(acl-cblas PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
/**
* @file acl.h
*
* Copyright (C) Huawei Technologies Co., Ltd. 2019-2020. All Rights Reserved.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef INC_EXTERNAL_ACL_ACL_H_
#define INC_EXTERNAL_ACL_ACL_H_
#include "acl_rt.h"
#include "acl_op.h"
#include "acl_mdl.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @ingroup AscendCL
* @brief acl initialize
*
* @par Restriction
* The aclInit interface can be called only once in a process
* @param configPath [IN] the config path,it can be NULL
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclInit(const char *configPath);
/**
* @ingroup AscendCL
* @brief acl finalize
*
* @par Restriction
* Need to call aclFinalize before the process exits.
* After calling aclFinalize,the services cannot continue to be used normally.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclFinalize();
#ifdef __cplusplus
}
#endif
#endif // INC_EXTERNAL_ACL_ACL_H_
/**
* @file acl_base.h
*
* Copyright (C) Huawei Technologies Co., Ltd. 2019-2020. All Rights Reserved.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef INC_EXTERNAL_ACL_ACL_BASE_H_
#define INC_EXTERNAL_ACL_ACL_BASE_H_
#include <stdint.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef FUNC_VISIBILITY
#define ACL_FUNC_VISIBILITY __attribute__((visibility("default")))
#else
#define ACL_FUNC_VISIBILITY
#endif
typedef void *aclrtStream;
typedef void *aclrtEvent;
typedef void *aclrtContext;
typedef int aclError;
typedef uint16_t aclFloat16;
typedef struct aclDataBuffer aclDataBuffer;
typedef struct aclTensorDesc aclTensorDesc;
const int ACL_ERROR_NONE = 0;
const int ACL_ERROR_INVALID_PARAM = 100000;
const int ACL_ERROR_UNINITIALIZE = 100001;
const int ACL_ERROR_REPEAT_INITIALIZE = 100002;
const int ACL_ERROR_INVALID_FILE = 100003;
const int ACL_ERROR_WRITE_FILE = 100004;
const int ACL_ERROR_INVALID_FILE_SIZE = 100005;
const int ACL_ERROR_PARSE_FILE = 100006;
const int ACL_ERROR_FILE_MISSING_ATTR = 100007;
const int ACL_ERROR_FILE_ATTR_INVALID = 100008;
const int ACL_ERROR_INVALID_DUMP_CONFIG = 100009;
const int ACL_ERROR_INVALID_PROFILING_CONFIG = 100010;
const int ACL_ERROR_INVALID_MODEL_ID = 100011;
const int ACL_ERROR_DESERIALIZE_MODEL = 100012;
const int ACL_ERROR_PARSE_MODEL = 100013;
const int ACL_ERROR_READ_MODEL_FAILURE = 100014;
const int ACL_ERROR_MODEL_SIZE_INVALID = 100015;
const int ACL_ERROR_MODEL_MISSING_ATTR = 100016;
const int ACL_ERROR_MODEL_INPUT_NOT_MATCH = 100017;
const int ACL_ERROR_MODEL_OUTPUT_NOT_MATCH = 100018;
const int ACL_ERROR_MODEL_NOT_DYNAMIC = 100019;
const int ACL_ERROR_OP_TYPE_NOT_MATCH = 100020;
const int ACL_ERROR_OP_INPUT_NOT_MATCH = 100021;
const int ACL_ERROR_OP_OUTPUT_NOT_MATCH = 100022;
const int ACL_ERROR_OP_ATTR_NOT_MATCH = 100023;
const int ACL_ERROR_OP_NOT_FOUND = 100024;
const int ACL_ERROR_OP_LOAD_FAILED = 100025;
const int ACL_ERROR_UNSUPPORTED_DATA_TYPE = 100026;
const int ACL_ERROR_FORMAT_NOT_MATCH = 100027;
const int ACL_ERROR_BIN_SELECTOR_NOT_REGISTERED = 100028;
const int ACL_ERROR_KERNEL_NOT_FOUND = 100029;
const int ACL_ERROR_BIN_SELECTOR_ALREADY_REGISTERED = 100030;
const int ACL_ERROR_KERNEL_ALREADY_REGISTERED = 100031;
const int ACL_ERROR_INVALID_QUEUE_ID = 100032;
const int ACL_ERROR_REPEAT_SUBSCRIBE = 100033;
const int ACL_ERROR_STREAM_NOT_SUBSCRIBE = 100034;
const int ACL_ERROR_THREAD_NOT_SUBSCRIBE = 100035;
const int ACL_ERROR_WAIT_CALLBACK_TIMEOUT = 100036;
const int ACL_ERROR_REPEAT_FINALIZE = 100037;
const int ACL_ERROR_NOT_STATIC_AIPP = 100038;
const int ACL_ERROR_BAD_ALLOC = 200000;
const int ACL_ERROR_API_NOT_SUPPORT = 200001;
const int ACL_ERROR_INVALID_DEVICE = 200002;
const int ACL_ERROR_MEMORY_ADDRESS_UNALIGNED = 200003;
const int ACL_ERROR_RESOURCE_NOT_MATCH = 200004;
const int ACL_ERROR_INVALID_RESOURCE_HANDLE = 200005;
const int ACL_ERROR_FEATURE_UNSUPPORTED = 200006;
const int ACL_ERROR_STORAGE_OVER_LIMIT = 300000;
const int ACL_ERROR_INTERNAL_ERROR = 500000;
const int ACL_ERROR_FAILURE = 500001;
const int ACL_ERROR_GE_FAILURE = 500002;
const int ACL_ERROR_RT_FAILURE = 500003;
const int ACL_ERROR_DRV_FAILURE = 500004;
const int ACL_ERROR_PROFILING_FAILURE = 500005;
typedef enum {
ACL_DT_UNDEFINED = -1,
ACL_FLOAT = 0,
ACL_FLOAT16 = 1,
ACL_INT8 = 2,
ACL_INT32 = 3,
ACL_UINT8 = 4,
ACL_INT16 = 6,
ACL_UINT16 = 7,
ACL_UINT32 = 8,
ACL_INT64 = 9,
ACL_UINT64 = 10,
ACL_DOUBLE = 11,
ACL_BOOL = 12,
} aclDataType;
typedef enum {
ACL_FORMAT_UNDEFINED = -1,
ACL_FORMAT_NCHW = 0,
ACL_FORMAT_NHWC = 1,
ACL_FORMAT_ND = 2,
ACL_FORMAT_NC1HWC0 = 3,
ACL_FORMAT_FRACTAL_Z = 4,
ACL_FORMAT_FRACTAL_NZ = 29,
} aclFormat;
typedef enum {
ACL_DEBUG = 0,
ACL_INFO = 1,
ACL_WARNING = 2,
ACL_ERROR = 3,
} aclLogLevel;
/**
* @ingroup AscendCL
* @brief Converts data of type aclFloat16 to data of type float
*
* @param value [IN] Data to be converted
* @retval Transformed data
*/
ACL_FUNC_VISIBILITY float aclFloat16ToFloat(aclFloat16 value);
/**
* @ingroup AscendCL
* @brief Converts data of type float to data of type aclFloat16
*
* @param value [IN] Data to be converted
* @retval Transformed data
*/
ACL_FUNC_VISIBILITY aclFloat16 aclFloatToFloat16(float value);
/**
* @ingroup AscendCL
* @brief create data of aclDataBuffer
*
* @param data [IN] pointer to data
* @li Need to be managed by the user,
* call aclrtMalloc interface to apply for memory,
* call aclrtFree interface to release memory
* @param size [IN] size of data in bytes
* @retval pointer to created instance. nullptr if run out of memory
*
* @see aclrtMalloc | aclrtFree
*/
ACL_FUNC_VISIBILITY aclDataBuffer *aclCreateDataBuffer(void *data, size_t size);
/**
* @ingroup AscendCL
* @brief destroy data of aclDataBuffer
*
* @par Function
* Only the aclDataBuffer type data is destroyed here.
* The memory of the data passed in when the aclDataDataBuffer interface
* is called to create aclDataBuffer type data must be released by the user
* @param dataBuffer [IN] pointer to the aclDataBuffer
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclCreateDataBuffer
*/
ACL_FUNC_VISIBILITY aclError aclDestroyDataBuffer(const aclDataBuffer *dataBuffer);
/**
* @ingroup AscendCL
* @brief get data address from aclDataBuffer
*
* @param dataBuffer [IN] pointer to the data of aclDataBuffer
* @retval data address
*/
ACL_FUNC_VISIBILITY void *aclGetDataBufferAddr(const aclDataBuffer *dataBuffer);
/**
* @ingroup AscendCL
* @brief get data size of aclDataBuffer
*
* @param dataBuffer [IN] pointer to the data of aclDataBuffer
* @retval data size
*/
ACL_FUNC_VISIBILITY uint32_t aclGetDataBufferSize(const aclDataBuffer *dataBuffer);
/**
* @ingroup AscendCL
* @brief get size of aclDataType
*
* @param dataType [IN] aclDataType data the size to get
* @retval size of the aclDataType
*/
ACL_FUNC_VISIBILITY size_t aclDataTypeSize(aclDataType dataType);
// interfaces of tensor desc
/**
* @ingroup AscendCL
* @brief create data aclTensorDesc
*
* @param dataType [IN] Data types described by tensor
* @param numDims [IN] the number of dimensions of the shape
* @param dims [IN] the size of the specified dimension
* @param format [IN] tensor format
* @retval aclTensorDesc pointer.
* @retval nullptr if param is invalid or run out of memory
*/
ACL_FUNC_VISIBILITY aclTensorDesc *aclCreateTensorDesc(aclDataType dataType,
int numDims,
const int64_t *dims,
aclFormat format);
/**
* @ingroup AscendCL
* @brief destroy data aclTensorDesc
*
* @param desc [IN] pointer to the data of aclTensorDesc to destroy
*/
ACL_FUNC_VISIBILITY void aclDestroyTensorDesc(const aclTensorDesc *desc);
/**
* @ingroup AscendCL
* @brief get data type specified by the tensor description
*
* @param desc [IN] pointer to the instance of aclTensorDesc
* @retval data type specified by the tensor description.
* @retval ACL_DT_UNDEFINED if description is null
*/
ACL_FUNC_VISIBILITY aclDataType aclGetTensorDescType(const aclTensorDesc *desc);
/**
* @ingroup AscendCL
* @brief get data format specified by the tensor description
*
* @param desc [IN] pointer to the instance of aclTensorDesc
* @retval data format specified by the tensor description.
* @retval ACL_FORMAT_UNDEFINED if description is null
*/
ACL_FUNC_VISIBILITY aclFormat aclGetTensorDescFormat(const aclTensorDesc *desc);
/**
* @ingroup AscendCL
* @brief get tensor size specified by the tensor description
*
* @param desc [IN] pointer to the instance of aclTensorDesc
* @retval data size specified by the tensor description.
* @retval 0 if description is null
*/
ACL_FUNC_VISIBILITY size_t aclGetTensorDescSize(const aclTensorDesc *desc);
/**
* @ingroup AscendCL
* @brief get element count specified by the tensor description
*
* @param desc [IN] pointer to the instance of aclTensorDesc
* @retval element count specified by the tensor description.
* @retval 0 if description is null
*/
ACL_FUNC_VISIBILITY size_t aclGetTensorDescElementCount(const aclTensorDesc *desc);
/**
* @ingroup AscendCL
* @brief get number of dims specified by the tensor description
*
* @param desc [IN] pointer to the instance of aclTensorDesc
* @retval number of dims specified by the tensor description.
* @retval 0 if description is null
*/
ACL_FUNC_VISIBILITY size_t aclGetTensorDescNumDims(const aclTensorDesc *desc);
/**
* @ingroup AscendCL
* @brief Get the size of the specified dim in the tensor description
*
* @param desc [IN] pointer to the instance of aclTensorDesc
* @param index [IN] index of dims, start from 0.
* @retval dim specified by the tensor description and index.
* @retval -1 if description or index is invalid
*/
ACL_FUNC_VISIBILITY int64_t aclGetTensorDescDim(const aclTensorDesc *desc, size_t index);
/**
* @ingroup AscendCL
* @brief set tensor description name
*
* @param desc [IN] pointer to the instance of aclTensorDesc
* @param name [IN] tensor description name
*/
ACL_FUNC_VISIBILITY void aclSetTensorDescName(aclTensorDesc *desc, const char *name);
/**
* @ingroup AscendCL
* @brief get tensor description name
*
* @param desc [IN] pointer to the instance of aclTensorDesc
* @retval tensor description name.
* @retval empty string if description is null
*/
ACL_FUNC_VISIBILITY const char *aclGetTensorDescName(aclTensorDesc *desc);
/**
* @ingroup AscendCL
* @brief Convert the format in the source aclTensorDesc according to
* the specified dstFormat to generate a new target aclTensorDesc.
* The format in the source aclTensorDesc remains unchanged.
*
* @param srcDesc [IN] pointer to the source tensor desc
* @param dstFormat [IN] destination format
* @param dstDesc [OUT] pointer to the pointer to the destination tensor desc
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclTransTensorDescFormat(const aclTensorDesc *srcDesc, aclFormat dstFormat,
aclTensorDesc **dstDesc);
/**
* @ingroup AscendCL
* @brief Set the storage format specified by the tensor description
*
* @param desc [IN|OUT] pointer to the instance of aclTensorDesc
* @param format [IN] the storage format
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclSetTensorStorageFormat(aclTensorDesc *desc, aclFormat format);
/**
* @ingroup AscendCL
* @brief Set the storage shape specified by the tensor description
*
* @param desc [IN|OUT] pointer to the instance of aclTensorDesc
* @param numDims [IN] the number of dimensions of the shape
* @param dims [IN] the size of the specified dimension
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclSetTensorStorageShape(aclTensorDesc *desc, int numDims, const int64_t *dims);
/**
* @ingroup AscendCL
* @brief an interface for users to output APP logs
*
* @param logLevel [IN] the level of current log
* @param func [IN] the function where the log is located
* @param file [IN] the file where the log is located
* @param line [IN] Number of source lines where the log is located
* @param fmt [IN] the format of current log
* @param ... [IN] the value of current log
*/
ACL_FUNC_VISIBILITY void aclAppLog(aclLogLevel logLevel, const char *func, const char *file, uint32_t line,
const char *fmt, ...);
#define ACL_APP_LOG(level, fmt, ...) \
aclAppLog(level, __FUNCTION__, __FILE__, __LINE__, fmt, ##__VA_ARGS__)
#ifdef __cplusplus
}
#endif
#endif // INC_EXTERNAL_ACL_ACL_BASE_H_
/**
* @file acl_mdl.h
*
* Copyright (C) Huawei Technologies Co., Ltd. 2019-2020. All Rights Reserved.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef INC_EXTERNAL_ACL_ACL_MODEL_H_
#define INC_EXTERNAL_ACL_ACL_MODEL_H_
#include <stddef.h>
#include <stdint.h>
#include "acl_base.h"
#include "acl_rt.h"
#ifdef __cplusplus
extern "C" {
#endif
#define ACL_MAX_DIM_CNT 128
#define ACL_MAX_TENSOR_NAME_LEN 128
#define ACL_MAX_BATCH_NUM 128
#define ACL_MAX_HW_NUM 128
#define ACL_MAX_SHAPE_COUNT 128
#define ACL_DYNAMIC_TENSOR_NAME "ascend_mbatch_shape_data"
#define ACL_DYNAMIC_AIPP_NAME "ascend_dynamic_aipp_data"
typedef struct aclmdlDataset aclmdlDataset;
typedef struct aclmdlDesc aclmdlDesc;
typedef struct aclmdlAIPP aclmdlAIPP;
typedef struct aclAippExtendInfo aclAippExtendInfo;
typedef enum {
ACL_YUV420SP_U8 = 1,
ACL_XRGB8888_U8,
ACL_RGB888_U8,
ACL_YUV400_U8,
ACL_NC1HWC0DI_FP16,
ACL_NC1HWC0DI_S8,
ACL_ARGB8888_U8,
ACL_YUYV_U8,
ACL_YUV422SP_U8,
ACL_AYUV444_U8,
ACL_RAW10,
ACL_RAW12,
ACL_RAW16,
ACL_RAW24,
ACL_AIPP_RESERVED = 0xffff,
} aclAippInputFormat;
typedef struct aclmdlIODims {
char name[ACL_MAX_TENSOR_NAME_LEN]; /**< tensor name */
size_t dimCount; /**< dim array count */
int64_t dims[ACL_MAX_DIM_CNT]; /**< dim data array */
} aclmdlIODims;
typedef struct aclAippDims {
aclmdlIODims srcDims; /**< input dims before model transform */
size_t srcSize; /**< input size before model transform */
aclmdlIODims aippOutdims; /**< aipp output dims */
size_t aippOutSize; /**< aipp output size */
} aclAippDims;
typedef struct aclmdlBatch {
size_t batchCount; /**< batch array count */
uint64_t batch[ACL_MAX_BATCH_NUM]; /**< batch data array */
} aclmdlBatch;
typedef struct aclmdlHW {
size_t hwCount; /**< height&width array count */
uint64_t hw[ACL_MAX_HW_NUM][2]; /**< height&width data array */
} aclmdlHW;
typedef struct aclAippInfo {
aclAippInputFormat inputFormat;
int32_t srcImageSizeW;
int32_t srcImageSizeH;
int8_t cropSwitch;
int32_t loadStartPosW;
int32_t loadStartPosH;
int32_t cropSizeW;
int32_t cropSizeH;
int8_t resizeSwitch;
int32_t resizeOutputW;
int32_t resizeOutputH;
int8_t paddingSwitch;
int32_t leftPaddingSize;
int32_t rightPaddingSize;
int32_t topPaddingSize;
int32_t bottomPaddingSize;
int8_t cscSwitch;
int8_t rbuvSwapSwitch;
int8_t axSwapSwitch;
int8_t singleLineMode;
int32_t matrixR0C0;
int32_t matrixR0C1;
int32_t matrixR0C2;
int32_t matrixR1C0;
int32_t matrixR1C1;
int32_t matrixR1C2;
int32_t matrixR2C0;
int32_t matrixR2C1;
int32_t matrixR2C2;
int32_t outputBias0;
int32_t outputBias1;
int32_t outputBias2;
int32_t inputBias0;
int32_t inputBias1;
int32_t inputBias2;
int32_t meanChn0;
int32_t meanChn1;
int32_t meanChn2;
int32_t meanChn3;
float minChn0;
float minChn1;
float minChn2;
float minChn3;
float varReciChn0;
float varReciChn1;
float varReciChn2;
float varReciChn3;
aclFormat srcFormat;
aclDataType srcDatatype;
size_t srcDimNum;
size_t shapeCount;
aclAippDims outDims[ACL_MAX_SHAPE_COUNT];
aclAippExtendInfo *aippExtend; /**< reserved parameters, current version needs to be null */
} aclAippInfo;
/**
* @ingroup AscendCL
* @brief Create data of type aclmdlDesc
*
* @retval the aclmdlDesc pointer
*/
ACL_FUNC_VISIBILITY aclmdlDesc *aclmdlCreateDesc();
/**
* @ingroup AscendCL
* @brief destroy data of type aclmdlDesc
*
* @param modelDesc [IN] Pointer to almdldlDesc to be destroyed
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlDestroyDesc(aclmdlDesc *modelDesc);
/**
* @ingroup AscendCL
* @brief Get aclmdlDesc data of the model according to the model ID
*
* @param modelDesc [OUT] aclmdlDesc pointer
* @param modelId [IN] model id
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlGetDesc(aclmdlDesc *modelDesc, uint32_t modelId);
/**
* @ingroup AscendCL
* @brief Get the number of the inputs of
* the model according to data of aclmdlDesc
*
* @param modelDesc [IN] aclmdlDesc pointer
* @retval input size with aclmdlDesc
*/
ACL_FUNC_VISIBILITY size_t aclmdlGetNumInputs(aclmdlDesc *modelDesc);
/**
* @ingroup AscendCL
* @brief Get the number of the output of
* the model according to data of aclmdlDesc
*
* @param modelDesc [IN] aclmdlDesc pointer
* @retval output size with aclmdlDesc
*/
ACL_FUNC_VISIBILITY size_t aclmdlGetNumOutputs(aclmdlDesc *modelDesc);
/**
* @ingroup AscendCL
* @brief Get the size of the specified input according to
* the data of type aclmdlDesc
*
* @param modelDesc [IN] aclmdlDesc pointer
* @param index [IN] the size of the number of inputs to be obtained,
* the index value starts from 0
* @retval Specify the size of the input
*/
ACL_FUNC_VISIBILITY size_t aclmdlGetInputSizeByIndex(aclmdlDesc *modelDesc, size_t index);
/**
* @ingroup AscendCL
* @brief Get the size of the specified output according to
* the data of type aclmdlDesc
*
* @param modelDesc [IN] aclmdlDesc pointer
* @param index [IN] the size of the number of outputs to be obtained,
* the index value starts from 0
* @retval Specify the size of the output
*/
ACL_FUNC_VISIBILITY size_t aclmdlGetOutputSizeByIndex(aclmdlDesc *modelDesc, size_t index);
/**
* @ingroup AscendCL
* @brief Create data of type aclmdlDataset
*
* @retval the aclmdlDataset pointer
*/
ACL_FUNC_VISIBILITY aclmdlDataset *aclmdlCreateDataset();
/**
* @ingroup AscendCL
* @brief destroy data of type aclmdlDataset
*
* @param dataset [IN] Pointer to aclmdlDataset to be destroyed
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlDestroyDataset(const aclmdlDataset *dataset);
/**
* @ingroup AscendCL
* @brief Add aclDataBuffer to aclmdlDataset
*
* @param dataset [IN|OUT] aclmdlDataset address of aclDataBuffer to be added
* @param dataBuffer [IN] aclDataBuffer address to be added
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlAddDatasetBuffer(aclmdlDataset *dataset,
aclDataBuffer *dataBuffer);
/**
* @ingroup AscendCL
* @brief Get the number of aclDataBuffer in aclmdlDataset
*
* @param dataset [IN] aclmdlDataset poiter
* @retval the number of aclDataBuffer
*/
ACL_FUNC_VISIBILITY size_t aclmdlGetDatasetNumBuffers(const aclmdlDataset *dataset);
/**
* @ingroup AscendCL
* @brief Get the aclDataBuffer in aclmdlDataset by index
*
* @param dataset [IN] aclmdlDataset poiter
* @param index [IN] the index of aclDataBuffer
* @retval Get successfully, return the address of aclDataBuffer
* @retval Failure return NULL
*/
ACL_FUNC_VISIBILITY aclDataBuffer *aclmdlGetDatasetBuffer(const aclmdlDataset *dataset,
size_t index);
/**
* @ingroup AscendCL
* @brief Load offline model data from files
* and manage memory internally by the system
*
* @par Function
* After the system finishes loading the model,
* the model ID returned is used as a mark to identify the model
* during subsequent operations.
* @param modelPath [IN] Storage path for offline model files
* @param modelId [OUT] Model ID generated after
* the system finishes loading the model
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlLoadFromFile(const char *modelPath, uint32_t *modelId);
/**
* @ingroup AscendCL
* @brief Load offline model data from memory and manage the memory of
* model running internally by the system
*
* @par Function
* After the system finishes loading the model,
* the model ID returned is used as a mark to identify the model
* during subsequent operations
* @param model [IN] Model data stored in memory
* @param modelSize [IN] model data size
* @param modelId [OUT] Model ID generated after
* the system finishes loading the model
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlLoadFromMem(const void *model, size_t modelSize,
uint32_t *modelId);
/**
* @ingroup AscendCL
* @brief Load offline model data from a file,
* and the user manages the memory of the model run by itself
*
* @par Function
* After the system finishes loading the model,
* the model ID returned is used as a mark to identify the model
* during subsequent operations.
* @param modelPath [IN] Storage path for offline model files
* @param modelId [OUT] Model ID generated after finishes loading the model
* @param workPtr [IN] A pointer to the working memory
* required by the model on the Device,can be null
* @param workSize [IN] The amount of working memory required by the model
* @param weightPtr [IN] Pointer to model weight memory on Device
* @param weightSize [IN] The amount of weight memory required by the model
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlLoadFromFileWithMem(const char *modelPath,
uint32_t *modelId, void *workPtr, size_t workSize,
void *weightPtr, size_t weightSize);
/**
* @ingroup AscendCL
* @brief Load offline model data from memory,
* and the user can manage the memory of model running
*
* @par Function
* After the system finishes loading the model,
* the model ID returned is used as a mark to identify the model
* during subsequent operations
* @param model [IN] Model data stored in memory
* @param modelSize [IN] model data size
* @param modelId [OUT] Model ID generated after finishes loading the model
* @param workPtr [IN] A pointer to the working memory
* required by the model on the Device,can be null
* @param workSize [IN] work memory size
* @param weightPtr [IN] Pointer to model weight memory on Device,can be null
* @param weightSize [IN] The amount of weight memory required by the model
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlLoadFromMemWithMem(const void *model, size_t modelSize,
uint32_t *modelId, void *workPtr, size_t workSize,
void *weightPtr, size_t weightSize);
/**
* @ingroup AscendCL
* @brief load model from file with async queue
*
* @param modelPath [IN] model path
* @param modelId [OUT] return model id if load success
* @param inputQ [IN] input queue pointer
* @param inputQNum [IN] input queue num
* @param outputQ [IN] output queue pointer
* @param outputQNum [IN] output queue num
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlLoadFromFileWithQ(const char *modelPath, uint32_t *modelId, const uint32_t *inputQ,
size_t inputQNum, const uint32_t *outputQ, size_t outputQNum);
/**
* @ingroup AscendCL
* @brief load model from memory with async queue
*
* @param model [IN] model memory which user manages
* @param modelSize [IN] model size
* @param modelId [OUT] return model id if load success
* @param inputQ [IN] input queue pointer
* @param inputQNum [IN] input queue num
* @param outputQ [IN] output queue pointer
* @param outputQNum [IN] output queue num
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlLoadFromMemWithQ(const void *model, size_t modelSize, uint32_t *modelId,
const uint32_t *inputQ, size_t inputQNum, const uint32_t *outputQ, size_t outputQNum);
/**
* @ingroup AscendCL
* @brief Execute model synchronous inference until the inference result is returned
*
* @param modelId [IN] ID of the model to perform inference
* @param input [IN] Input data for model inference
* @param output [OUT] Output data for model inference
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlExecute(uint32_t modelId, const aclmdlDataset *input,
aclmdlDataset *output);
/**
* @ingroup AscendCL
* @brief Execute model asynchronous inference until the inference result is returned
*
* @param modelId [IN] ID of the model to perform inference
* @param input [IN] Input data for model inference
* @param output [OUT] Output data for model inference
* @param stream [IN] stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclmdlLoadFromFile | aclmdlLoadFromMem | aclmdlLoadFromFileWithMem |
* aclmdlLoadFromMemWithMem
*/
ACL_FUNC_VISIBILITY aclError aclmdlExecuteAsync(uint32_t modelId, const aclmdlDataset *input,
aclmdlDataset *output, aclrtStream stream);
/**
* @ingroup AscendCL
* @brief unload model with model id
*
* @param modelId [IN] model id to be unloaded
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlUnload(uint32_t modelId);
/**
* @ingroup AscendCL
* @brief Get the weight memory size and working memory size
* required for model execution according to the model file
*
* @param fileName [IN] Model path to get memory information
* @param workSize [OUT] The amount of working memory for model executed
* @param weightSize [OUT] The amount of weight memory for model executed
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlQuerySize(const char *fileName, size_t *workSize, size_t *weightSize);
/**
* @ingroup AscendCL
* @brief Obtain the weights required for
* model execution according to the model data in memory
*
* @par Restriction
* The execution and weight memory is Device memory,
* and requires user application and release.
* @param model [IN] model memory which user manages
* @param modelSize [IN] model data size
* @param workSize [OUT] The amount of working memory for model executed
* @param weightSize [OUT] The amount of weight memory for model executed
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlQuerySizeFromMem(const void *model, size_t modelSize, size_t *workSize,
size_t *weightSize);
/**
* @ingroup AscendCL
* @brief In dynamic batch scenarios,
* it is used to set the number of images processed
* at one time during model inference
*
* @param modelId [IN] model id
* @param dataset [IN] data for model inference
* @param index [IN] index of dynamic tensor
* @param batchSize [IN] Number of images processed at a time during model
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclmdlLoadFromFile | aclmdlLoadFromMem | aclmdlLoadFromFileWithMem |
* aclmdlLoadFromMemWithMem | aclmdlGetInputIndexByName
*/
ACL_FUNC_VISIBILITY aclError aclmdlSetDynamicBatchSize(uint32_t modelId, aclmdlDataset *dataset, size_t index,
uint64_t batchSize);
/**
* @ingroup AscendCL
* @brief Sets the H and W of the specified input of the model
*
* @param modelId [IN] model id
* @param dataset [IN] data for model inference
* @param index [IN] index of dynamic tensor
* @param height [IN] model height
* @param width [IN] model width
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclmdlLoadFromFile | aclmdlLoadFromMem | aclmdlLoadFromFileWithMem |
* aclmdlLoadFromMemWithMem | aclmdlGetInputIndexByName
*/
ACL_FUNC_VISIBILITY aclError aclmdlSetDynamicHWSize(uint32_t modelId, aclmdlDataset *dataset, size_t index,
uint64_t height, uint64_t width);
/**
* @ingroup AscendCL
* @brief get input dims info
*
* @param modelDesc [IN] model description
* @param index [IN] input tensor index
* @param dims [OUT] dims info
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclmdlGetInputDimsV2
*/
ACL_FUNC_VISIBILITY aclError aclmdlGetInputDims(const aclmdlDesc *modelDesc, size_t index, aclmdlIODims *dims);
/**
* @ingroup AscendCL
* @brief get input dims info(version 2), especially for static aipp
* it is the same with aclmdlGetInputDims while model without static aipp
*
* @param modelDesc [IN] model description
* @param index [IN] input tensor index
* @param dims [OUT] dims info
*
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclmdlGetInputDims
*/
ACL_FUNC_VISIBILITY aclError aclmdlGetInputDimsV2(const aclmdlDesc *modelDesc, size_t index, aclmdlIODims *dims);
/**
* @ingroup AscendCL
* @brief get output dims info
*
* @param modelDesc [IN] model description
* @param index [IN] output tensor index
* @param dims [OUT] dims info
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlGetOutputDims(const aclmdlDesc *modelDesc, size_t index, aclmdlIODims *dims);
/**
* @ingroup AscendCL
* @brief get current output dims info
*
* @par Function
* The following use cases are supported:
* @li Get current output shape when model is dynamic and
* dynamic shape info is set
* @li Get max output shape when model is dynamic and
* dynamic shape info is not set
* @li Get actual output shape when model is static
*
* @param modelDesc [IN] model description
* @param index [IN] output tensor index
* @param dims [OUT] dims info
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlGetCurOutputDims(const aclmdlDesc *modelDesc, size_t index, aclmdlIODims *dims);
/**
* @ingroup AscendCL
* @brief get input name by index
*
* @param modelDesc [IN] model description
* @param index [IN] intput tensor index
* @retval input tensor name,the same life cycle with modelDesc
*/
ACL_FUNC_VISIBILITY const char *aclmdlGetInputNameByIndex(const aclmdlDesc *modelDesc, size_t index);
/**
* @ingroup AscendCL
* @brief get output name by index
*
* @param modelDesc [IN] model description
* @param index [IN] output tensor index
* @retval output tensor name,the same life cycle with modelDesc
*/
ACL_FUNC_VISIBILITY const char *aclmdlGetOutputNameByIndex(const aclmdlDesc *modelDesc, size_t index);
/**
* @ingroup AscendCL
* @brief get input format by index
*
* @param modelDesc [IN] model description
* @param index [IN] intput tensor index
* @retval input tensor format
*/
ACL_FUNC_VISIBILITY aclFormat aclmdlGetInputFormat(const aclmdlDesc *modelDesc, size_t index);
/**
* @ingroup AscendCL
* @brief get output format by index
*
* @param modelDesc [IN] model description
* @param index [IN] output tensor index
* @retval output tensor format
*/
ACL_FUNC_VISIBILITY aclFormat aclmdlGetOutputFormat(const aclmdlDesc *modelDesc, size_t index);
/**
* @ingroup AscendCL
* @brief get input data type by index
*
* @param modelDesc [IN] model description
* @param index [IN] intput tensor index
* @retval input tensor data type
*/
ACL_FUNC_VISIBILITY aclDataType aclmdlGetInputDataType(const aclmdlDesc *modelDesc, size_t index);
/**
* @ingroup AscendCL
* @brief get output data type by index
*
* @param modelDesc [IN] model description
* @param index [IN] output tensor index
* @retval output tensor data type
*/
ACL_FUNC_VISIBILITY aclDataType aclmdlGetOutputDataType(const aclmdlDesc *modelDesc, size_t index);
/**
* @ingroup AscendCL
* @brief get input tensor index by name
*
* @param modelDesc [IN] model description
* @param name [IN] intput tensor name
* @param index [OUT] intput tensor index
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlGetInputIndexByName(const aclmdlDesc *modelDesc, const char *name, size_t *index);
/**
* @ingroup AscendCL
* @brief get output tensor index by name
*
* @param modelDesc [IN] model description
* @param name [IN] output tensor name
* @param index [OUT] output tensor index
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlGetOutputIndexByName(const aclmdlDesc *modelDesc, const char *name, size_t *index);
/**
* @ingroup AscendCL
* @brief get dynamic batch info
*
* @param modelDesc [IN] model description
* @param batch [OUT] dynamic batch info
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlGetDynamicBatch(const aclmdlDesc *modelDesc, aclmdlBatch *batch);
/**
* @ingroup AscendCL
* @brief get dynamic height&width info
*
* @param modelDesc [IN] model description
* @param index [IN] input tensor index
* @param hw [OUT] dynamic height&width info
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlGetDynamicHW(const aclmdlDesc *modelDesc, size_t index, aclmdlHW *hw);
/**
* @ingroup AscendCL
* @brief Create data of type aclmdlAIPP
*
* @param batchSize [IN] batchsizes of model
* @retval the aclmdlAIPP pointer
*/
ACL_FUNC_VISIBILITY aclmdlAIPP *aclmdlCreateAIPP(uint64_t batchSize);
/**
* @ingroup AscendCL
* @brief destroy data of type aclmdlAIPP
*
* @param aippParmsSet [IN] Pointer for aclmdlAIPP to be destroyed
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclmdlDestroyAIPP(const aclmdlAIPP *aippParmsSet);
/**
* @ingroup AscendCL
* @brief set InputFormat of type aclmdlAIPP
*
* @param aippParmsSet [IN] Pointer for aclmdlAIPP
* @param inputFormat [IN] The inputFormat of aipp
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclmdlCreateAIPP
*/
ACL_FUNC_VISIBILITY aclError aclmdlSetAIPPInputFormat(aclmdlAIPP *aippParmsSet, aclAippInputFormat inputFormat);
/**
* @ingroup AscendCL
* @brief set cscParms of type aclmdlAIPP
*
* @param aippParmsSet [IN] Pointer for aclmdlAIPP
* @param csc_switch [IN] Csc switch
* @param cscMatrixR0C0 [IN] Csc_matrix_r0_c0
* @param cscMatrixR0C1 [IN] Csc_matrix_r0_c1
* @param cscMatrixR0C2 [IN] Csc_matrix_r0_c2
* @param cscMatrixR1C0 [IN] Csc_matrix_r1_c0
* @param cscMatrixR1C1 [IN] Csc_matrix_r1_c1
* @param cscMatrixR1C2 [IN] Csc_matrix_r1_c2
* @param cscMatrixR2C0 [IN] Csc_matrix_r2_c0
* @param cscMatrixR2C1 [IN] Csc_matrix_r2_c1
* @param cscMatrixR2C2 [IN] Csc_matrix_r2_c2
* @param cscOutputBiasR0 [IN] Output Bias for RGB to YUV, element of row 0, unsigned number
* @param cscOutputBiasR1 [IN] Output Bias for RGB to YUV, element of row 1, unsigned number
* @param cscOutputBiasR2 [IN] Output Bias for RGB to YUV, element of row 2, unsigned number
* @param cscInputBiasR0 [IN] Input Bias for YUV to RGB, element of row 0, unsigned number
* @param cscInputBiasR1 [IN] Input Bias for YUV to RGB, element of row 1, unsigned number
* @param cscInputBiasR2 [IN] Input Bias for YUV to RGB, element of row 2, unsigned number
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclmdlCreateAIPP
*/
ACL_FUNC_VISIBILITY aclError aclmdlSetAIPPCscParams(aclmdlAIPP *aippParmsSet, int8_t csc_switch,
int16_t cscMatrixR0C0, int16_t cscMatrixR0C1, int16_t cscMatrixR0C2,
int16_t cscMatrixR1C0, int16_t cscMatrixR1C1, int16_t cscMatrixR1C2,
int16_t cscMatrixR2C0, int16_t cscMatrixR2C1, int16_t cscMatrixR2C2,
uint8_t cscOutputBiasR0, uint8_t cscOutputBiasR1,
uint8_t cscOutputBiasR2, uint8_t cscInputBiasR0,
uint8_t cscInputBiasR1, uint8_t cscInputBiasR2);
/**
* @ingroup AscendCL
* @brief set rb/ub swap switch of type aclmdlAIPP
*
* @param aippParmsSet [IN] Pointer for aclmdlAIPP
* @param rbuvSwapSwitch [IN] rb/ub swap switch
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclmdlCreateAIPP
*/
ACL_FUNC_VISIBILITY aclError aclmdlSetAIPPRbuvSwapSwitch(aclmdlAIPP *aippParmsSet, int8_t rbuvSwapSwitch);
/**
* @ingroup AscendCL
* @brief set RGBA->ARGB, YUVA->AYUV swap switch of type aclmdlAIPP
*
* @param aippParmsSet [IN] Pointer for aclmdlAIPP
* @param axSwapSwitch [IN] RGBA->ARGB, YUVA->AYUV swap switch
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclmdlCreateAIPP
*/
ACL_FUNC_VISIBILITY aclError aclmdlSetAIPPAxSwapSwitch(aclmdlAIPP *aippParmsSet, int8_t axSwapSwitch);
/**
* @ingroup AscendCL
* @brief set source image of type aclmdlAIPP
*
* @param aippParmsSet [IN] Pointer for aclmdlAIPP
* @param srcImageSizeW [IN] Source image width
* @param srcImageSizeH [IN] Source image height
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclmdlCreateAIPP
*/
ACL_FUNC_VISIBILITY aclError aclmdlSetAIPPSrcImageSize(aclmdlAIPP *aippParmsSet, int32_t srcImageSizeW,
int32_t srcImageSizeH);
/**
* @ingroup AscendCL
* @brief set resize switch of type aclmdlAIPP
*
* @param aippParmsSet [IN] Pointer for aclmdlAIPP
* @param scfSwitch [IN] Resize switch
* @param scfInputSizeW [IN] Input width of scf
* @param scfInputSizeH [IN] Input height of scf
* @param scfOutputSizeW [IN] Output width of scf
* @param scfOutputSizeH [IN] Output height of scf
* @param batchIndex [IN] Batch parameter index
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclmdlCreateAIPP
*/
ACL_FUNC_VISIBILITY aclError aclmdlSetAIPPScfParams(aclmdlAIPP *aippParmsSet,
int8_t scfSwitch,
int32_t scfInputSizeW,
int32_t scfInputSizeH,
int32_t scfOutputSizeW,
int32_t scfOutputSizeH,
uint64_t batchIndex);
/**
* @ingroup AscendCL
* @brief set cropParams of type aclmdlAIPP
*
* @param aippParmsSet [IN] Pointer for aclmdlAIPP
* @param cropSwitch [IN] Crop switch
* @param cropStartPosW [IN] The start horizontal position of cropping
* @param cropStartPosH [IN] The start vertical position of cropping
* @param cropSizeW [IN] Crop width
* @param cropSizeH [IN] Crop height
* @param batchIndex [IN] Batch parameter index
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclmdlCreateAIPP
*/
ACL_FUNC_VISIBILITY aclError aclmdlSetAIPPCropParams(aclmdlAIPP *aippParmsSet,
int8_t cropSwitch,
int32_t cropStartPosW,
int32_t cropStartPosH,
int32_t cropSizeW,
int32_t cropSizeH,
uint64_t batchIndex);
/**
* @ingroup AscendCL
* @brief set paddingParams of type aclmdlAIPP
*
* @param aippParmsSet [IN] Pointer for aclmdlAIPP
* @param paddingSwitch [IN] Padding switch
* @param paddingSizeTop [IN] Top padding size
* @param paddingSizeBottom [IN] Bottom padding size
* @param paddingSizeLeft [IN] Left padding size
* @param paddingSizeRight [IN] Right padding size
* @param batchIndex [IN] Batch parameter index
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclmdlCreateAIPP
*/
ACL_FUNC_VISIBILITY aclError aclmdlSetAIPPPaddingParams(aclmdlAIPP *aippParmsSet, int8_t paddingSwitch,
int32_t paddingSizeTop, int32_t paddingSizeBottom,
int32_t paddingSizeLeft, int32_t paddingSizeRight,
uint64_t batchIndex);
/**
* @ingroup AscendCL
* @brief set DtcPixelMean of type aclmdlAIPP
*
* @param aippParmsSet [IN] Pointer for aclmdlAIPP
* @param dtcPixelMeanChn0 [IN] Mean value of channel 0
* @param dtcPixelMeanChn1 [IN] Mean value of channel 1
* @param dtcPixelMeanChn2 [IN] Mean value of channel 2
* @param dtcPixelMeanChn3 [IN] Mean value of channel 3
* @param batchIndex [IN] Batch parameter index
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclmdlCreateAIPP
*/
ACL_FUNC_VISIBILITY aclError aclmdlSetAIPPDtcPixelMean(aclmdlAIPP *aippParmsSet,
int16_t dtcPixelMeanChn0,
int16_t dtcPixelMeanChn1,
int16_t dtcPixelMeanChn2,
int16_t dtcPixelMeanChn3,
uint64_t batchIndex);
/**
* @ingroup AscendCL
* @brief set DtcPixelMin of type aclmdlAIPP
*
* @param aippParmsSet [IN] Pointer for aclmdlAIPP
* @param dtcPixelMinChn0 [IN] Min value of channel 0
* @param dtcPixelMinChn1 [IN] Min value of channel 1
* @param dtcPixelMinChn2 [IN] Min value of channel 2
* @param dtcPixelMinChn3 [IN] Min value of channel 3
* @param batchIndex [IN] Batch parameter index
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclmdlCreateAIPP
*/
ACL_FUNC_VISIBILITY aclError aclmdlSetAIPPDtcPixelMin(aclmdlAIPP *aippParmsSet,
float dtcPixelMinChn0,
float dtcPixelMinChn1,
float dtcPixelMinChn2,
float dtcPixelMinChn3,
uint64_t batchIndex);
/**
* @ingroup AscendCL
* @brief set PixelVarReci of type aclmdlAIPP
*
* @param aippParmsSet [IN] Pointer for aclmdlAIPP
* @param dtcPixelVarReciChn0 [IN] sfr_dtc_pixel_variance_reci_ch0
* @param dtcPixelVarReciChn1 [IN] sfr_dtc_pixel_variance_reci_ch1
* @param dtcPixelVarReciChn2 [IN] sfr_dtc_pixel_variance_reci_ch2
* @param dtcPixelVarReciChn3 [IN] sfr_dtc_pixel_variance_reci_ch3
* @param batchIndex [IN] Batch parameter index
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclmdlCreateAIPP
*/
ACL_FUNC_VISIBILITY aclError aclmdlSetAIPPPixelVarReci(aclmdlAIPP *aippParmsSet,
float dtcPixelVarReciChn0,
float dtcPixelVarReciChn1,
float dtcPixelVarReciChn2,
float dtcPixelVarReciChn3,
uint64_t batchIndex);
/**
* @ingroup AscendCL
* @brief set aipp parameters to model
*
* @param modelId [IN] model id
* @param dataset [IN] Pointer of dataSize
* @param index [IN] index of dataBuffer
* @param aippParmsSet [IN] Pointer for aclmdlAIPP
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclmdlLoadFromFile | aclmdlLoadFromMem | aclmdlLoadFromFileWithMem |
* aclmdlLoadFromMemWithMem | aclmdlGetInputIndexByName | aclmdlCreateAIPP
*/
ACL_FUNC_VISIBILITY aclError aclmdlSetInputAIPP(uint32_t modelId,
aclmdlDataset *dataset,
size_t index,
const aclmdlAIPP *aippParmsSet);
/**
* @ingroup AscendCL
* @brief get static aipp parameters from model
*
* @param modelId [IN] model id
* @param index [IN] index of tensor
* @param aippinfo [OUT] Pointer for static aipp info
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval ACL_ERROR_MODEL_AIPP_NOT_EXIST The tensor of index is not configured with aipp
* @retval OtherValues Failure
*
* @see aclmdlLoadFromFile | aclmdlLoadFromMem | aclmdlLoadFromFileWithMem |
* aclmdlLoadFromMemWithMem | aclmdlGetInputIndexByName
*/
ACL_FUNC_VISIBILITY aclError aclmdlGetFirstAippInfo(uint32_t modelId, size_t index, aclAippInfo *aippinfo);
#ifdef __cplusplus
}
#endif
#endif // INC_EXTERNAL_ACL_ACL_MODEL_H_
/**
* @file acl_op.h
*
* Copyright (C) Huawei Technologies Co., Ltd. 2019-2020. All Rights Reserved.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef INC_EXTERNAL_ACL_ACL_OP_H_
#define INC_EXTERNAL_ACL_ACL_OP_H_
#include "acl_base.h"
#include "acl_rt.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct aclopHandle aclopHandle;
typedef struct aclopAttr aclopAttr;
typedef struct aclopKernelDesc aclopKernelDesc;
typedef void (*aclDataDeallocator)(void *data, size_t length);
const int ACL_COMPILE_FLAG_BIN_SELECTOR = 1;
typedef enum aclEngineType {
ACL_ENGINE_SYS,
ACL_ENGINE_AICORE,
ACL_ENGINE_VECTOR,
} aclopEngineType;
/**
* @ingroup AscendCL
* @brief Set base directory that contains single op models
*
* @par Restriction
* The aclopSetModelDir interface can be called only once in a process.
* @param modelDir [IN] path of the directory
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetModelDir(const char *modelDir);
/**
* @ingroup AscendCL
* @brief load single op models from memory
*
* @par Restriction
* The aclopLoad interface can be called more than one times in a process.
* @param model [IN] address of single op models
* @param modelSize [IN] size of single op models
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopLoad(const void *model, size_t modelSize);
/**
* @ingroup AscendCL
* @brief create data of type aclopAttr
*
* @retval pointer to created instance.
* @retval nullptr if run out of memory
*/
ACL_FUNC_VISIBILITY aclopAttr *aclopCreateAttr();
/**
* @ingroup AscendCL
* @brief destroy data of typ aclopAttr
*
* @param attr [IN] pointer to the instance of aclopAttr
*/
ACL_FUNC_VISIBILITY void aclopDestroyAttr(const aclopAttr *attr);
/**
* @ingroup AscendCL
* @brief set an attribute. the type of the attribute is bool
*
* @param attr [IN] pointer to the instance of aclopAttr
* @param attrName [IN] attribute name
* @param attrValue [IN] attribute value
* false if attrValue is 0, true otherwise.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetAttrBool(aclopAttr *attr, const char *attrName, uint8_t attrValue);
/**
* @ingroup AscendCL
* @brief set an attribute. the type of the attribute is int64_t
*
* @param attr [IN] pointer to the instance of aclopAttr
* @param attrName [IN] attribute name
* @param attrValue [IN] attribute value
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetAttrInt(aclopAttr *attr, const char *attrName, int64_t attrValue);
/**
* @ingroup AscendCL
* @brief set an attribute. the type of the attribute is float
*
* @param attr [IN] pointer to the instance of aclopAttr
* @param attrName [IN] attribute name
* @param attrValue [IN] attribute value
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetAttrFloat(aclopAttr *attr, const char *attrName, float attrValue);
/**
* @ingroup AscendCL
* @brief set an attribute. the type of the attribute is string
*
* @param attr [IN] pointer to the instance of aclopAttr
* @param attrName [IN] attribute name
* @param attrValue [IN] attribute value
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetAttrString(aclopAttr *attr, const char *attrName, const char *attrValue);
/**
* @ingroup AscendCL
* @brief set an attribute. the type of the attribute is list of bools
*
* @param attr [IN] pointer to the instance of aclopAttr
* @param attrName [IN] attribute name
* @param numValues [IN] number of values. false if attrValue is 0, true otherwise.
* @param values [IN] pointer to values
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetAttrListBool(aclopAttr *attr, const char *attrName, int numValues,
const uint8_t *values);
/**
* @ingroup AscendCL
* @brief set an attribute. the type of the attribute is list of ints
*
* @param attr [IN] pointer to the instance of aclopAttr
* @param attrName [IN] attribute name
* @param numValues [IN] number of values
* @param values [IN] pointer to values
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetAttrListInt(aclopAttr *attr, const char *attrName, int numValues,
const int64_t *values);
/**
* @ingroup AscendCL
* @brief set an attribute. the type of the attribute is list of floats
*
* @param attr [IN] pointer to the instance of aclopAttr
* @param attrName [IN] attribute name
* @param numValues [IN] number of values
* @param values [IN] pointer to values
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetAttrListFloat(aclopAttr *attr, const char *attrName, int numValues,
const float *values);
/**
* @ingroup AscendCL
* @brief set an attribute. the type of the attribute is list of strings
*
* @param attr [IN] pointer to the instance of aclopAttr
* @param attrName [IN] attribute name
* @param numValues [IN] number of values
* @param values [IN] pointer to values
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetAttrListString(aclopAttr *attr, const char *attrName, int numValues,
const char **values);
/**
* @ingroup AscendCL
* @brief set an attribute. the type of the attribute is list of list of ints
*
* @param attr [IN] pointer to the instance of aclopAttr
* @param attrName [IN] attribute name
* @param numLists [IN] number of lists
* @param numValues [IN] pointer to number of values of each list
* @param values [IN] pointer to values
* @retval ACL_ERROR_NONE 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[]);
/**
* @ingroup AscendCL
* @brief Load and execute the specified operator asynchronously
*
* @par Restriction
* @li The input and output organization of each operator is different,
* and the application needs to organize the operator strictly
* according to the operator input and output parameters when calling.
* @li When the user calls aclopExecute,
* the ACL finds the corresponding task according to the optype,
* the description of the input tesnsor,
* the description of the output tesnsor, and attr, and issues the execution.
* @param opType [IN] type of op
* @param numInputs [IN] number of inputs
* @param inputDesc [IN] pointer to array of input tensor descriptions
* @param inputs [IN] pointer to array of input buffers
* @param numOutputs [IN] number of outputs
* @param outputDesc [IN] pointer to array of output tensor descriptions
* @param outputs [OUT] pointer to array of output buffers
* @param attr [IN] pointer to instance of aclopAttr.
* may pass nullptr if the op has no attribute
* @param stream [IN] stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
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
* @brief create a instance of aclopHandle.
*
* @param opType [IN] type of op
* @param numInputs [IN] number of inputs
* @param inputDesc [IN] pointer to array of input tensor descriptions
* @param numOutputs [IN] number of outputs
* @param outputDesc [IN] pointer to array of output tensor descriptions
* @param opAttr [IN] pointer to instance of aclopAttr.
* may pass nullptr if the op has no attribute
* @param handle [OUT] pointer to the pointer to the handle
* @retval ACL_ERROR_NONE 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,
aclopHandle **handle);
/**
* @ingroup AscendCL
* @brief destroy aclopHandle instance
*
* @param handle [IN] pointer to the instance of aclopHandle
*/
ACL_FUNC_VISIBILITY void aclopDestroyHandle(aclopHandle *handle);
/**
* @ingroup AscendCL
* @brief execute an op with the handle.
* can save op model matching cost compared with aclopExecute
*
* @param handle [IN] pointer to the instance of aclopHandle.
* The aclopCreateHandle interface has been called
* in advance to create aclopHandle type data.
* @param numInputs [IN] number of inputs
* @param inputs [IN] pointer to array of input buffers.
* The aclCreateDataBuffer interface has been called
* in advance to create aclDataBuffer type data.
* @param numOutputs [IN] number of outputs
* @param outputs [IN] pointer to array of output buffers
* @param stream [IN] stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclopCreateHandle | aclCreateDataBuffer
*/
ACL_FUNC_VISIBILITY aclError aclopExecWithHandle(aclopHandle *handle,
int numInputs,
const aclDataBuffer *const inputs[],
int numOutputs,
aclDataBuffer *const outputs[],
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief cast data type
*
* @param srcDesc [IN] source tensor desc
* @param srcBuffer [IN] source tensor buffer
* @param dstDesc [IN] destination tensor desc
* @param dstBuffer [OUT] destination tensor buffer
* @param truncate [IN] do not truncate if value is 0, truncate otherwise
* @param stream [IN] stream
* @retval ACL_ERROR_NONE 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,
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief create a handle for casting datatype
*
* @param srcDesc [IN] source tensor desc
* @param dstDesc [IN] destination tensor desc
* @param truncate [IN] do not truncate if value is 0, truncate otherwise
* @param handle [IN] pointer to the pointer to the handle
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopCreateHandleForCast(aclTensorDesc *srcDesc,
aclTensorDesc *dstDesc,
uint8_t truncate,
aclopHandle **handle);
/**
* @ingroup AscendCL
* @brief create kernel
*
* @param opType [IN] op type
* @param kernelId [IN] kernel id
* @param kernelName [IN] kernel name
* @param binData [IN] kernel bin data
* @param binSize [IN] kernel bin size
* @param enginetype [IN] enigne type
* @param deallocator [IN] callback function for deallocating bin data,
* null if bin data to be deallocated by caller
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclopCompile
*/
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
*
* @param numInputs [IN] number of inputs
* @param inputDesc [IN] pointer to array of input tensor descriptions
* @param numOutputs [IN] number of outputs
* @param outputDesc [IN] pointer to array of output tensor descriptions
* @param opAttr [IN] pointer to instance of aclopAttr
* @param aclopKernelDesc [IN] pointer to instance of aclopKernelDesc
* @retval ACL_ERROR_NONE 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,
aclopKernelDesc *aclopKernelDesc);
/**
* @ingroup AscendCL
* @brief register compile function
*
* @param opType [IN] op type
* @param func [IN] compile function
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclopUnregisterCompileFunc
*/
ACL_FUNC_VISIBILITY aclError aclopRegisterCompileFunc(const char *opType, aclopCompileFunc func);
/**
* @ingroup AscendCL
* @brief unregister compile function
*
* @param opType [IN] op type
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopUnregisterCompileFunc(const char *opType);
/**
* @ingroup AscendCL
* @brief set kernel args
*
* @param kernelDesc [IN] pointer to instance of aclopKernelDesc
* @param kernelId [IN] kernel id
* @param blockDim [IN] block dim
* @param args [IN] args
* @param argSize [IN] size in bytes of args
* @retval ACL_ERROR_NONE 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);
/**
* @ingroup AscendCL
* @brief set workspace sizes
*
* @param kernelDesc [IN] pointer to instance of aclopKernelDesc
* @param numWorkspaces [IN] number of workspaces
* @param workspaceSizes [IN] pointer to array of sizes of workspaces
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetKernelWorkspaceSizes(aclopKernelDesc *kernelDesc, int numWorkspaces,
size_t *workspaceSizes);
/**
* @ingroup AscendCL
* @brief compile op with dynamic shape
*
* @param opType [IN] op type
* @param numInputs [IN] number of inputs
* @param inputDesc [IN] pointer to array of input tensor descriptions
* @param numOutputs [IN] number of outputs
* @param outputDesc [IN] pointer to array of output tensor descriptions
* @param attr [IN] pointer to instance of aclopAttr.
* may pass nullptr if the op has no attribute
* @retval ACL_ERROR_NONE 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);
#ifdef __cplusplus
}
#endif
#endif // INC_EXTERNAL_ACL_ACL_OP_H_
/**
* @file acl_rt.h
*
* Copyright (C) Huawei Technologies Co., Ltd. 2019-2020. All Rights Reserved.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef INC_EXTERNAL_ACL_ACL_RT_H_
#define INC_EXTERNAL_ACL_ACL_RT_H_
#include <stdint.h>
#include <stddef.h>
#include "acl_base.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum aclrtRunMode {
ACL_DEVICE,
ACL_HOST,
} aclrtRunMode;
typedef enum aclrtTsId {
ACL_TS_ID_AICORE = 0,
ACL_TS_ID_AIVECTOR = 1,
ACL_TS_ID_RESERVED = 2,
} aclrtTsId;
typedef enum aclrtEventStatus {
ACL_EVENT_STATUS_COMPLETE = 0,
ACL_EVENT_STATUS_NOT_READY = 1,
ACL_EVENT_STATUS_RESERVED = 2,
} aclrtEventStatus;
typedef enum aclrtCallbackBlockType {
ACL_CALLBACK_NO_BLOCK,
ACL_CALLBACK_BLOCK,
} aclrtCallbackBlockType;
typedef enum aclrtMemcpyKind {
ACL_MEMCPY_HOST_TO_HOST,
ACL_MEMCPY_HOST_TO_DEVICE,
ACL_MEMCPY_DEVICE_TO_HOST,
ACL_MEMCPY_DEVICE_TO_DEVICE,
} aclrtMemcpyKind;
typedef enum aclrtMemMallocPolicy {
ACL_MEM_MALLOC_HUGE_FIRST,
ACL_MEM_MALLOC_HUGE_ONLY,
ACL_MEM_MALLOC_NORMAL_ONLY,
} aclrtMemMallocPolicy;
typedef struct rtExceptionInfo aclrtExceptionInfo;
typedef void (*aclrtCallback)(void *userData);
typedef void (*aclrtExceptionInfoCallback)(aclrtExceptionInfo *exceptionInfo);
/**
* @ingroup AscendCL
* @brief Set a callback function to handle exception information
*
* @param callback [IN] callback function to handle exception information
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtSetExceptionInfoCallback(aclrtExceptionInfoCallback callback);
/**
* @ingroup AscendCL
* @brief Get task id from exception information
*
* @param info [IN] pointer of exception information
* @retval The task id from exception information
* @retval 0xFFFFFFFF if info is null
*/
ACL_FUNC_VISIBILITY uint32_t aclrtGetTaskIdFromExceptionInfo(const aclrtExceptionInfo *info);
/**
* @ingroup AscendCL
* @brief Get stream id from exception information
*
* @param info [IN] pointer of exception information
* @retval The stream id from exception information
* @retval 0xFFFFFFFF if info is null
*/
ACL_FUNC_VISIBILITY uint32_t aclrtGetStreamIdFromExceptionInfo(const aclrtExceptionInfo *info);
/**
* @ingroup AscendCL
* @brief Get thread id from exception information
*
* @param info [IN] pointer of exception information
* @retval The thread id of fail task
* @retval 0xFFFFFFFF if info is null
*/
ACL_FUNC_VISIBILITY uint32_t aclrtGetThreadIdFromExceptionInfo(const aclrtExceptionInfo *info);
/**
* @ingroup AscendCL
* @brief The thread that handles the callback function on the Stream
*
* @param threadId [IN] thread ID
* @param stream [IN] stream handle
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtSubscribeReport(uint64_t threadId, aclrtStream stream);
/**
* @ingroup AscendCL
* @brief Add a callback function to be executed on the host
* to the task queue of the Stream
*
* @param fn [IN] Specify the callback function to be added
* The function prototype of the callback function is:
* typedef void (*aclrtCallback)(void *userData);
* @param userData [IN] User data to be passed to the callback function
* @param blockType [IN] callback block type
* @param stream [IN] stream handle
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtLaunchCallback(aclrtCallback fn, void *userData, aclrtCallbackBlockType blockType,
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief After waiting for a specified time, trigger callback processing
*
* @par Function
* The thread processing callback specified by
* the aclrtSubscribeReport interface
* @param timeout [IN] timeout value
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclrtSubscribeReport
*/
ACL_FUNC_VISIBILITY aclError aclrtProcessReport(int32_t timeout);
/**
* @ingroup AscendCL
* @brief Cancel thread registration,
* the callback function on the specified Stream
* is no longer processed by the specified thread
*
* @param threadId [IN] thread ID
* @param stream [IN] stream handle
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtUnSubscribeReport(uint64_t threadId, aclrtStream stream);
/**
* @ingroup AscendCL
* @brief create context and associates it with the calling thread
*
* @par Function
* The following use cases are supported:
* @li If you don't call the aclrtCreateContext interface
* to explicitly create the context,
* the system will use the default context, which is implicitly created
* when the aclrtSetDevice interface is called.
* @li If multiple contexts are created in a process
* (there is no limit on the number of contexts),
* the current thread can only use one of them at the same time.
* It is recommended to explicitly specify the context of the current thread
* through the aclrtSetCurrentContext interface to increase.
* the maintainability of the program.
* @param context [OUT] point to the created context
* @param deviceId [IN] device to create context on
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclrtSetDevice | aclrtSetCurrentContext
*/
ACL_FUNC_VISIBILITY aclError aclrtCreateContext(aclrtContext *context, int32_t deviceId);
/**
* @ingroup AscendCL
* @brief destroy context instance
*
* @par Function
* Can only destroy context created through aclrtCreateContext interface
* @param context [IN] the context to destroy
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclrtCreateContext
*/
ACL_FUNC_VISIBILITY aclError aclrtDestroyContext(aclrtContext context);
/**
* @ingroup AscendCL
* @brief set the context of the thread
*
* @par Function
* The following scenarios are supported:
* @li If the aclrtCreateContext interface is called in a thread to explicitly
* create a Context (for example: ctx1), the thread's Context can be specified
* without calling the aclrtSetCurrentContext interface.
* The system uses ctx1 as the context of thread1 by default.
* @li If the aclrtCreateContext interface is not explicitly created,
* the system uses the default context as the context of the thread.
* At this time, the aclrtDestroyContext interface cannot be used to release
* the default context.
* @li If the aclrtSetCurrentContext interface is called multiple times to
* set the thread's Context, the last one prevails.
*
* @par Restriction
* @li If the cevice corresponding to the context set for the thread
* has been reset, you cannot set the context as the context of the thread,
* otherwise a business exception will result.
* @li It is recommended to use the context created in a thread.
* If the aclrtCreateContext interface is called in thread A to create a context,
* and the context is used in thread B,
* the user must guarantee the execution order of tasks in the same stream
* under the same context in two threads.
* @param context [IN] the current context of the thread
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclrtCreateContext | aclrtDestroyContext
*/
ACL_FUNC_VISIBILITY aclError aclrtSetCurrentContext(aclrtContext context);
/**
* @ingroup AscendCL
* @brief get the context of the thread
*
* @par Function
* If the user calls the aclrtSetCurrentContext interface
* multiple times to set the context of the current thread,
* then the last set context is obtained
* @param context [OUT] the current context of the thread
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclrtSetCurrentContext
*/
ACL_FUNC_VISIBILITY aclError aclrtGetCurrentContext(aclrtContext *context);
/**
* @ingroup AscendCL
* @brief Specify the device to use for the operation
* implicitly create the default context and the default stream
*
* @par Function
* The following use cases are supported:
* @li Device can be specified in the process or thread.
* If you call the aclrtSetDevice interface multiple
* times to specify the same device,
* you only need to call the aclrtResetDevice interface to reset the device.
* @li The same device can be specified for operation
* in different processes or threads.
* @li Device is specified in a process,
* and multiple threads in the process can share this device to explicitly
* create a Context (aclrtCreateContext interface).
* @li In multi-device scenarios, you can switch to other devices
* through the aclrtSetDevice interface in the process.
* @param deviceId [IN] the device id
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclrtResetDevice |aclrtCreateContext
*/
ACL_FUNC_VISIBILITY aclError aclrtSetDevice(int32_t deviceId);
/**
* @ingroup AscendCL
* @brief Reset the current operating Device and free resources on the device,
* including the default context, the default stream,
* and all streams created under the default context,
* and synchronizes the interface.
* If the task under the default context or stream has not been completed,
* the system will wait for the task to complete before releasing it.
*
* @par Restriction
* @li The Context, Stream, and Event that are explicitly created
* on the device to be reset. Before resetting,
* it is recommended to follow the following interface calling sequence,
* otherwise business abnormalities may be caused.
* @li Interface calling sequence:
* call aclrtDestroyEvent interface to release Event or
* call aclrtDestroyStream interface to release explicitly created Stream->
* call aclrtDestroyContext to release explicitly created Context->
* call aclrtResetDevice interface
* @param deviceId [IN] the device id
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtResetDevice(int32_t deviceId);
/**
* @ingroup AscendCL
* @brief get target device of current thread
*
* @param deviceId [OUT] the device id
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtGetDevice(int32_t *deviceId);
/**
* @ingroup AscendCL
* @brief get target side
*
* @param runMode [OUT] the run mode
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtGetRunMode(aclrtRunMode *runMode);
/**
* @ingroup AscendCL
* @brief Wait for compute device to finish
*
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtSynchronizeDevice(void);
/**
* @ingroup AscendCL
* @brief Set Scheduling TS
*
* @param tsId [IN] the ts id
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtSetTsDevice(aclrtTsId tsId);
/**
* @ingroup AscendCL
* @brief get total device number.
*
* @param count [IN|OUT] the device number
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtGetDeviceCount(uint32_t *count);
/**
* @ingroup AscendCL
* @brief create event instance
*
* @param event [OUT] created event
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtCreateEvent(aclrtEvent *event);
/**
* @ingroup AscendCL
* @brief destroy event instance
*
* @par Function
* Only events created through the aclrtCreateEvent interface can be
* destroyed, synchronous interfaces. When destroying an event,
* the user must ensure that the tasks involved in the aclrtSynchronizeEvent
* interface or the aclrtStreamWaitEvent interface are completed before
* they are destroyed.
* @param event [IN] event to destroy
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclrtCreateEvent | aclrtSynchronizeEvent | aclrtStreamWaitEvent
*/
ACL_FUNC_VISIBILITY aclError aclrtDestroyEvent(aclrtEvent event);
/**
* @ingroup AscendCL
* @brief Record an Event in the Stream
*
* @param event [IN] event to record
* @param stream [IN] stream handle
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtRecordEvent(aclrtEvent event, aclrtStream stream);
/**
* @ingroup AscendCL
* @brief Reset an event
*
* @par Function
* Users need to make sure to wait for the tasks in the Stream
* to complete before resetting the Event
* @param event [IN] event to reset
* @param stream [IN] stream handle
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtResetEvent(aclrtEvent event, aclrtStream stream);
/**
* @ingroup AscendCL
* @brief Queries an event's status
*
* @param event [IN] event to query
* @param status [OUT] event status
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtQueryEvent(aclrtEvent event, aclrtEventStatus *status);
/**
* @ingroup AscendCL
* @brief Block Host Running, wait event to be complete
*
* @param event [IN] event to wait
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtSynchronizeEvent(aclrtEvent event);
/**
* @ingroup AscendCL
* @brief computes the elapsed time between events.
*
* @param ms [OUT] time between start and end in ms
* @param start [IN] starting event
* @param end [IN] ending event
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclrtCreateEvent | aclrtRecordEvent | aclrtSynchronizeStream
*/
ACL_FUNC_VISIBILITY aclError aclrtEventElapsedTime(float *ms, aclrtEvent start, aclrtEvent end);
/**
* @ingroup AscendCL
* @brief alloc memory on device
*
* @par Function
* alloc for size linear memory on device
* and return a pointer to allocated memory by *devPtr
*
* @par Restriction
* @li The memory requested by the aclrtMalloc interface needs to be released
* through the aclrtFree interface.
* @li Before calling the media data processing interface,
* if you need to apply memory on the device to store input or output data,
* you need to call acldvppMalloc to apply for memory.
* @param devPtr [IN|OUT] pointer to pointer to allocated memory on device
* @param size [IN] alloc memory size
* @param policy [IN] memory alloc policy
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclrtFree | acldvppMalloc
*/
ACL_FUNC_VISIBILITY aclError aclrtMalloc(void **devPtr,
size_t size,
aclrtMemMallocPolicy policy);
/**
* @ingroup AscendCL
* @brief free device memory
*
* @par Function
* can only free memory allocated through the aclrtMalloc interface
* @param devPtr [IN] Pointer to memory to be freed
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclrtMalloc
*/
ACL_FUNC_VISIBILITY aclError aclrtFree(void *devPtr);
/**
* @ingroup AscendCL
* @brief alloc memory on host
*
* @par Restriction
* @li The requested memory cannot be used in the Device
* and needs to be explicitly copied to the Device.
* @li The memory requested by the aclrtMallocHost interface
* needs to be released through the aclrtFreeHost interface.
* @param hostPtr [IN|OUT] pointer to pointer to allocated memory on the host
* @param size [IN] alloc memory size
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclrtFreeHost
*/
ACL_FUNC_VISIBILITY aclError aclrtMallocHost(void **hostPtr, size_t size);
/**
* @ingroup AscendCL
* @brief free host memory
*
* @par Function
* can only free memory allocated through the aclrtMallocHost interface
* @param hostPtr [IN] free memory pointer
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclrtMallocHost
*/
ACL_FUNC_VISIBILITY aclError aclrtFreeHost(void *hostPtr);
/**
* @ingroup AscendCL
* @brief synchronous memory replication between host and device
*
* @param dst [IN] destination address pointer
* @param destMax [IN] Max length of the destination address memory
* @param src [IN] source address pointer
* @param count [IN] the length of byte to copy
* @param kind [IN] memcpy type
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtMemcpy(void *dst,
size_t destMax,
const void *src,
size_t count,
aclrtMemcpyKind kind);
/**
* @ingroup AscendCL
* @brief Initialize memory and set contents of memory to specified value
*
* @par Function
* The memory to be initialized is on the Host or device side,
* and the system determines whether
* it is host or device according to the address
* @param devPtr [IN] Starting address of memory
* @param maxCount [IN] Max length of destination address memory
* @param value [IN] Set value
* @param count [IN] The length of memory
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtMemset(void *devPtr, size_t maxCount, int32_t value, size_t count);
/**
* @ingroup AscendCL
* @brief Asynchronous memory replication between Host and Device
*
* @par Function
* After calling this interface,
* be sure to call the aclrtSynchronizeStream interface to ensure that
* the task of memory replication has been completed
*
* @par Restriction
* @li For on-chip Device-to-Device memory copy,
* both the source and destination addresses must be 64-byte aligned
* @param dst [IN] destination address pointer
* @param destMax [IN] Max length of destination address memory
* @param src [IN] source address pointer
* @param count [IN] the number of byte to copy
* @param kind [IN] memcpy type
* @param stream [IN] asynchronized task stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclrtSynchronizeStream
*/
ACL_FUNC_VISIBILITY aclError aclrtMemcpyAsync(void *dst,
size_t destMax,
const void *src,
size_t count,
aclrtMemcpyKind kind,
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief Asynchronous initialize memory
* and set contents of memory to specified value async
*
* @par Function
* The memory to be initialized is on the Host or device side,
* and the system determines whether
* it is host or device according to the address
* @param devPtr [IN] destination address pointer
* @param maxCount [IN] Max length of destination address memory
* @param value [IN] set value
* @param count [IN] the number of byte to set
* @param stream [IN] asynchronized task stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclrtSynchronizeStream
*/
ACL_FUNC_VISIBILITY aclError aclrtMemsetAsync(void *devPtr,
size_t maxCount,
int32_t value,
size_t count,
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief create stream instance
*
* @param stream [OUT] the created stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtCreateStream(aclrtStream *stream);
/**
* @ingroup AscendCL
* @brief destroy stream instance
*
* @par Function
* Can only destroy streams created through the aclrtCreateStream interface
*
* @par Restriction
* Before calling the aclrtDestroyStream interface to destroy
* the specified Stream, you need to call the aclrtSynchronizeStream interface
* to ensure that the tasks in the Stream have been completed.
* @param stream [IN] the stream to destroy
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclrtCreateStream | aclrtSynchronizeStream
*/
ACL_FUNC_VISIBILITY aclError aclrtDestroyStream(aclrtStream stream);
/**
* @ingroup AscendCL
* @brief block the host until all tasks
* in the specified stream have completed
*
* @param stream [IN] the stream to wait
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtSynchronizeStream(aclrtStream stream);
/**
* @ingroup AscendCL
* @brief Blocks the operation of the specified Stream until
* the specified Event is completed.
* Support for multiple streams waiting for the same event.
*
* @param stream [IN] the wait stream If using thedefault Stream, set NULL
* @param event [IN] the event to wait
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtStreamWaitEvent(aclrtStream stream, aclrtEvent event);
#ifdef __cplusplus
}
#endif
#endif // INC_EXTERNAL_ACL_ACL_RT_H_
/**
* @file acl_cblas.h
*
* Copyright (C) Huawei Technologies Co., Ltd. 2019-2020. All Rights Reserved.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef INC_EXTERNAL_ACL_OPS_ACL_CBLAS_H_
#define INC_EXTERNAL_ACL_OPS_ACL_CBLAS_H_
#include "../acl.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum aclTransType {
ACL_TRANS_N,
ACL_TRANS_T,
ACL_TRANS_NZ,
ACL_TRANS_NZ_T
} aclTransType;
typedef enum aclComputeType {
ACL_COMPUTE_HIGH_PRECISION,
ACL_COMPUTE_LOW_PRECISION
} aclComputeType;
/**
* @ingroup AscendCL
* @brief perform the matrix-vector multiplication
*
* @param transA [IN] transpose type of matrix A
* @param m [IN] number of rows of matrix A
* @param n [IN] number of columns of matrix A
* @param alpha [IN] pointer to scalar used for multiplication.
* of same type as dataTypeC
* @param a [IN] pointer to matrix A
* @param lda [IN] leading dimension used to store the matrix A
* @param dataTypeA [IN] datatype of matrix A
* @param x [IN] pointer to vector x
* @param incx [IN] stride between consecutive elements of vector x
* @param dataTypeX [IN] datatype of vector x
* @param beta [IN] pointer to scalar used for multiplication.
* of same type as dataTypeC If beta == 0,
* then y does not have to be a valid input
* @param y [IN|OUT] pointer to vector y
* @param incy [IN] stride between consecutive elements of vector y
* @param dataTypeY [IN] datatype of vector y
* @param type [IN] computation type
* @param stream [IN] stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclblasGemvEx(aclTransType transA, int m, int n,
const void *alpha, const void *a, int lda, aclDataType dataTypeA,
const void *x, int incx, aclDataType dataTypeX,
const void *beta, void *y, int incy, aclDataType dataTypeY,
aclComputeType type, aclrtStream stream);
/**
* @ingroup AscendCL
* @brief create a handle for performing the matrix-vector multiplication
*
* @param transA [IN] transpose type of matrix A
* @param m [IN] number of rows of matrix A
* @param n [IN] number of columns of matrix A
* @param dataTypeA [IN] datatype of matrix A
* @param dataTypeX [IN] datatype of vector x
* @param dataTypeY [IN] datatype of vector y
* @param type [IN] computation type
* @param handle [OUT] pointer to the pointer to the handle
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclblasCreateHandleForGemvEx(aclTransType transA,
int m,
int n,
aclDataType dataTypeA,
aclDataType dataTypeX,
aclDataType dataTypeY,
aclComputeType type,
aclopHandle **handle);
/**
* @ingroup AscendCL
* @brief perform the matrix-vector multiplication
*
* @param transA [IN] transpose type of matrix A
* @param m [IN] number of rows of matrix A
* @param n [IN] number of columns of matrix A
* @param alpha [IN] pointer to scalar used for multiplication
* @param a [IN] pointer to matrix A
* @param lda [IN] leading dimension used to store the matrix A
* @param x [IN] pointer to vector x
* @param incx [IN] stride between consecutive elements of vector x
* @param beta [IN] pointer to scalar used for multiplication.
* If beta value == 0,
* then y does not have to be a valid input
* @param y [IN|OUT] pointer to vector y
* @param incy [IN] stride between consecutive elements of vector y
* @param type [IN] computation type
* @param stream [IN] stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclblasHgemv(aclTransType transA,
int m,
int n,
const aclFloat16 *alpha,
const aclFloat16 *a,
int lda,
const aclFloat16 *x,
int incx,
const aclFloat16 *beta,
aclFloat16 *y,
int incy,
aclComputeType type,
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief create a handle for performing the matrix-vector multiplication
*
* @param transA [IN] transpose type of matrix A
* @param m [IN] number of rows of matrix A
* @param n [IN] number of columns of matrix A
* @param type [IN] computation type
* @param handle [OUT] pointer to the pointer to the handle
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclblasCreateHandleForHgemv(aclTransType transA,
int m,
int n,
aclComputeType type,
aclopHandle **handle);
/**
* @ingroup AscendCL
* @brief perform the matrix-vector multiplication
*
* @param transA [IN] transpose type of matrix A
* @param m [IN] number of rows of matrix A
* @param n [IN] number of columns of matrix A
* @param alpha [IN] pointer to scalar used for multiplication
* @param a [IN] pointer to matrix A
* @param lda [IN] leading dimension used to store the matrix A
* @param x [IN] pointer to vector x
* @param incx [IN] stride between consecutive elements of vector x
* @param beta [IN] pointer to scalar used for multiplication.
* If beta value == 0,
* then y does not have to be a valid input
* @param y [IN|OUT] pointer to vector y
* @param incy [IN] stride between consecutive elements of vector y
* @param type [IN] computation type
* @param stream [IN] stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclblasS8gemv(aclTransType transA,
int m,
int n,
const int32_t *alpha,
const int8_t *a,
int lda,
const int8_t *x,
int incx,
const int32_t *beta,
int32_t *y,
int incy,
aclComputeType type,
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief create a handle for performing the matrix-vector multiplication
*
* @param transA [IN] transpose type of matrix A
* @param m [IN] number of rows of matrix A
* @param n [IN] number of columns of matrix A
* @param handle [OUT] pointer to the pointer to the handle
* @param type [IN] computation type
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclblasCreateHandleForS8gemv(aclTransType transA,
int m,
int n,
aclComputeType type,
aclopHandle **handle);
/**
* @ingroup AscendCL
* @brief perform the matrix-matrix multiplication
*
* @param transA [IN] transpose type of matrix A
* @param transB [IN] transpose type of matrix B
* @param transC [IN] transpose type of matrix C
* @param m [IN] number of rows of matrix A and matrix C
* @param n [IN] number of columns of matrix B and matrix C
* @param k [IN] number of columns of matrix A and rows of matrix B
* @param alpha [IN] pointer to scalar used for multiplication. of same type as dataTypeC
* @param matrixA [IN] pointer to matrix A
* @param lda [IN] leading dimension array used to store matrix A
* @param dataTypeA [IN] datatype of matrix A
* @param matrixB [IN] pointer to matrix B
* @param ldb [IN] leading dimension array used to store matrix B
* @param dataTypeB [IN] datatype of matrix B
* @param beta [IN] pointer to scalar used for multiplication.
* of same type as dataTypeC If beta == 0,
* then matrixC does not have to be a valid input
* @param matrixC [IN|OUT] pointer to matrix C
* @param ldc [IN] leading dimension array used to store matrix C
* @param dataTypeC [IN] datatype of matrix C
* @param type [IN] computation type
* @param stream [IN] stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclblasGemmEx(aclTransType transA,
aclTransType transB,
aclTransType transC,
int m,
int n,
int k,
const void *alpha,
const void *matrixA,
int lda,
aclDataType dataTypeA,
const void *matrixB,
int ldb,
aclDataType dataTypeB,
const void *beta,
void *matrixC,
int ldc,
aclDataType dataTypeC,
aclComputeType type,
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief create a handle for performing the matrix-matrix multiplication
*
* @param transA [IN] transpose type of matrix A
* @param transB [IN] transpose type of matrix B
* @param transC [IN] transpose type of matrix C
* @param m [IN] number of rows of matrix A and matrix C
* @param n [IN] number of columns of matrix B and matrix C
* @param k [IN] number of columns of matrix A and rows of matrix B
* @param dataTypeA [IN] datatype of matrix A
* @param dataTypeB [IN] datatype of matrix B
* @param dataTypeC [IN] datatype of matrix C
* @param type [IN] computation type
* @param handle [OUT] pointer to the pointer to the handle
* @param type [IN] computation type
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclblasCreateHandleForGemmEx(aclTransType transA,
aclTransType transB,
aclTransType transC,
int m,
int n,
int k,
aclDataType dataTypeA,
aclDataType dataTypeB,
aclDataType dataTypeC,
aclComputeType type,
aclopHandle **handle);
/**
* @ingroup AscendCL
* @brief perform the matrix-matrix multiplication
*
* @param transA [IN] transpose type of matrix A
* @param transB [IN] transpose type of matrix B
* @param transC [IN] transpose type of matrix C
* @param m [IN] number of rows of matrix A and matrix C
* @param n [IN] number of columns of matrix B and matrix C
* @param k [IN] number of columns of matrix A and rows of matrix B
* @param alpha [IN] pointer to scalar used for multiplication
* @param matrixA [IN] pointer to matrix A
* @param lda [IN] leading dimension used to store the matrix A
* @param matrixB [IN] pointer to matrix B
* @param ldb [IN] leading dimension used to store the matrix B
* @param beta [IN] pointer to scalar used for multiplication.
* If beta value == 0,
* then matrixC does not have to be a valid input
* @param matrixC [IN|OUT] pointer to matrix C
* @param ldc [IN] leading dimension used to store the matrix C
* @param type [IN] computation type
* @param stream [IN] stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclblasHgemm(aclTransType transA,
aclTransType transB,
aclTransType transC,
int m,
int n,
int k,
const aclFloat16 *alpha,
const aclFloat16 *matrixA,
int lda,
const aclFloat16 *matrixB,
int ldb,
const aclFloat16 *beta,
aclFloat16 *matrixC,
int ldc,
aclComputeType type,
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief create a handle for performing the matrix-matrix multiplication
*
* @param transA [IN] transpose type of matrix A
* @param transB [IN] transpose type of matrix B
* @param transC [IN] transpose type of matrix C
* @param m [IN] number of rows of matrix A and matrix C
* @param n [IN] number of columns of matrix B and matrix C
* @param k [IN] number of columns of matrix A and rows of matrix B
* @param type [IN] computation type
* @param handle [OUT] pointer to the pointer to the handle
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclblasCreateHandleForHgemm(aclTransType transA,
aclTransType transB,
aclTransType transC,
int m,
int n,
int k,
aclComputeType type,
aclopHandle **handle);
/**
* @ingroup AscendCL
* @brief perform the matrix-matrix multiplication
*
* @param transA [IN] transpose type of matrix A
* @param transB [IN] transpose type of matrix B
* @param transC [IN] transpose type of matrix C
* @param m [IN] number of rows of matrix A and matrix C
* @param n [IN] number of columns of matrix B and matrix C
* @param k [IN] number of columns of matrix A and rows of matrix B
* @param alpha [IN] pointer to scalar used for multiplication
* @param matrixA [IN] pointer to matrix A
* @param lda [IN] leading dimension used to store the matrix A
* @param matrixB [IN] pointer to matrix B
* @param ldb [IN] leading dimension used to store the matrix B
* @param beta [IN] pointer to scalar used for multiplication.
* If beta value == 0,
* then matrixC does not have to be a valid input
* @param matrixC [IN|OUT] pointer to matrix C
* @param ldc [IN] leading dimension used to store the matrix C
* @param type [IN] computation type
* @param stream [IN] stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclblasS8gemm(aclTransType transA,
aclTransType transB,
aclTransType transC,
int m,
int n,
int k,
const int32_t *alpha,
const int8_t *matrixA,
int lda,
const int8_t *matrixB,
int ldb,
const int32_t *beta,
int32_t *matrixC,
int ldc,
aclComputeType type,
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief create a handle for performing the matrix-matrix multiplication
*
* @param transA [IN] transpose type of matrix A
* @param transB [IN] transpose type of matrix B
* @param transC [IN] transpose type of matrix C
* @param m [IN] number of rows of matrix A and matrix C
* @param n [IN] number of columns of matrix B and matrix C
* @param k [IN] number of columns of matrix A and rows of matrix B
* @param type [IN] computation type
* @param handle [OUT] pointer to the pointer to the handle
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclblasCreateHandleForS8gemm(aclTransType transA,
aclTransType transB,
aclTransType transC,
int m,
int n,
int k,
aclComputeType type,
aclopHandle **handle);
#ifdef __cplusplus
}
#endif
#endif // INC_EXTERNAL_ACL_OPS_ACL_CBLAS_H_
/**
* @file acl_dvpp.h
*
* Copyright (C) Huawei Technologies Co., Ltd. 2019-2020. All Rights Reserved.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#if !defined(ENABLE_DVPP_INTERFACE)
#if defined(_MSC_VER)
#error message("if you want to use dvpp funtions ,please use the macro definition (ENABLE_DVPP_INTERFACE).")
#else
#error "if you want to use dvpp funtions ,please use the macro definition (ENABLE_DVPP_INTERFACE)."
#endif
#endif
#ifndef INC_EXTERNAL_ACL_OPS_ACL_DVPP_H_
#define INC_EXTERNAL_ACL_OPS_ACL_DVPP_H_
#include <stdint.h>
#include <stddef.h>
#include "../acl.h"
#include "../acl_base.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct acldvppPicDesc acldvppPicDesc;
typedef struct acldvppBatchPicDesc acldvppBatchPicDesc;
typedef struct acldvppRoiConfig acldvppRoiConfig;
typedef struct acldvppResizeConfig acldvppResizeConfig;
typedef struct acldvppChannelDesc acldvppChannelDesc;
typedef struct acldvppJpegeConfig acldvppJpegeConfig;
typedef struct aclvdecChannelDesc aclvdecChannelDesc;
typedef struct acldvppStreamDesc acldvppStreamDesc;
typedef struct aclvdecFrameConfig aclvdecFrameConfig;
typedef struct aclvencChannelDesc aclvencChannelDesc;
typedef struct aclvencFrameConfig aclvencFrameConfig;
typedef void (*aclvdecCallback)(acldvppStreamDesc *input, acldvppPicDesc *output, void *userData);
typedef void (*aclvencCallback)(acldvppPicDesc *input, acldvppStreamDesc *output, void *userdata);
// Supported Pixel Format
enum acldvppPixelFormat {
PIXEL_FORMAT_YUV_400 = 0, // 0
PIXEL_FORMAT_YUV_SEMIPLANAR_420 = 1, // 1
PIXEL_FORMAT_YVU_SEMIPLANAR_420 = 2, // 2
PIXEL_FORMAT_YUV_SEMIPLANAR_422 = 3, // 3
PIXEL_FORMAT_YVU_SEMIPLANAR_422 = 4, // 4
PIXEL_FORMAT_YUV_SEMIPLANAR_444 = 5, // 5
PIXEL_FORMAT_YVU_SEMIPLANAR_444 = 6, // 6
PIXEL_FORMAT_YUYV_PACKED_422 = 7, // 7
PIXEL_FORMAT_UYVY_PACKED_422 = 8, // 8
PIXEL_FORMAT_YVYU_PACKED_422 = 9, // 9
PIXEL_FORMAT_VYUY_PACKED_422 = 10, // 10
PIXEL_FORMAT_YUV_PACKED_444 = 11, // 11
PIXEL_FORMAT_RGB_888 = 12, // 12
PIXEL_FORMAT_BGR_888 = 13, // 13
PIXEL_FORMAT_ARGB_8888 = 14, // 14
PIXEL_FORMAT_ABGR_8888 = 15, // 15
PIXEL_FORMAT_RGBA_8888 = 16, // 16
PIXEL_FORMAT_BGRA_8888 = 17, // 17
PIXEL_FORMAT_YUV_SEMI_PLANNER_420_10BIT = 18, // 18
PIXEL_FORMAT_YVU_SEMI_PLANNER_420_10BIT = 19, // 19
PIXEL_FORMAT_YVU_PLANAR_420 = 20, // 20
PIXEL_FORMAT_YVU_PLANAR_422,
PIXEL_FORMAT_YVU_PLANAR_444,
PIXEL_FORMAT_RGB_444 = 23,
PIXEL_FORMAT_BGR_444,
PIXEL_FORMAT_ARGB_4444,
PIXEL_FORMAT_ABGR_4444,
PIXEL_FORMAT_RGBA_4444,
PIXEL_FORMAT_BGRA_4444,
PIXEL_FORMAT_RGB_555,
PIXEL_FORMAT_BGR_555,
PIXEL_FORMAT_RGB_565,
PIXEL_FORMAT_BGR_565,
PIXEL_FORMAT_ARGB_1555,
PIXEL_FORMAT_ABGR_1555,
PIXEL_FORMAT_RGBA_1555,
PIXEL_FORMAT_BGRA_1555,
PIXEL_FORMAT_ARGB_8565,
PIXEL_FORMAT_ABGR_8565,
PIXEL_FORMAT_RGBA_8565,
PIXEL_FORMAT_BGRA_8565,
PIXEL_FORMAT_RGB_BAYER_8BPP = 50,
PIXEL_FORMAT_RGB_BAYER_10BPP,
PIXEL_FORMAT_RGB_BAYER_12BPP,
PIXEL_FORMAT_RGB_BAYER_14BPP,
PIXEL_FORMAT_RGB_BAYER_16BPP,
PIXEL_FORMAT_BGR_888_PLANAR = 70,
PIXEL_FORMAT_HSV_888_PACKAGE,
PIXEL_FORMAT_HSV_888_PLANAR,
PIXEL_FORMAT_LAB_888_PACKAGE,
PIXEL_FORMAT_LAB_888_PLANAR,
PIXEL_FORMAT_S8C1,
PIXEL_FORMAT_S8C2_PACKAGE,
PIXEL_FORMAT_S8C2_PLANAR,
PIXEL_FORMAT_S16C1,
PIXEL_FORMAT_U8C1,
PIXEL_FORMAT_U16C1,
PIXEL_FORMAT_S32C1,
PIXEL_FORMAT_U32C1,
PIXEL_FORMAT_U64C1,
PIXEL_FORMAT_S64C1,
PIXEL_FORMAT_YUV_SEMIPLANAR_440 = 1000,
PIXEL_FORMAT_YVU_SEMIPLANAR_440,
PIXEL_FORMAT_FLOAT32,
PIXEL_FORMAT_BUTT,
PIXEL_FORMAT_UNKNOWN = 10000
};
// Stream Format
enum acldvppStreamFormat {
H265_MAIN_LEVEL = 0,
H264_BASELINE_LEVEL,
H264_MAIN_LEVEL,
H264_HIGH_LEVEL
};
// Supported Channel Mode
enum acldvppChannelMode {
DVPP_CHNMODE_VPC = 1,
DVPP_CHNMODE_JPEGD = 2,
DVPP_CHNMODE_JPEGE = 4
};
/**
* @ingroup AscendCL
* @brief alloc device memory for dvpp.
*
* @par Function
* @li It's mainly used for allocating memory to device media data processing.
* The requested memory meets the data processing requirements.
* After calling this interface to request memory,
* you must release the memory using the acldvppFree interface.
* @li When calling the acldvppMalloc interface to apply for memory,
* the size entered by the user is aligned upwards to 32 integer multiples,
* and an additional 32 bytes are applied.
*
* @par Restriction
* If the user uses the acldvppMalloc interface to apply for a large block of
* memory and divide and manage the memory by himself,
* when applying for memory, the user needs to align up to 32 integer
* times + 32 bytes (ALIGN_UP [len] +32 words) according to
* the actual data size of each picture Section) to manage memory.
* @param devPtr [IN] memory pointer.
* @param size [IN] memory size.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppFree
*/
ACL_FUNC_VISIBILITY aclError acldvppMalloc(void **devPtr, size_t size);
/**
* @ingroup AscendCL
* @brief free device memory for dvpp.
*
* @par Function
* Free the memory requested through the acldvppMalloc interface
* @param devPtr [IN] memory pointer to free.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppMalloc
*/
ACL_FUNC_VISIBILITY aclError acldvppFree(void *devPtr);
/**
* @ingroup AscendCL
* @brief create DvppChannelDesc.
*
* @par Function
* Create a channel for image data processing.
* The same channel can be reused
* and is no longer available after destruction
* @retval null for failed.
* @retval OtherValues success.
*/
ACL_FUNC_VISIBILITY acldvppChannelDesc *acldvppCreateChannelDesc();
/**
* @ingroup AscendCL
* @brief destroy dvppChannelDesc.
*
* @par Function
* Can only destroy channels created by the acldvppCreateChannel interface
* @param channelDesc [IN] the channel description.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppCreateChannelDesc | acldvppDestroyChannel
*/
ACL_FUNC_VISIBILITY aclError acldvppDestroyChannelDesc(acldvppChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Get dvpp channel Id.
*
* @par Restriction
* Interface calling sequence:
* acldvppCreateChannelDesc --> acldvppCreateChannel -->
* acldvppGetChannelDescChannelId
* @param channelDesc [IN] the channel description.
* @retval channel id.
*
* @see acldvppCreateChannelDesc | acldvppCreateChannel
*/
ACL_FUNC_VISIBILITY uint64_t acldvppGetChannelDescChannelId(const acldvppChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Create dvpp picture description.
*
* @retval null for failed.
* @retval OtherValues success.
*/
ACL_FUNC_VISIBILITY acldvppPicDesc *acldvppCreatePicDesc();
/**
* @ingroup AscendCL
* @brief Destroy dvpp picture description.
*
* @par Function
* Can only destroy picture description information created
* through acldvppCreatePicDesc interface.
* @param picDesc [IN] dvpp picture description.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppCreatePicDesc
*/
ACL_FUNC_VISIBILITY aclError acldvppDestroyPicDesc(acldvppPicDesc *picDesc);
/**
* @ingroup AscendCL
* @brief Set dvpp picture description's data.
*
* @param picDesc [IN] dvpp picture description.
* @param dataDev [IN] dvpp picture dataDev.Must be the memory
* requested using the acldvppMalloc interface.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppMalloc
*/
ACL_FUNC_VISIBILITY aclError acldvppSetPicDescData(acldvppPicDesc *picDesc, void *dataDev);
/**
* @ingroup AscendCL
* @brief Set dvpp picture description's size.
*
* @param picDesc [IN] dvpp picture description.
* @param size dvpp [IN] picture size.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetPicDescSize(acldvppPicDesc *picDesc, uint32_t size);
/**
* @ingroup AscendCL
* @brief Set dvpp picture description's format.
*
* @param picDesc [IN] dvpp picture description.
* @param format [IN] dvpp picture format.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetPicDescFormat(acldvppPicDesc *picDesc, acldvppPixelFormat format);
/**
* @ingroup AscendCL
* @brief Set dvpp picture description's width.
*
* @param picDesc [IN] dvpp picture description.
* @param width [IN] dvpp picture width.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetPicDescWidth(acldvppPicDesc *picDesc, uint32_t width);
/**
* @ingroup AscendCL
* @brief Set dvpp picture description's height.
*
* @param picDesc [IN] dvpp picture description.
* @param height [IN] dvpp picture height.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetPicDescHeight(acldvppPicDesc *picDesc, uint32_t height);
/**
* @ingroup AscendCL
* @brief Set dvpp picture description's widthStride.
*
* @par Restriction
* Width alignment requirements:
* @li The minimum stride is 32 and the maximum is 4096 * 4
* (that is, an image in argb format with a width of 4096);
* @li For 8K scaling, widthStride is required to be aligned to 2;
* @li For non 8K scaling, the calculation formula for widthStride
* is different for different image formats:
* @li yuv400sp, yuv420sp, yuv422sp, yuv444sp: input image width aligned to 16
* @li yuv422packed: input image width * 2 and then align to 16
* @li yuv444packed, rgb888: input image width alignment * 3, alignment to 16
* @li xrgb8888: input image width * 4, align to 16
* @li HFBC:input image width
* @param picDesc [IN] dvpp picture description.
* @param widthStride [IN] dvpp picture widthStride.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetPicDescWidthStride(acldvppPicDesc *picDesc, uint32_t widthStride);
/**
* @ingroup AscendCL
* @brief Set dvpp picture description's heightStride.
*
* @par Restriction
* Height alignment requirements:
* @li The height of the input image is aligned to 2.
* High stride minimum 6 and maximum 4096.
* @param picDesc [IN] dvpp picture description.
* @param heightStride [IN] dvpp picture heightStride.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetPicDescHeightStride(acldvppPicDesc *picDesc, uint32_t heightStride);
/**
* @ingroup AscendCL
* @brief Set dvpp picture description's retcode.
*
* @param picDesc [IN] dvpp picture description.
* @param retCode [IN] dvpp picture retcode.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetPicDescRetCode(acldvppPicDesc *picDesc, uint32_t retCode);
/**
* @ingroup AscendCL
* @brief Get picture data.
*
* @param picDesc [IN] dvpp picture description.
* @retval picture data addr.
* @retval default nullptr.
*/
ACL_FUNC_VISIBILITY void *acldvppGetPicDescData(const acldvppPicDesc *picDesc);
/**
* @ingroup AscendCL
* @brief Get picture data size.
*
* @param picDesc [IN] dvpp picture description.
* @retval picture data size.
* @retval default 0.
*/
ACL_FUNC_VISIBILITY uint32_t acldvppGetPicDescSize(const acldvppPicDesc *picDesc);
/**
* @ingroup AscendCL
* @brief Get dvpp picture desc's format.
*
* @param picDesc [IN] dvpp picture description.
* @retval format
* @retval default PIXEL_FORMAT_YUV_400.
*/
ACL_FUNC_VISIBILITY acldvppPixelFormat acldvppGetPicDescFormat(const acldvppPicDesc *picDesc);
/**
* @ingroup AscendCL
* @brief Get dvpp picture desc's width.
*
* @param picDesc [IN] dvpp picture description.
* @retval width.
* @retval default 0.
*/
ACL_FUNC_VISIBILITY uint32_t acldvppGetPicDescWidth(const acldvppPicDesc *picDesc);
/**
* @ingroup AscendCL
* @brief Get dvpp picture desc's height.
*
* @param picDesc [IN] dvpp picture description.
* @retval height.
* @retval default 0.
*/
ACL_FUNC_VISIBILITY uint32_t acldvppGetPicDescHeight(const acldvppPicDesc *picDesc);
/**
* @ingroup AscendCL
* @brief Get dvpp picture desc's widthStride.
*
* @par Restriction
* Width alignment requirements:
* @li The minimum stride is 32 and the maximum is 4096 * 4
* (that is, an image in argb format with a width of 4096);
* @li For 8K scaling, widthStride is required to be aligned to 2;
* @li For non 8K scaling, the calculation formula for widthStride
* is different for different image formats:
* @li yuv400sp, yuv420sp, yuv422sp, yuv444sp: input image width aligned to 16
* @li yuv422packed: input image width * 2 and then align to 16
* @li yuv444packed, rgb888: input image width alignment * 3, alignment to 16
* @li xrgb8888: input image width * 4, align to 16
* @li HFBC:input image width
* @param picDesc [IN] dvpp picture description.
* @retval stride width.
* @retval default 0.
*/
ACL_FUNC_VISIBILITY uint32_t acldvppGetPicDescWidthStride(const acldvppPicDesc *picDesc);
/**
* @ingroup AscendCL
* @brief Get dvpp picture desc's heightStride.
*
* @par Restriction
* Height alignment requirements:
* @li The height of the input image is aligned to 2.
* High stride minimum 6 and maximum 4096.
* @param picDesc [IN] dvpp picture description.
* @retval stride height.
* @retval default 0.
*/
ACL_FUNC_VISIBILITY uint32_t acldvppGetPicDescHeightStride(const acldvppPicDesc *picDesc);
/**
* @ingroup AscendCL
* @brief Get dvpp picture desc's retcode.
*
* @param picDesc [IN] dvpp picture description.
* @retval ret code.
* @retval default 0.
*/
ACL_FUNC_VISIBILITY uint32_t acldvppGetPicDescRetCode(const acldvppPicDesc *picDesc);
/**
* @ingroup AscendCL
* @brief Create dvpp roi config.
*
* @param left [IN] the left offset, must be even
* @param right [IN] the right offset, must be odd
* @param top [IN] the top offset, must be even
* @param bottom [IN] the bottom offset, must be odd
* @retval null for failed.
* @retval other success
*/
ACL_FUNC_VISIBILITY acldvppRoiConfig *acldvppCreateRoiConfig(uint32_t left,
uint32_t right,
uint32_t top,
uint32_t bottom);
/**
* @ingroup AscendCL
* @brief Destroy dvpp roi config.
*
* @par Function
* Destroys data created through the acldvppCreateRoiConfig interface
* @param roiConfig [IN] dvpp roi config.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppCreateRoiConfig
*/
ACL_FUNC_VISIBILITY aclError acldvppDestroyRoiConfig(acldvppRoiConfig *roiConfig);
/**
* @ingroup AscendCL
* @brief Set left of RoiConfig.
*
* @param config [IN] RoiConfig
* @param left [IN] left offset
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetRoiConfigLeft(acldvppRoiConfig *config, uint32_t left);
/**
* @ingroup AscendCL
* @brief Set right of RoiConfig.
*
* @param config [IN] RoiConfig
* @param right [IN] right offset
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetRoiConfigRight(acldvppRoiConfig *config, uint32_t right);
/**
* @ingroup AscendCL
* @brief Set top of RoiConfig.
*
* @param config [IN] RoiConfig
* @param top [IN] top offset
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetRoiConfigTop(acldvppRoiConfig *config, uint32_t top);
/**
* @ingroup AscendCL
* @brief Set bottom of RoiConfig.
*
* @param config [IN] RoiConfig
* @param bottom [IN] bottom offset
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetRoiConfigBottom(acldvppRoiConfig *config, uint32_t bottom);
/**
* @ingroup AscendCL
* @brief Set RoiConfig.
*
* @param config [IN|OUT] RoiConfig
* @param left [IN] left offset
* @param right [IN] right offset
* @param top [IN] top offset
* @param bottom [IN] bottom offset
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetRoiConfig(acldvppRoiConfig *config,
uint32_t left,
uint32_t right,
uint32_t top,
uint32_t bottom);
/**
* @ingroup AscendCL
* @brief Create dvpp resize config.
* The specified scaling algorithm is not supported.
* The default scaling algorithm is "nearest neighbor interpolation".
*
* @retval null for failed.
* @retval other success.
*/
ACL_FUNC_VISIBILITY acldvppResizeConfig *acldvppCreateResizeConfig();
/**
* @ingroup AscendCL
* @brief Destroy dvpp resize config.
*
* @par Function
* Destroys the scaling configuration data created by
* the acldvppCreateResizeConfig interface
* @param resizeConfig [IN] resize config.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppCreateResizeConfig
*/
ACL_FUNC_VISIBILITY aclError acldvppDestroyResizeConfig(acldvppResizeConfig *resizeConfig);
/**
* @ingroup AscendCL
* @brief Create jpege config.
*
* @retval null for failed.
* @retval other success.
*/
ACL_FUNC_VISIBILITY acldvppJpegeConfig *acldvppCreateJpegeConfig();
/**
* @ingroup AscendCL
* @brief Destroy jpege config.
*
* @par Function
* Destroys the encoding configuration data created by
* the acldvppCreateJpegeConfig interface
* @param jpegeConfig config pointer to destroy.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppCreateJpegeConfig
*/
ACL_FUNC_VISIBILITY aclError acldvppDestroyJpegeConfig(acldvppJpegeConfig *jpegeConfig);
/**
* @ingroup AscendCL
* @brief Set jpege config's level.
*
* @param jpegeConfig [IN|OUT] Call the acldvppCreateJpegeConfig
* interface to create acldvppJpegeConfig data
* @param level [IN] Encoding quality range [0, 100],
* where level 0 encoding quality is similar to level 100,
* and the smaller the value in [1, 100],
* the worse the quality of the output picture.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetJpegeConfigLevel(acldvppJpegeConfig *jpegeConfig, uint32_t level);
/**
* @ingroup AscendCL
* @brief Get jpege config's level.
*
* @param jpegeConfig [IN] jpege config.
* @retval compression level.
* @retval default 0.
*/
ACL_FUNC_VISIBILITY uint32_t acldvppGetJpegeConfigLevel(const acldvppJpegeConfig *jpegeConfig);
/**
* @ingroup AscendCL
* @brief create vdecChannelDesc.Channel description information
* when creating a video data processing channel.
*
* @retval null for failed.
* @retval other success
*/
ACL_FUNC_VISIBILITY aclvdecChannelDesc *aclvdecCreateChannelDesc();
/**
* @ingroup AscendCL
* @brief destroy vdecChannelDesc.
*
* @par Function
* Can only destroy aclvdecChannelDesc type created
* through aclvdecCreateChannelDesc interface
* @param channelDesc [IN] channel description.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
* @see aclvdecCreateChannelDesc
*/
ACL_FUNC_VISIBILITY aclError aclvdecDestroyChannelDesc(aclvdecChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Set vdec channel description's channel id.
*
* @param channelDesc [IN] vdec channel description.
* @param channelId [IN] decoding channel id: 0~15.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescChannelId(aclvdecChannelDesc *channelDesc, uint32_t channelId);
/**
* @ingroup AscendCL
* @brief Set vdec channel description's thread id.
*
* @param channelDesc [IN] vdec channel description.
* @param threadId [IN] thread id.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescThreadId(aclvdecChannelDesc *channelDesc, uint64_t threadId);
/**
* @ingroup AscendCL
* @brief Set vdec channel description's callback function.
*
* @param channelDesc [IN] vdec channel description.
* @param callback [IN] function callback.Function prototype:
* void (* aclvdecCallback)
* (acldvppStreamDesc * input, acldvppPicDesc * output, void* userdata)
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclvdecCallback
*/
ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescCallback(aclvdecChannelDesc *channelDesc, aclvdecCallback callback);
/**
* @ingroup AscendCL
* @brief Set vdec channel description's video encoding type.
*
* @param channelDesc [IN] vdec channel description.
* @param enType [IN] video encoding type.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescEnType(aclvdecChannelDesc *channelDesc, acldvppStreamFormat enType);
/**
* @ingroup AscendCL
* @brief Set vdec channel description's out picture format.
*
* @param channelDesc [IN] vdec channel description.
* @param outPicFormat [IN] out picture format (acldvppPixelFormat).
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescOutPicFormat(aclvdecChannelDesc *channelDesc,
acldvppPixelFormat outPicFormat);
/**
* @ingroup AscendCL
* @brief Set vdec channel description's out picture width.
*
* @param channelDesc [IN] vdec channel description.
* @param outPicWidth [IN] out picture width.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescOutPicWidth(aclvdecChannelDesc *channelDesc, uint32_t outPicWidth);
/**
* @ingroup AscendCL
* @brief Set vdec channel description's out picture height.
*
* @param channelDesc [IN] vdec channel description.
* @param outPicHeight [IN] out picture height.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescOutPicHeight(aclvdecChannelDesc *channelDesc, uint32_t outPicHeight);
/**
* @ingroup AscendCL
* @brief Set vdec channel description's reference frame num.
*
* @param channelDesc [IN] vdec channel description.
* @param refFrameNum [IN] reference frame num.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescRefFrameNum(aclvdecChannelDesc *channelDesc, uint32_t refFrameNum);
/**
* @ingroup AscendCL
* @brief Get vdec channel description's channel id.
*
* @param channelDesc [IN] vdec channel description.
* @retval decoding channel id: 0~15.
* @retval default 0.
*/
ACL_FUNC_VISIBILITY uint32_t aclvdecGetChannelDescChannelId(const aclvdecChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Get vdec channel description's thread id.
*
* @param channelDesc [IN] vdec channel description.
* @retval thread id.
* @retval default 0.
*/
ACL_FUNC_VISIBILITY uint64_t aclvdecGetChannelDescThreadId(const aclvdecChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Get vdec channel description's callback function.
*
* @param channelDesc [IN] vdec channel description.
* @retval function callback.Function prototype:
* void (* aclvdecCallback)
* (acldvppStreamDesc * input, acldvppPicDesc * output, void* userdata)
* @retval default null.
*
* @see aclvdecCallback
*/
ACL_FUNC_VISIBILITY aclvdecCallback aclvdecGetChannelDescCallback(const aclvdecChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Get vdec channel description's video encoding type.
*
* @param channelDesc [IN] vdec channel description.
* @retval video encoding type.
* @retval default H265_MAIN_LEVEL.
*/
ACL_FUNC_VISIBILITY acldvppStreamFormat aclvdecGetChannelDescEnType(const aclvdecChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Get vdec channel description's out picture format.
*
* @param channelDesc [IN] vdec channel description.
* @retval out picture format.
* @retval default DVPP_OUTPUT_YUV420SP_UV.
*/
ACL_FUNC_VISIBILITY acldvppPixelFormat aclvdecGetChannelDescOutPicFormat(const aclvdecChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Get vdec channel description's out picture width.
*
* @param channelDesc [IN] vdec channel description.
* @retval out picture width.
* @retval default 0.
*/
ACL_FUNC_VISIBILITY uint32_t aclvdecGetChannelDescOutPicWidth(const aclvdecChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Get vdec channel description's out picture height.
*
* @param channelDesc [IN] vdec channel description.
* @retval out picture height (for vdec malloc memory).
* @retval default 0.
*/
ACL_FUNC_VISIBILITY uint32_t aclvdecGetChannelDescOutPicHeight(const aclvdecChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Get vdec channel description's reference frame num.
*
* @param channelDesc [IN] vdec channel description.
* @retval reference frame num.
* @retval default 0.
*/
ACL_FUNC_VISIBILITY uint32_t aclvdecGetChannelDescRefFrameNum(const aclvdecChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief create vencChannelDesc.
* @return null for failed, other success
*/
ACL_FUNC_VISIBILITY aclvencChannelDesc *aclvencCreateChannelDesc();
/**
* @ingroup AscendCL
* @brief destroy vencChannelDesc.
* @param channelDesc channel desc.
* @return ACL_ERROR_NONE:success, other:failed
*/
ACL_FUNC_VISIBILITY aclError aclvencDestroyChannelDesc(aclvencChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Set decoding thread id for venc channel desc.
* @param channelDesc[IN/OUT] venc channel desc
* @param threadId[IN] thread id
* @return ACL_ERROR_NONE for success, other for failure
*/
ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescThreadId(aclvencChannelDesc *channelDesc, uint64_t threadId);
/**
* @ingroup AscendCL
* @brief Set func callback for venc channel desc.
* @param channelDesc[IN/OUT] venc channel desc
* @param callback[IN] func callback
* @return ACL_ERROR_NONE for success, other for failure
*/
ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescCallback(aclvencChannelDesc *channelDesc, aclvencCallback callback);
/**
* @ingroup AscendCL
* @brief Set video encoding type for venc channel desc.
* @param channelDesc[IN/OUT] venc channel desc
* @param enType[IN] video encoding type
* @return ACL_ERROR_NONE for success, other for failure
*/
ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescEnType(aclvencChannelDesc *channelDesc, acldvppStreamFormat enType);
/**
* @ingroup AscendCL
* @brief Set pic format for venc channel desc.
* @param channelDesc[IN/OUT] venc channel desc
* @param picFormat[IN] pic format
* @return ACL_ERROR_NONE for success, other for failure
*/
ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescPicFormat(aclvencChannelDesc *channelDesc,
acldvppPixelFormat picFormat);
/**
* @ingroup AscendCL
* @brief Set out pic width for venc channel desc.
* @param channelDesc[IN/OUT] venc channel desc
* @param picWidth[IN] pic width
* @return ACL_ERROR_NONE for success, other for failure
*/
ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescPicWidth(aclvencChannelDesc *channelDesc, uint32_t picWidth);
/**
* @ingroup AscendCL
* @brief Set pic height for venc channel desc.
* @param channelDesc[IN/OUT] venc channel desc
* @param picHeight[IN] pic height
* @return ACL_ERROR_NONE for success, other for failure
*/
ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescPicHeight(aclvencChannelDesc *channelDesc, uint32_t picHeight);
/**
* @ingroup AscendCL
* @brief Set eference frame num for venc channel desc.
* @param channelDesc[IN/OUT] venc channel desc
* @param keyFrameInterval[IN] Interval of key frame
* @return ACL_ERROR_NONE for success, other for failure
*/
ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescKeyFrameInterval(aclvencChannelDesc *channelDesc,
uint32_t keyFrameInterval);
/**
* @ingroup AscendCL
* @brief Get decoding channel id for venc channel desc.
* @param channelDesc[IN] venc channel desc
* @return decoding channel id: 0~15, default 0
*/
ACL_FUNC_VISIBILITY uint32_t aclvencGetChannelDescChannelId(const aclvencChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Get decoding thread id for venc channel desc.
* @param channelDesc[IN] venc channel desc
* @return thread id, default 0
*/
ACL_FUNC_VISIBILITY uint64_t aclvencGetChannelDescThreadId(const aclvencChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Get func callback for venc channel desc.
* @param channelDesc[IN] venc channel desc
* @return func callback, default null
*/
ACL_FUNC_VISIBILITY aclvencCallback aclvencGetChannelDescCallback(const aclvencChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Get video encoding type for venc channel desc.
* @param channelDesc[IN] venc channel desc
* @return video encoding type, default H265_MAIN_LEVEL
*/
ACL_FUNC_VISIBILITY acldvppStreamFormat aclvencGetChannelDescEnType(const aclvencChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Get pic format for venc channel desc.
* @param channelDesc[IN] venc channel desc
* @return pic format
*/
ACL_FUNC_VISIBILITY acldvppPixelFormat aclvencGetChannelDescPicFormat(const aclvencChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Get pic width for venc channel desc.
* @param channelDesc[IN] venc channel desc
* @return pic width, default 0
*/
ACL_FUNC_VISIBILITY uint32_t aclvencGetChannelDescPicWidth(const aclvencChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Get pic height for venc channel desc.
* @param channelDesc[IN] venc channel desc
* @return pic height, default 0
*/
ACL_FUNC_VISIBILITY uint32_t aclvencGetChannelDescPicHeight(const aclvencChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Get interval of key frame for venc channel desc.
* @param channelDesc[IN] venc channel desc
* @return interval of key frame, default 0
*/
ACL_FUNC_VISIBILITY uint32_t aclvencGetChannelDescKeyFrameInterval(const aclvencChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief get forced restart of I-frame interval from config
* @param config[IN] venc frame config
* @return 0: Not forced; 1: Forced restart of I-frame -1: error
*/
ACL_FUNC_VISIBILITY uint8_t aclvencGetFrameConfigForceIFrame(const aclvencFrameConfig *config);
/**
* @ingroup AscendCL
* @brief get forced restart of I-frame interval from config
* @param config[IN] venc frame config
* @return Whether it is the end frame: 0: no; 1: end frame
*/
ACL_FUNC_VISIBILITY uint8_t aclvencGetFrameConfigEos(const aclvencFrameConfig *config);
/**
* @ingroup AscendCL
* @brief set single frame encoding configuration parameters
* @param config[IN/OUT] venc frame config
* @param forceFrame[IN] forced restart of I-frame interval: 0: Not forced; 1: Forced restart of I-frame
* @return ACL_ERROR_NONE for ok, others for fail
*/
ACL_FUNC_VISIBILITY aclError aclvencSetFrameConfigForceIFrame(aclvencFrameConfig *config, uint8_t forceIFrame);
/**
* @ingroup AscendCL
* @brief set single frame encoding configuration parameters
* @param config[IN/OUT] venc frame config
* @param eos[IN] Whether it is the end frame: 0: no; 1: end frame
* @return ACL_ERROR_NONE for ok, others for fail
*/
ACL_FUNC_VISIBILITY aclError aclvencSetFrameConfigEos(aclvencFrameConfig *config, uint8_t eos);
/**
* @ingroup AscendCL
* @brief dvpp venc destroy frame config
* @param config[IN/OUT] venc frame config
* @return ACL_ERROR_NONE for ok, others for fail
*/
ACL_FUNC_VISIBILITY aclError aclvencDestroyFrameConfig(aclvencFrameConfig *config);
/**
* @ingroup AscendCL
* @brief Create dvpp venc frame config.
* @return null for failed, other aclvencFrameConfig ptr
*/
ACL_FUNC_VISIBILITY aclvencFrameConfig *aclvencCreateFrameConfig();
/**
* @ingroup AscendCL
* @brief Create dvpp venc channel.
* @param channelDesc[IN/OUT] venc channel desc
* @return ACL_ERROR_NONE for ok, others for fail
*/
ACL_FUNC_VISIBILITY aclError aclvencCreateChannel(aclvencChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Destroy dvpp venc channel.
* @param channelDesc[IN/OUT] venc channel desc
* @return ACL_ERROR_NONE for ok, others for fail
*/
ACL_FUNC_VISIBILITY aclError aclvencDestroyChannel(aclvencChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief dvpp venc launch send frame task.
* @param channelDesc[IN/OUT] venc channel desc
* @param input[IN/OUT] input picture desc
* @param reserve[IN/OUT] reserve parameter
* @param config[IN/OUT] dvpp frame config
* @param userdata[IN/OUT] user callback function
* @return ACL_ERROR_NONE for ok, others for fail
*/
ACL_FUNC_VISIBILITY aclError aclvencSendFrame(aclvencChannelDesc *channelDesc, acldvppPicDesc *input, void *reserve,
aclvencFrameConfig *config, void *userdata);
/**
* @ingroup AscendCL
* @brief Create dvpp stream description.
*
* @retval null for failed.
* @retval other success.
*/
ACL_FUNC_VISIBILITY acldvppStreamDesc *acldvppCreateStreamDesc();
/**
* @ingroup AscendCL
* @brief Destroy dvpp stream description.
*
* @par Function
* Can only destroy acldvppStreamDesc type created through
* acldvppCreateStreamDesc interface.
* @param streamDesc [IN] dvpp stream description.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppCreateStreamDesc
*/
ACL_FUNC_VISIBILITY aclError acldvppDestroyStreamDesc(acldvppStreamDesc *streamDesc);
/**
* @ingroup AscendCL
* @brief Set stream description's data addr.
*
* @param streamDesc [IN] dvpp stream description.
* @param dataDev [IN] data addr.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetStreamDescData(acldvppStreamDesc *streamDesc, void *dataDev);
/**
* @ingroup AscendCL
* @brief Set stream description's data size.
*
* @param streamDesc [IN] dvpp stream description.
* @param size [IN] data size.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetStreamDescSize(acldvppStreamDesc *streamDesc, uint32_t size);
/**
* @ingroup AscendCL
* @brief Set stream description's format.
*
* @param streamDesc [IN] dvpp stream description.
* @param format [IN] stream format.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetStreamDescFormat(acldvppStreamDesc *streamDesc, acldvppStreamFormat format);
/**
* @ingroup AscendCL
* @brief Set stream description's timestamp.
*
* @param streamDesc [IN] dvpp stream description.
* @param timestamp [IN] current timestamp.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetStreamDescTimestamp(acldvppStreamDesc *streamDesc, uint64_t timestamp);
/**
* @ingroup AscendCL
* @brief Set stream description's ret code.
*
* @param streamDesc [IN] dvpp stream description.
* @param retCode [IN] result code.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetStreamDescRetCode(acldvppStreamDesc *streamDesc, uint32_t retCode);
/**
* @ingroup AscendCL
* @brief Set stream description's eos.
*
* @param streamDesc [IN] dvpp stream description.
* @param eos [IN] end flag of sequence.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetStreamDescEos(acldvppStreamDesc *streamDesc, uint8_t eos);
/**
* @ingroup AscendCL
* @brief Get stream description's data addr.
*
* @param streamDesc [IN] dvpp stream description.
* @retval data addr.
* @retval deault nullptr.
*/
ACL_FUNC_VISIBILITY void *acldvppGetStreamDescData(const acldvppStreamDesc *streamDesc);
/**
* @ingroup AscendCL
* @brief Get stream description's data size.
*
* @param streamDesc [IN] dvpp stream description.
* @retval data size.
* @retval default 0.
*/
ACL_FUNC_VISIBILITY uint32_t acldvppGetStreamDescSize(const acldvppStreamDesc *streamDesc);
/**
* @ingroup AscendCL
* @brief Get stream description's format.
*
* @param streamDesc [IN] dvpp stream description.
* @retval stream format.
* @retval default ACL_DVPP_STREAM_H264.
*/
ACL_FUNC_VISIBILITY acldvppStreamFormat acldvppGetStreamDescFormat(const acldvppStreamDesc *streamDesc);
/**
* @ingroup AscendCL
* @brief Get stream description's timestamp.
*
* @param streamDesc [IN] dvpp stream description.
* @retval current timestamp.
* @retval default 0.
*/
ACL_FUNC_VISIBILITY uint64_t acldvppGetStreamDescTimestamp(const acldvppStreamDesc *streamDesc);
/**
* @ingroup AscendCL
* @brief Get stream description's retCode.
*
* @param streamDesc [IN] dvpp stream description.
* @retval result code.
* @retval default 0.
*/
ACL_FUNC_VISIBILITY uint32_t acldvppGetStreamDescRetCode(const acldvppStreamDesc *streamDesc);
/**
* @ingroup AscendCL
* @brief Get stream description's eos.
*
* @param streamDesc [IN] dvpp stream description.
* @retval end flag of sequence.
* @retval default 0(false).
*/
ACL_FUNC_VISIBILITY uint8_t acldvppGetStreamDescEos(const acldvppStreamDesc *streamDesc);
/**
* @ingroup AscendCL
* @brief Create vdec frame config.
*
* @retval null for failed.
* @retval other success.
*/
ACL_FUNC_VISIBILITY aclvdecFrameConfig *aclvdecCreateFrameConfig();
/**
* @ingroup AscendCL
* @brief Destroy vdec frame config.
*
* @par Function
* Can only destroy aclvdecFrameConfig type created through
* aclvdecCreateFrameConfig interface
* @param vdecFrameConfig [IN] vdec frame config.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclvdecCreateFrameConfig
*/
ACL_FUNC_VISIBILITY aclError aclvdecDestroyFrameConfig(aclvdecFrameConfig *vdecFrameConfig);
/**
* @ingroup AscendCL
* @brief Get image width and height of jpeg.
*
* @param data [IN] image data in host memory
* @param size [IN] the size of image data
* @param width [OUT] the width of image from image header
* @param height [OUT] the height of image from image header
* @param components [OUT] the components of image from image header
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppJpegGetImageInfo(const void *data,
uint32_t size,
uint32_t *width,
uint32_t *height,
int32_t *components);
/**
* @ingroup AscendCL
* @brief Predict encode size of jpeg image.
*
* @param inputDesc [IN] dvpp image desc
* @param config [IN] jpeg encode config
* @param size [OUT] the size predicted of image
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppJpegPredictEncSize(const acldvppPicDesc *inputDesc,
const acldvppJpegeConfig *config,
uint32_t *size);
/**
* @ingroup AscendCL
* @brief Predict decode size of jpeg image.
*
* @param data [IN] origin image data in host memory
* @param dataSize [IN] the size of origin image data
* @param outputPixelFormat [IN] the pixel format jpeg decode
* @param decSize [OUT] the size predicted for decode image
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppJpegPredictDecSize(const void *data,
uint32_t dataSize,
acldvppPixelFormat outputPixelFormat,
uint32_t *decSize);
/**
* @ingroup AscendCL
* @brief Create dvpp channel, the same channel can be reused
* and is no longer available after destruction.
*
* @param channelDesc [IN|OUT] the channel destruction
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppCreateChannelDesc
*/
ACL_FUNC_VISIBILITY aclError acldvppCreateChannel(acldvppChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Destroy dvpp channel.
*
* @par Restriction
* Can only destroy channel created through the acldvppCreateChannel interface
* @param channelDesc [IN] the channel destruction
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppCreateChannel
*/
ACL_FUNC_VISIBILITY aclError acldvppDestroyChannel(acldvppChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief dvpp vpc resize.
*
* @par Restriction
* Width alignment requirements:
* @li The minimum stride is 32 and the maximum is 4096 * 4
* (that is, an image in argb format with a width of 4096);
* @li For 8K scaling, widthStride is required to be aligned to 2;
* @li For non 8K scaling, the calculation formula for widthStride
* is different for different image formats:
* @li yuv400sp, yuv420sp, yuv422sp, yuv444sp: input image width aligned to 16
* @li yuv422packed: input image width * 2 and then align to 16
* @li yuv444packed, rgb888: input image width alignment * 3, alignment to 16
* @li xrgb8888: input image width * 4, align to 16
* @li HFBC:input image width
* Height alignment requirements:
* @li The height of the input image is aligned to 2.
* High stride minimum 6 and maximum 4096.
* @param channelDesc [IN] the channel destruction
* @param inputDesc [IN] resize input picture destruction
* @param outputDesc [IN|OUT] resize output picture destruction
* @param resizeConfig [IN] resize config
* @param stream [IN] resize task stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppCreateChannel | acldvppCreatePicDesc
* | acldvppCreateResizeConfig
*/
ACL_FUNC_VISIBILITY aclError acldvppVpcResizeAsync(acldvppChannelDesc *channelDesc,
acldvppPicDesc *inputDesc,
acldvppPicDesc *outputDesc,
acldvppResizeConfig *resizeConfig,
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief dvpp vpc crop.
*
* @par Function
* crop the input picture according to the specified area,
* and then store the picture in the output memory as the output picture
*
* @par Restriction
* Width alignment requirements:
* @li The minimum stride is 32 and the maximum is 4096 * 4
* (that is, an image in argb format with a width of 4096);
* @li For 8K scaling, widthStride is required to be aligned to 2;
* @li For non 8K scaling, the calculation formula for widthStride
* is different for different image formats:
* @li yuv400sp, yuv420sp, yuv422sp, yuv444sp: input image width aligned to 16
* @li yuv422packed: input image width * 2 and then align to 16
* @li yuv444packed, rgb888: input image width alignment * 3, alignment to 16
* @li xrgb8888: input image width * 4, align to 16
* @li HFBC:input image width
* Height alignment requirements:
* @li The height of the input image is aligned to 2.
* High stride minimum 6 and maximum 4096.
* @param channelDesc [IN] the channel destruction
* @param inputDesc [IN] crop input picture destruction
* @param outputDesc [IN|OUT] crop output picture destruction
* @param cropArea [IN] crop area config
* @param stream [IN] crop task stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppVpcCropAsync(acldvppChannelDesc *channelDesc,
acldvppPicDesc *inputDesc,
acldvppPicDesc *outputDesc,
acldvppRoiConfig *cropArea,
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief dvpp vpc batch crop.
*
* @par Function
* crop the input batch picture according to the specified area
* as the output batch pictures
* @param channelDesc [IN] the channel destruction
* @param srcBatchPicDescs [IN|OUT] crop input batch picture destruction
* @param roiNums [IN] roi config numbers
* @param size [IN] roiNum size
* @param dstBatchPicDescs [IN|OUT] crop output batch picture destruction
* @param cropAreas [IN] crop area configs
* @param stream [IN] crop batch task stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppCreateChannel | acldvppCreateBatchPicDesc | acldvppCreateRoiConfig
*/
ACL_FUNC_VISIBILITY aclError acldvppVpcBatchCropAsync(acldvppChannelDesc *channelDesc,
acldvppBatchPicDesc *srcBatchPicDescs,
uint32_t *roiNums,
uint32_t size,
acldvppBatchPicDesc *dstBatchPicDescs,
acldvppRoiConfig *cropAreas[],
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief dvpp vpc crop and paste.
*
* @par Function
* crop the input picture according to the specified area,
* and paste the picture to the specified position of the target picture
* as the output picture
* @param channelDesc [IN] thechannel destruction
* @param inputDesc [IN] crop and paste input picture destruction
* @param outputDesc [IN|OUT] crop and paste output picture destruction
* @param cropArea [IN] crop area config
* @param pasteArea [IN] paste area config
* @param stream [IN] crop and paste task stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppCreateChannel | acldvppCreatePicDesc | acldvppCreateRoiConfig
*/
ACL_FUNC_VISIBILITY aclError acldvppVpcCropAndPasteAsync(acldvppChannelDesc *channelDesc,
acldvppPicDesc *inputDesc,
acldvppPicDesc *outputDesc,
acldvppRoiConfig *cropArea,
acldvppRoiConfig *pasteArea,
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief dvpp vpc batch crop and paste.
*
* @par Function
* crop the input batch picture according to the specified area,
* and paste the pictures to the specified position of the target pictures
* as the output batch pictures
* @param channelDesc [IN] the channel destruction
* @param srcBatchPicDescs [IN|OUT] crop input batch picture destruction
* @param roiNums [IN] roi config numbers
* @param size [IN] roiNum size
* @param dstBatchPicDescs [IN|OUT] crop output batch picture destruction
* @param cropAreas [IN] crop area configs
* @param pasteAreas [IN] paste area configs
* @param stream [IN] crop batch task stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppCreateChannel | acldvppCreateBatchPicDesc | acldvppCreateRoiConfig
*/
ACL_FUNC_VISIBILITY aclError acldvppVpcBatchCropAndPasteAsync(acldvppChannelDesc *channelDesc,
acldvppBatchPicDesc *srcBatchPicDescs,
uint32_t *roiNums,
uint32_t size,
acldvppBatchPicDesc *dstBatchPicDescs,
acldvppRoiConfig *cropAreas[],
acldvppRoiConfig *pasteAreas[],
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief dvpp vpc jpeg decode.
*
* @par Function
* For different source picture formats, after decoding,
* output pictures in the following format:
* @li jpeg(444) -> YUV444SP:V is front U is back,
* YUV420 SP V is front U is back, YUV420SP U is front V is back;
* @li jpeg(422) -> YUV422SP:V is in front U is behind,
* YUV420SP V is in front U is behind, YUV420SP U is in front V is behind;
* @li jpeg(420) -> YUV420SP:
* V is front U is back, YUV420SP U is front V is back;
* @li jpeg(400) -> YUV420SP:UV data is filled with 0 x 80.
* @param channelDesc [IN] the channel destruction
* @param data [IN] decode input picture destruction's data
* @param size [IN] decode input picture destruction's size
* @param outputDesc [IN|OUT] decode output picture destruction
* @param stream [IN] decode task stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppCreateChannel | acldvppCreatePicDesc
*/
ACL_FUNC_VISIBILITY aclError acldvppJpegDecodeAsync(acldvppChannelDesc *channelDesc,
const void *data,
uint32_t size,
acldvppPicDesc *outputDesc,
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief dvpp vpc jpeg encode.
*
* @param channelDesc [IN] the channel destruction
* @param inputDesc [IN] encode input picture destruction
* @param data [IN] encode output picture destruction's data
* @param size [IN] encode output picture destruction's size
* @param config [IN] jpeg encode config
* @param stream [IN] encode task stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppCreateChannel | acldvppCreateJpegeConfig
*/
ACL_FUNC_VISIBILITY aclError acldvppJpegEncodeAsync(acldvppChannelDesc *channelDesc,
acldvppPicDesc *inputDesc,
const void *data,
uint32_t *size,
acldvppJpegeConfig *config,
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief Create vdec channel.
*
* @par Function
* Create a channel for video data processing,
* the same channel can be reused,
* and is no longer available after destruction
* @param channelDesc [IN] the channel destruction
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclvdecCreateChannelDesc
*/
ACL_FUNC_VISIBILITY aclError aclvdecCreateChannel(aclvdecChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief Destroy vdec channel.
*
* @par Function
* Can only destroy channels created by the aclvdecCreateChannel interface
* @param channelDesc [IN] the channel destruction
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclvdecCreateChannel
*/
ACL_FUNC_VISIBILITY aclError aclvdecDestroyChannel(aclvdecChannelDesc *channelDesc);
/**
* @ingroup AscendCL
* @brief dvpp vdec send frame.
*
* @par Function
* Pass the input memory to be decoded
* and the decoded output memory to the decoder for decoding
* @param channelDesc [IN] vdec channel destruction
* @param input [IN] input stream destruction
* @param output [IN] output picture destruction
* @param config [IN] vdec frame config
* @param userData [IN] user data for callback function
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclvdecCreateChannel | acldvppCreateStreamDesc | acldvppCreatePicDesc
*/
ACL_FUNC_VISIBILITY aclError aclvdecSendFrame(aclvdecChannelDesc *channelDesc,
acldvppStreamDesc *input,
acldvppPicDesc *output,
aclvdecFrameConfig *config,
void* userData);
/**
* @ingroup AscendCL
* @brief dvpp vpc convert color.
*
* @par Restriction
* @li outputDesc:Width height stride, No changes are allowed. Just configure 0
* @par Function
* Convert color gamut
* @param channelDesc [IN|OUT] the channel destruction
* @param inputDesc [IN|OUT] convert color input picture destruction
* @param outputDesc [IN|OUT] convert color output picture destruction
* @param stream [IN] convert color task stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppCreateChannel | acldvppCreatePicDesc
*/
ACL_FUNC_VISIBILITY aclError acldvppVpcConvertColorAsync(acldvppChannelDesc *channelDesc,
acldvppPicDesc *inputDesc,
acldvppPicDesc *outputDesc,
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief dvpp vpc pyramid down.
*
* @par Restriction
* @li outputDesc:format only supported YUV400
* @par Function
* Image pyramid down
* @param channelDesc [IN|OUT] the channel destruction
* @param inputDesc [IN|OUT] pyr down input picture destruction
* @param outputDesc [IN|OUT] pyr down output picture destruction
* @param reserve [IN|OUT] reserved param , must be nullptr
* @param stream [IN] pyr down task stream
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppCreateChannel | acldvppCreatePicDesc
*/
ACL_FUNC_VISIBILITY aclError acldvppVpcPyrDownAsync(acldvppChannelDesc *channelDesc,
acldvppPicDesc *inputDesc,
acldvppPicDesc *outputDesc,
void *reserve,
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief Set dvpp channel mode.
*
* @param channelDesc [IN|OUT] the channel destruction
* @param mode [IN] channel mode
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetChannelDescMode(acldvppChannelDesc *channelDesc,
uint32_t mode);
/**
* @ingroup AscendCL
* @brief Set resize config interpolation.
*
* @param resizeConfig [IN|OUT] the resize config
* @param interpolation [IN] interpolation
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError acldvppSetResizeConfigInterpolation(acldvppResizeConfig *resizeConfig,
uint32_t interpolation);
/**
* @ingroup AscendCL
* @brief Get resize config interpolation.
* @param resizeConfig [IN] the resize config
* @retval Interpolation of resize config.
*/
ACL_FUNC_VISIBILITY uint32_t acldvppGetResizeConfigInterpolation(const acldvppResizeConfig *resizeConfig);
/**
* @ingroup AscendCL
* @brief Set vdec channel out mode.
*
* @param channelDesc [IN|OUT] the channel destruction
* @param outMode [IN] channel out mode
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescOutMode(aclvdecChannelDesc *channelDesc,
uint32_t outMode);
/**
* @ingroup AscendCL
* @brief Create dvpp batch picture description.
*
* @param batchSize [IN] batch size
* @retval null for failed.
* @retval OtherValues success.
*/
ACL_FUNC_VISIBILITY acldvppBatchPicDesc *acldvppCreateBatchPicDesc(uint32_t batchSize);
/**
* @ingroup AscendCL
* @brief Get dvpp picture description.
*
* @param batchPicDesc [IN] dvpp batch picture description.
* @param index [IN] index of batch
* @retval null for failed.
* @retval OtherValues Failure
*
* @see acldvppCreateBatchPicDesc
*/
ACL_FUNC_VISIBILITY acldvppPicDesc *acldvppGetPicDesc(acldvppBatchPicDesc *batchPicDesc, uint32_t index);
/**
* @ingroup AscendCL
* @brief Destroy dvpp batch picture description.
*
* @par Function
* Can only destroy batch picture description information created
* through acldvppCreateBatchPicDesc interface.
* @param batchPicDesc [IN] dvpp batch picture description.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see acldvppCreateBatchPicDesc
*/
ACL_FUNC_VISIBILITY aclError acldvppDestroyBatchPicDesc(acldvppBatchPicDesc *batchPicDesc);
#ifdef __cplusplus
}
#endif
#endif // INC_EXTERNAL_ACL_OPS_ACL_DVPP_H_
/* *
* @file acl_fv.h
*
* Copyright (C) Huawei Technologies Co., Ltd. 2019-2020. All Rights Reserved.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef INC_EXTERNAL_ACL_OPS_ACL_RETR_H_
#define INC_EXTERNAL_ACL_OPS_ACL_RETR_H_
#include "../acl.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct aclfvFeatureInfo aclfvFeatureInfo;
typedef struct aclfvRepoRange aclfvRepoRange;
typedef struct aclfvQueryTable aclfvQueryTable;
typedef struct aclfvSearchInput aclfvSearchInput;
typedef struct aclfvSearchResult aclfvSearchResult;
// search operation type
enum aclfvSearchType {
SEARCH_1_N, // 1:N operation type
SEARCH_N_M // N:M operation type
};
/* *
* @ingroup AscendCL
* @brief Create fv feature info.
* @param id0 [IN]: The first level library id0
* @param id1 [IN]: Secondary library id1
* @param offset [IN]: The offset of the first feature in the library
* @param featureLen [IN]: Single feature length
* @param featureCount [IN]: Single feature count
* @param featureData [IN/OUT]: Feature value list
* @param featureDataLen [IN]: Feature value list length
* @retval null for failed.
* @retval OtherValues success.
*/
ACL_FUNC_VISIBILITY aclfvFeatureInfo *aclfvCreateFeatureInfo(uint32_t id0, uint32_t id1, uint32_t offset,
uint32_t featureLen, uint32_t featureCount, uint8_t *featureData, uint32_t featureDataLen);
/* *
* @ingroup AscendCL
* @brief Destroy fv feature info.
*
* @par Function
* Can only destroy fv feature info information created
* through aclfvCreateFeatureInfo interface.
* @param featureInfo [IN/OUT] fv feature info.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclfvCreateFeatureInfo
*/
ACL_FUNC_VISIBILITY aclError aclfvDestroyFeatureInfo(aclfvFeatureInfo *featureInfo);
/* *
* @ingroup AscendCL
* @brief Create fv repo range.
* @param id0Min [IN]: id0 start value
* @param id0Min [IN]: id0 max
* @param id1Min [IN]: id0 start value
* @param id1Max [IN]: id1 max
* @retval null for failed. OtherValues success
*/
ACL_FUNC_VISIBILITY aclfvRepoRange *aclfvCreateRepoRange(uint32_t id0Min, uint32_t id0Max, uint32_t id1Min,
uint32_t id1Max);
/* *
* @ingroup AscendCL
* @brief Destroy fv repo range.
*
* @par Function
* Can only destroy fv repo range information created
* through aclfvCreateRepoRange interface.
* @param repoRange [IN/OUT] fv repo range.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclfvCreateRepoRange
*/
ACL_FUNC_VISIBILITY aclError aclfvDestroyRepoRange(aclfvRepoRange *repoRange);
/* *
* @ingroup AscendCL
* @brief Create query table.
* @param queryCnt [IN]: Number of tables, the maximum number is 6
* @param tableLen [IN]: Single table length, table length is 32KB
* @param tableData [IN/OUT]: Feature value list
* @param tableDataLen [IN]: The length of memory requested by the featureData
* pointer
* @retval null for failed. OtherValues success
*/
ACL_FUNC_VISIBILITY aclfvQueryTable *aclfvCreateQueryTable(uint32_t queryCnt, uint32_t tableLen, uint8_t *tableData,
uint32_t tableDataLen);
/* *
* @ingroup AscendCL
* @brief Destroy query table.
*
* @par Function
* Can only destroy query table information created
* through aclfvCreateQueryTable interface.
* @param queryTable [IN/OUT] query table.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclfvCreateQueryTable
*/
ACL_FUNC_VISIBILITY aclError aclfvDestroyQueryTable(aclfvQueryTable *queryTable);
/* *
* @ingroup AscendCL
* @brief Create search input.
* @param queryTable [IN/OUT]: query table
* @param repoRange [IN/OUT]: query repo range
* @param topk [IN]: query topk
* @retval null for failed. OtherValues success
*/
ACL_FUNC_VISIBILITY aclfvSearchInput *aclfvCreateSearchInput(aclfvQueryTable *queryTable, aclfvRepoRange *repoRange,
uint32_t topk);
/* *
* @ingroup AscendCL
* @brief Destroy search input.
*
* @par Function
* Can only destroy search input information created
* through aclfvCreateSearchInput interface.
* @param searchInput [IN/OUT] search input.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclfvCreateSearchInput
*/
ACL_FUNC_VISIBILITY aclError aclfvDestroySearchInput(aclfvSearchInput *searchInput);
/* *
* @ingroup AscendCL
* @brief Create search result.
* @param queryCnt [IN]: Retrieve the number of features
* @param resultNum [IN/OUT]: The number of search results for each feature, the
* number is queryCnt
* @param resultNumDataLen [IN]: resultNum memory length
* @param id0 [IN/OUT]: Level 1 library id0
* @param id1 [IN/OUT]: Secondary library id1
* @param resultOffset [IN/OUT]: The offset of the bottom library corresponding
* to each feature retrieval result, total length topK * queryCnt
* @param resultDistance [IN/OUT]: Distance, total length topK * queryCnt
* @param dataLen [IN]: The memory size requested by
* id0\id1\reslutOffset\resultDistance
* @retval null for failed. OtherValues success
*/
ACL_FUNC_VISIBILITY aclfvSearchResult *aclfvCreateSearchResult(uint32_t queryCnt, uint32_t *resultNum,
uint32_t resultNumDataLen, uint32_t *id0, uint32_t *id1, uint32_t *resultOffset, float *resultDistance,
uint32_t dataLen);
/* *
* @ingroup AscendCL
* @brief Destroy search result.
*
* @par Function
* Can only destroy search result information created
* through aclfvCreateSearchResult interface.
* @param searchResult [IN/OUT] search result.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclfvCreateSearchResult
*/
ACL_FUNC_VISIBILITY aclError aclfvDestroySearchResult(aclfvSearchResult *searchResult);
/* *
* @ingroup AscendCL
* @brief fv IP initialize.
*
* @param fsNum [IN] max repo num, used to apply for memory.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure.
*/
ACL_FUNC_VISIBILITY aclError aclfvInit(uint64_t fsNum);
/* *
* @ingroup AscendCL
* @brief release fv resources.
*
* @par Function
* Can only release fv resources created
* through aclfvInit interface.
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure.
*
* @see aclfvInit
*/
ACL_FUNC_VISIBILITY aclError aclfvRelease();
/* *
* @ingroup AscendCL
* @brief fv repo add.
* @param type [IN]: repo add type
* @param featureInfo [IN/OUT]: add feature information
* @param stream [IN]: stream of task execute
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure.
*/
ACL_FUNC_VISIBILITY aclError aclfvRepoAdd(aclfvSearchType type, aclfvFeatureInfo *featureInfo, aclrtStream stream);
/* *
* @ingroup AscendCL
* @brief fv repo del.
* @param type [IN]: repo delete type
* @param repoRange [IN/OUT]: repo range information
* @param stream [IN]: stream of task execute
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure.
*/
ACL_FUNC_VISIBILITY aclError aclfvRepoDel(aclfvSearchType type, aclfvRepoRange *repoRange, aclrtStream stream);
/* *
* @ingroup AscendCL
* @brief fv accurate del.
* @param featureInfo [IN/OUT]: accurate delete feature information
* @param stream [IN]: stream of task execute
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure.
*/
ACL_FUNC_VISIBILITY aclError aclfvDel(aclfvFeatureInfo *featureInfo, aclrtStream stream);
/* *
* @ingroup AscendCL
* @brief fv accurate modify.
* @param featureInfo [IN/OUT]: accurate modify feature information
* @param stream [IN]: stream of task execute
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure.
*/
ACL_FUNC_VISIBILITY aclError aclfvModify(aclfvFeatureInfo *featureInfo, aclrtStream stream);
/* *
* @ingroup AscendCL
* @brief fv search.
* @param type [IN]: search type
* @param searchInput [IN/OUT]: search input
* @param searchRst [IN/OUT]: search result
* @param stream [IN]: stream of task execute
* @retval ACL_ERROR_NONE The function is successfully executed.
* @retval OtherValues Failure.
*/
ACL_FUNC_VISIBILITY aclError aclfvSearch(aclfvSearchType type, aclfvSearchInput *searchInput,
aclfvSearchResult *searchRst, aclrtStream stream);
#ifdef __cplusplus
}
#endif
#endif // INC_EXTERNAL_ACL_OPS_ACL_RETR_H_
/**
* \file dnn/atlas-stub/src/libacl_cblas-wrap.cpp
* MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
*
* Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied.
*/
#pragma GCC visibility push(default)
#include <cstdio>
#define LOGE(fmt, v...) fprintf(stderr, "err: " fmt "\n", ##v)
#include "acl/acl.h"
#include "acl/ops/acl_cblas.h"
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#if defined(_WIN32)
#include <windows.h>
#define RTLD_LAZY 0
static void* dlopen(const char* file, int) {
return static_cast<void*>(LoadLibraryA(file));
}
static void* dlerror() {
const char* errmsg = "dlerror not aviable in windows";
return const_cast<char*>(errmsg);
}
static void* dlsym(void* handle, const char* name) {
FARPROC symbol = GetProcAddress((HMODULE)handle, name);
return reinterpret_cast<void*>(symbol);
}
#else
#include <dlfcn.h>
#include <unistd.h>
#endif
static void log_failed_load(int func_idx);
namespace {
template <typename T>
T on_init_failed(int func_idx);
template <>
aclError on_init_failed(int func_idx) {
log_failed_load(func_idx);
return ACL_ERROR_INTERNAL_ERROR;
}
} // namespace
#include "./libacl_cblas-wrap.h"
static const char* default_so_paths[] = {
"/usr/local/Ascend/acllib/lib64/libacl_cblas.so",
"libacl_cblas.so",
};
static void* get_library_handle() {
void* handle = nullptr;
for (size_t i = 0; i < (sizeof(default_so_paths) / sizeof(char*)); i++) {
handle = dlopen(default_so_paths[i], RTLD_LAZY);
if (handle) {
break;
}
}
if (!handle) {
LOGE("Failed to load atlas library");
return nullptr;
}
return handle;
}
static void log_failed_load(int func_idx) {
LOGE("failed to load atlas func: %s", g_func_name[func_idx]);
}
static void* resolve_library_func(void* handle, const char* func) {
if (!handle) {
LOGE("handle should not be nullptr!");
return nullptr;
}
auto ret = dlsym(handle, func);
if (!ret) {
LOGE("failed to load atlas func: %s", func);
}
return ret;
}
// generated by wraplib.py
// --- begin functions to be implemented
#ifndef _WRAPLIB_API_CALL
#define _WRAPLIB_API_CALL
#endif
#ifndef _WRAPLIB_CALLBACK
#define _WRAPLIB_CALLBACK
#endif
#ifndef ON_ENTRY
#define ON_ENTRY(x)
#endif
static void* get_library_handle();
static void* resolve_library_func(void* , const char*);
namespace {
template<typename T> T on_init_failed(int func_idx);
}
// --- end functions to be implemented
#include <mutex>
#include <cstddef>
static void load_library();
static aclError _WRAPLIB_API_CALL aclblasGemvEx_init(aclTransType arg0, int arg1, int arg2, const void *arg3, const void *arg4, int arg5, aclDataType arg6, const void *arg7, int arg8, aclDataType arg9, const void *arg10, void *arg11, int arg12, aclDataType arg13, aclComputeType arg14, aclrtStream arg15) {
load_library();
return aclblasGemvEx(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15);
}
static aclError _WRAPLIB_API_CALL aclblasGemvEx_error(aclTransType, int, int, const void *, const void *, int, aclDataType, const void *, int, aclDataType, const void *, void *, int, aclDataType, aclComputeType, aclrtStream) {
return on_init_failed<aclError >(0);
}
static aclError _WRAPLIB_API_CALL aclblasCreateHandleForGemvEx_init(aclTransType arg0, int arg1, int arg2, aclDataType arg3, aclDataType arg4, aclDataType arg5, aclComputeType arg6, aclopHandle **arg7) {
load_library();
return aclblasCreateHandleForGemvEx(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
}
static aclError _WRAPLIB_API_CALL aclblasCreateHandleForGemvEx_error(aclTransType, int, int, aclDataType, aclDataType, aclDataType, aclComputeType, aclopHandle **) {
return on_init_failed<aclError >(1);
}
static aclError _WRAPLIB_API_CALL aclblasHgemv_init(aclTransType arg0, int arg1, int arg2, const aclFloat16 *arg3, const aclFloat16 *arg4, int arg5, const aclFloat16 *arg6, int arg7, const aclFloat16 *arg8, aclFloat16 *arg9, int arg10, aclComputeType arg11, aclrtStream arg12) {
load_library();
return aclblasHgemv(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
}
static aclError _WRAPLIB_API_CALL aclblasHgemv_error(aclTransType, int, int, const aclFloat16 *, const aclFloat16 *, int, const aclFloat16 *, int, const aclFloat16 *, aclFloat16 *, int, aclComputeType, aclrtStream) {
return on_init_failed<aclError >(2);
}
static aclError _WRAPLIB_API_CALL aclblasCreateHandleForHgemv_init(aclTransType arg0, int arg1, int arg2, aclComputeType arg3, aclopHandle **arg4) {
load_library();
return aclblasCreateHandleForHgemv(arg0, arg1, arg2, arg3, arg4);
}
static aclError _WRAPLIB_API_CALL aclblasCreateHandleForHgemv_error(aclTransType, int, int, aclComputeType, aclopHandle **) {
return on_init_failed<aclError >(3);
}
static aclError _WRAPLIB_API_CALL aclblasS8gemv_init(aclTransType arg0, int arg1, int arg2, const int32_t *arg3, const int8_t *arg4, int arg5, const int8_t *arg6, int arg7, const int32_t *arg8, int32_t *arg9, int arg10, aclComputeType arg11, aclrtStream arg12) {
load_library();
return aclblasS8gemv(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
}
static aclError _WRAPLIB_API_CALL aclblasS8gemv_error(aclTransType, int, int, const int32_t *, const int8_t *, int, const int8_t *, int, const int32_t *, int32_t *, int, aclComputeType, aclrtStream) {
return on_init_failed<aclError >(4);
}
static aclError _WRAPLIB_API_CALL aclblasCreateHandleForS8gemv_init(aclTransType arg0, int arg1, int arg2, aclComputeType arg3, aclopHandle **arg4) {
load_library();
return aclblasCreateHandleForS8gemv(arg0, arg1, arg2, arg3, arg4);
}
static aclError _WRAPLIB_API_CALL aclblasCreateHandleForS8gemv_error(aclTransType, int, int, aclComputeType, aclopHandle **) {
return on_init_failed<aclError >(5);
}
static aclError _WRAPLIB_API_CALL aclblasGemmEx_init(aclTransType arg0, aclTransType arg1, aclTransType arg2, int arg3, int arg4, int arg5, const void *arg6, const void *arg7, int arg8, aclDataType arg9, const void *arg10, int arg11, aclDataType arg12, const void *arg13, void *arg14, int arg15, aclDataType arg16, aclComputeType arg17, aclrtStream arg18) {
load_library();
return aclblasGemmEx(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18);
}
static aclError _WRAPLIB_API_CALL aclblasGemmEx_error(aclTransType, aclTransType, aclTransType, int, int, int, const void *, const void *, int, aclDataType, const void *, int, aclDataType, const void *, void *, int, aclDataType, aclComputeType, aclrtStream) {
return on_init_failed<aclError >(6);
}
static aclError _WRAPLIB_API_CALL aclblasCreateHandleForGemmEx_init(aclTransType arg0, aclTransType arg1, aclTransType arg2, int arg3, int arg4, int arg5, aclDataType arg6, aclDataType arg7, aclDataType arg8, aclComputeType arg9, aclopHandle **arg10) {
load_library();
return aclblasCreateHandleForGemmEx(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
}
static aclError _WRAPLIB_API_CALL aclblasCreateHandleForGemmEx_error(aclTransType, aclTransType, aclTransType, int, int, int, aclDataType, aclDataType, aclDataType, aclComputeType, aclopHandle **) {
return on_init_failed<aclError >(7);
}
static aclError _WRAPLIB_API_CALL aclblasHgemm_init(aclTransType arg0, aclTransType arg1, aclTransType arg2, int arg3, int arg4, int arg5, const aclFloat16 *arg6, const aclFloat16 *arg7, int arg8, const aclFloat16 *arg9, int arg10, const aclFloat16 *arg11, aclFloat16 *arg12, int arg13, aclComputeType arg14, aclrtStream arg15) {
load_library();
return aclblasHgemm(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15);
}
static aclError _WRAPLIB_API_CALL aclblasHgemm_error(aclTransType, aclTransType, aclTransType, int, int, int, const aclFloat16 *, const aclFloat16 *, int, const aclFloat16 *, int, const aclFloat16 *, aclFloat16 *, int, aclComputeType, aclrtStream) {
return on_init_failed<aclError >(8);
}
static aclError _WRAPLIB_API_CALL aclblasCreateHandleForHgemm_init(aclTransType arg0, aclTransType arg1, aclTransType arg2, int arg3, int arg4, int arg5, aclComputeType arg6, aclopHandle **arg7) {
load_library();
return aclblasCreateHandleForHgemm(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
}
static aclError _WRAPLIB_API_CALL aclblasCreateHandleForHgemm_error(aclTransType, aclTransType, aclTransType, int, int, int, aclComputeType, aclopHandle **) {
return on_init_failed<aclError >(9);
}
static aclError _WRAPLIB_API_CALL aclblasS8gemm_init(aclTransType arg0, aclTransType arg1, aclTransType arg2, int arg3, int arg4, int arg5, const int32_t *arg6, const int8_t *arg7, int arg8, const int8_t *arg9, int arg10, const int32_t *arg11, int32_t *arg12, int arg13, aclComputeType arg14, aclrtStream arg15) {
load_library();
return aclblasS8gemm(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15);
}
static aclError _WRAPLIB_API_CALL aclblasS8gemm_error(aclTransType, aclTransType, aclTransType, int, int, int, const int32_t *, const int8_t *, int, const int8_t *, int, const int32_t *, int32_t *, int, aclComputeType, aclrtStream) {
return on_init_failed<aclError >(10);
}
static aclError _WRAPLIB_API_CALL aclblasCreateHandleForS8gemm_init(aclTransType arg0, aclTransType arg1, aclTransType arg2, int arg3, int arg4, int arg5, aclComputeType arg6, aclopHandle **arg7) {
load_library();
return aclblasCreateHandleForS8gemm(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
}
static aclError _WRAPLIB_API_CALL aclblasCreateHandleForS8gemm_error(aclTransType, aclTransType, aclTransType, int, int, int, aclComputeType, aclopHandle **) {
return on_init_failed<aclError >(11);
}
static constexpr size_t NR_FUNC = 12;
static void* g_func_table[NR_FUNC] = {(void*)(&aclblasGemvEx_init),
(void*)(&aclblasCreateHandleForGemvEx_init),
(void*)(&aclblasHgemv_init),
(void*)(&aclblasCreateHandleForHgemv_init),
(void*)(&aclblasS8gemv_init),
(void*)(&aclblasCreateHandleForS8gemv_init),
(void*)(&aclblasGemmEx_init),
(void*)(&aclblasCreateHandleForGemmEx_init),
(void*)(&aclblasHgemm_init),
(void*)(&aclblasCreateHandleForHgemm_init),
(void*)(&aclblasS8gemm_init),
(void*)(&aclblasCreateHandleForS8gemm_init)};
static void* g_func_table_error[NR_FUNC] = {(void*)(&aclblasGemvEx_error),
(void*)(&aclblasCreateHandleForGemvEx_error),
(void*)(&aclblasHgemv_error),
(void*)(&aclblasCreateHandleForHgemv_error),
(void*)(&aclblasS8gemv_error),
(void*)(&aclblasCreateHandleForS8gemv_error),
(void*)(&aclblasGemmEx_error),
(void*)(&aclblasCreateHandleForGemmEx_error),
(void*)(&aclblasHgemm_error),
(void*)(&aclblasCreateHandleForHgemm_error),
(void*)(&aclblasS8gemm_error),
(void*)(&aclblasCreateHandleForS8gemm_error)};
static const char* const g_func_name[NR_FUNC] = {"aclblasGemvEx",
"aclblasCreateHandleForGemvEx",
"aclblasHgemv",
"aclblasCreateHandleForHgemv",
"aclblasS8gemv",
"aclblasCreateHandleForS8gemv",
"aclblasGemmEx",
"aclblasCreateHandleForGemmEx",
"aclblasHgemm",
"aclblasCreateHandleForHgemm",
"aclblasS8gemm",
"aclblasCreateHandleForS8gemm"};
static void load_library() {
static bool done = false;
static std::mutex mtx;
std::lock_guard<std::mutex> lg{mtx};
if (done)
return;
void* handle = get_library_handle();
for (size_t i = 0; i < NR_FUNC; ++i) {
void* func;
if (!handle) {
func = nullptr;
} else {
func = resolve_library_func(handle, g_func_name[i]);
}
if (!func) {
func = g_func_table_error[i];
}
__atomic_store_n(g_func_table + i, func, __ATOMIC_RELAXED);
}
done = true;
}
aclError _WRAPLIB_API_CALL aclblasGemvEx(aclTransType arg0, int arg1, int arg2, const void *arg3, const void *arg4, int arg5, aclDataType arg6, const void *arg7, int arg8, aclDataType arg9, const void *arg10, void *arg11, int arg12, aclDataType arg13, aclComputeType arg14, aclrtStream arg15) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclTransType, int, int, const void *, const void *, int, aclDataType, const void *, int, aclDataType, const void *, void *, int, aclDataType, aclComputeType, aclrtStream);
ON_ENTRY(aclblasGemvEx);
f_ptr_t f = (f_ptr_t)(g_func_table[0]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15);
}
aclError _WRAPLIB_API_CALL aclblasCreateHandleForGemvEx(aclTransType arg0, int arg1, int arg2, aclDataType arg3, aclDataType arg4, aclDataType arg5, aclComputeType arg6, aclopHandle **arg7) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclTransType, int, int, aclDataType, aclDataType, aclDataType, aclComputeType, aclopHandle **);
ON_ENTRY(aclblasCreateHandleForGemvEx);
f_ptr_t f = (f_ptr_t)(g_func_table[1]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
}
aclError _WRAPLIB_API_CALL aclblasHgemv(aclTransType arg0, int arg1, int arg2, const aclFloat16 *arg3, const aclFloat16 *arg4, int arg5, const aclFloat16 *arg6, int arg7, const aclFloat16 *arg8, aclFloat16 *arg9, int arg10, aclComputeType arg11, aclrtStream arg12) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclTransType, int, int, const aclFloat16 *, const aclFloat16 *, int, const aclFloat16 *, int, const aclFloat16 *, aclFloat16 *, int, aclComputeType, aclrtStream);
ON_ENTRY(aclblasHgemv);
f_ptr_t f = (f_ptr_t)(g_func_table[2]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
}
aclError _WRAPLIB_API_CALL aclblasCreateHandleForHgemv(aclTransType arg0, int arg1, int arg2, aclComputeType arg3, aclopHandle **arg4) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclTransType, int, int, aclComputeType, aclopHandle **);
ON_ENTRY(aclblasCreateHandleForHgemv);
f_ptr_t f = (f_ptr_t)(g_func_table[3]);
return f(arg0, arg1, arg2, arg3, arg4);
}
aclError _WRAPLIB_API_CALL aclblasS8gemv(aclTransType arg0, int arg1, int arg2, const int32_t *arg3, const int8_t *arg4, int arg5, const int8_t *arg6, int arg7, const int32_t *arg8, int32_t *arg9, int arg10, aclComputeType arg11, aclrtStream arg12) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclTransType, int, int, const int32_t *, const int8_t *, int, const int8_t *, int, const int32_t *, int32_t *, int, aclComputeType, aclrtStream);
ON_ENTRY(aclblasS8gemv);
f_ptr_t f = (f_ptr_t)(g_func_table[4]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
}
aclError _WRAPLIB_API_CALL aclblasCreateHandleForS8gemv(aclTransType arg0, int arg1, int arg2, aclComputeType arg3, aclopHandle **arg4) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclTransType, int, int, aclComputeType, aclopHandle **);
ON_ENTRY(aclblasCreateHandleForS8gemv);
f_ptr_t f = (f_ptr_t)(g_func_table[5]);
return f(arg0, arg1, arg2, arg3, arg4);
}
aclError _WRAPLIB_API_CALL aclblasGemmEx(aclTransType arg0, aclTransType arg1, aclTransType arg2, int arg3, int arg4, int arg5, const void *arg6, const void *arg7, int arg8, aclDataType arg9, const void *arg10, int arg11, aclDataType arg12, const void *arg13, void *arg14, int arg15, aclDataType arg16, aclComputeType arg17, aclrtStream arg18) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclTransType, aclTransType, aclTransType, int, int, int, const void *, const void *, int, aclDataType, const void *, int, aclDataType, const void *, void *, int, aclDataType, aclComputeType, aclrtStream);
ON_ENTRY(aclblasGemmEx);
f_ptr_t f = (f_ptr_t)(g_func_table[6]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18);
}
aclError _WRAPLIB_API_CALL aclblasCreateHandleForGemmEx(aclTransType arg0, aclTransType arg1, aclTransType arg2, int arg3, int arg4, int arg5, aclDataType arg6, aclDataType arg7, aclDataType arg8, aclComputeType arg9, aclopHandle **arg10) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclTransType, aclTransType, aclTransType, int, int, int, aclDataType, aclDataType, aclDataType, aclComputeType, aclopHandle **);
ON_ENTRY(aclblasCreateHandleForGemmEx);
f_ptr_t f = (f_ptr_t)(g_func_table[7]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
}
aclError _WRAPLIB_API_CALL aclblasHgemm(aclTransType arg0, aclTransType arg1, aclTransType arg2, int arg3, int arg4, int arg5, const aclFloat16 *arg6, const aclFloat16 *arg7, int arg8, const aclFloat16 *arg9, int arg10, const aclFloat16 *arg11, aclFloat16 *arg12, int arg13, aclComputeType arg14, aclrtStream arg15) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclTransType, aclTransType, aclTransType, int, int, int, const aclFloat16 *, const aclFloat16 *, int, const aclFloat16 *, int, const aclFloat16 *, aclFloat16 *, int, aclComputeType, aclrtStream);
ON_ENTRY(aclblasHgemm);
f_ptr_t f = (f_ptr_t)(g_func_table[8]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15);
}
aclError _WRAPLIB_API_CALL aclblasCreateHandleForHgemm(aclTransType arg0, aclTransType arg1, aclTransType arg2, int arg3, int arg4, int arg5, aclComputeType arg6, aclopHandle **arg7) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclTransType, aclTransType, aclTransType, int, int, int, aclComputeType, aclopHandle **);
ON_ENTRY(aclblasCreateHandleForHgemm);
f_ptr_t f = (f_ptr_t)(g_func_table[9]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
}
aclError _WRAPLIB_API_CALL aclblasS8gemm(aclTransType arg0, aclTransType arg1, aclTransType arg2, int arg3, int arg4, int arg5, const int32_t *arg6, const int8_t *arg7, int arg8, const int8_t *arg9, int arg10, const int32_t *arg11, int32_t *arg12, int arg13, aclComputeType arg14, aclrtStream arg15) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclTransType, aclTransType, aclTransType, int, int, int, const int32_t *, const int8_t *, int, const int8_t *, int, const int32_t *, int32_t *, int, aclComputeType, aclrtStream);
ON_ENTRY(aclblasS8gemm);
f_ptr_t f = (f_ptr_t)(g_func_table[10]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15);
}
aclError _WRAPLIB_API_CALL aclblasCreateHandleForS8gemm(aclTransType arg0, aclTransType arg1, aclTransType arg2, int arg3, int arg4, int arg5, aclComputeType arg6, aclopHandle **arg7) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclTransType, aclTransType, aclTransType, int, int, int, aclComputeType, aclopHandle **);
ON_ENTRY(aclblasCreateHandleForS8gemm);
f_ptr_t f = (f_ptr_t)(g_func_table[11]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
}
/**
* \file dnn/atlas-stub/src/libatlas-wrap.cpp
* MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
*
* Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied.
*/
#pragma GCC visibility push(default)
#include <cstdio>
#define LOGE(fmt, v...) fprintf(stderr, "err: " fmt "\n", ##v)
#include "acl/acl.h"
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#if defined(_WIN32)
#include <windows.h>
#define RTLD_LAZY 0
static void* dlopen(const char* file, int) {
return static_cast<void*>(LoadLibraryA(file));
}
static void* dlerror() {
const char* errmsg = "dlerror not aviable in windows";
return const_cast<char*>(errmsg);
}
static void* dlsym(void* handle, const char* name) {
FARPROC symbol = GetProcAddress((HMODULE)handle, name);
return reinterpret_cast<void*>(symbol);
}
#else
#include <dlfcn.h>
#include <unistd.h>
#endif
static void log_failed_load(int func_idx);
namespace {
template <typename T>
T on_init_failed(int func_idx);
template <>
float on_init_failed(int func_idx) {
log_failed_load(func_idx);
return 0.f;
}
template <>
aclFloat16 on_init_failed(int func_idx) {
log_failed_load(func_idx);
return 0;
}
template <>
aclDataBuffer* on_init_failed(int func_idx) {
log_failed_load(func_idx);
return nullptr;
}
template <>
aclError on_init_failed(int func_idx) {
log_failed_load(func_idx);
return ACL_ERROR_INTERNAL_ERROR;
}
template <>
void* on_init_failed(int func_idx) {
log_failed_load(func_idx);
return nullptr;
}
template <>
uint32_t on_init_failed(int func_idx) {
log_failed_load(func_idx);
return 0;
}
template <>
size_t on_init_failed(int func_idx) {
log_failed_load(func_idx);
return 0;
}
template <>
void on_init_failed(int func_idx) {
log_failed_load(func_idx);
}
template <>
int64_t on_init_failed(int func_idx) {
log_failed_load(func_idx);
return 0;
}
template <>
const char* on_init_failed(int func_idx) {
log_failed_load(func_idx);
return "load lib failed";
}
template <>
aclopAttr* on_init_failed(int func_idx) {
log_failed_load(func_idx);
return nullptr;
}
template <>
aclmdlDesc* on_init_failed(int func_idx) {
log_failed_load(func_idx);
return nullptr;
}
template <>
aclmdlDataset* on_init_failed(int func_idx) {
log_failed_load(func_idx);
return nullptr;
}
template <>
aclFormat on_init_failed(int func_idx) {
log_failed_load(func_idx);
return ACL_FORMAT_UNDEFINED;
}
template <>
aclTensorDesc* on_init_failed(int func_idx) {
log_failed_load(func_idx);
return nullptr;
}
template <>
aclDataType on_init_failed(int func_idx) {
log_failed_load(func_idx);
return ACL_DT_UNDEFINED;
}
template <>
aclmdlAIPP* on_init_failed(int func_idx) {
log_failed_load(func_idx);
return nullptr;
}
} // namespace
#include "./libatlas-wrap.h"
static const char* default_so_paths[] = {
"/usr/local/Ascend/acllib/lib64/libascendcl.so",
"libascendcl.so",
};
static void* get_library_handle() {
void* handle = nullptr;
for (size_t i = 0; i < (sizeof(default_so_paths) / sizeof(char*)); i++) {
handle = dlopen(default_so_paths[i], RTLD_LAZY);
if (handle) {
break;
}
}
if (!handle) {
LOGE("Failed to load atlas library");
return nullptr;
}
return handle;
}
static void log_failed_load(int func_idx) {
LOGE("failed to load atlas func: %s", g_func_name[func_idx]);
}
static void* resolve_library_func(void* handle, const char* func) {
if (!handle) {
LOGE("handle should not be nullptr!");
return nullptr;
}
auto ret = dlsym(handle, func);
if (!ret) {
LOGE("failed to load atlas func: %s", func);
}
return ret;
}
// generated by wraplib.py
// --- begin functions to be implemented
#ifndef _WRAPLIB_API_CALL
#define _WRAPLIB_API_CALL
#endif
#ifndef _WRAPLIB_CALLBACK
#define _WRAPLIB_CALLBACK
#endif
#ifndef ON_ENTRY
#define ON_ENTRY(x)
#endif
static void* get_library_handle();
static void* resolve_library_func(void* , const char*);
namespace {
template<typename T> T on_init_failed(int func_idx);
}
// --- end functions to be implemented
#include <mutex>
#include <cstddef>
static void load_library();
static float _WRAPLIB_API_CALL aclFloat16ToFloat_init(aclFloat16 arg0) {
load_library();
return aclFloat16ToFloat(arg0);
}
static float _WRAPLIB_API_CALL aclFloat16ToFloat_error(aclFloat16) {
return on_init_failed<float >(0);
}
static aclFloat16 _WRAPLIB_API_CALL aclFloatToFloat16_init(float arg0) {
load_library();
return aclFloatToFloat16(arg0);
}
static aclFloat16 _WRAPLIB_API_CALL aclFloatToFloat16_error(float) {
return on_init_failed<aclFloat16 >(1);
}
static aclDataBuffer _WRAPLIB_API_CALL *aclCreateDataBuffer_init(void *arg0, size_t arg1) {
load_library();
return aclCreateDataBuffer(arg0, arg1);
}
static aclDataBuffer _WRAPLIB_API_CALL *aclCreateDataBuffer_error(void *, size_t) {
return on_init_failed<aclDataBuffer *>(2);
}
static aclError _WRAPLIB_API_CALL aclDestroyDataBuffer_init(const aclDataBuffer *arg0) {
load_library();
return aclDestroyDataBuffer(arg0);
}
static aclError _WRAPLIB_API_CALL aclDestroyDataBuffer_error(const aclDataBuffer *) {
return on_init_failed<aclError >(3);
}
static void _WRAPLIB_API_CALL *aclGetDataBufferAddr_init(const aclDataBuffer *arg0) {
load_library();
return aclGetDataBufferAddr(arg0);
}
static void _WRAPLIB_API_CALL *aclGetDataBufferAddr_error(const aclDataBuffer *) {
return on_init_failed<void *>(4);
}
static uint32_t _WRAPLIB_API_CALL aclGetDataBufferSize_init(const aclDataBuffer *arg0) {
load_library();
return aclGetDataBufferSize(arg0);
}
static uint32_t _WRAPLIB_API_CALL aclGetDataBufferSize_error(const aclDataBuffer *) {
return on_init_failed<uint32_t >(5);
}
static size_t _WRAPLIB_API_CALL aclDataTypeSize_init(aclDataType arg0) {
load_library();
return aclDataTypeSize(arg0);
}
static size_t _WRAPLIB_API_CALL aclDataTypeSize_error(aclDataType) {
return on_init_failed<size_t >(6);
}
static aclTensorDesc _WRAPLIB_API_CALL *aclCreateTensorDesc_init(aclDataType arg0, int arg1, const int64_t *arg2, aclFormat arg3) {
load_library();
return aclCreateTensorDesc(arg0, arg1, arg2, arg3);
}
static aclTensorDesc _WRAPLIB_API_CALL *aclCreateTensorDesc_error(aclDataType, int, const int64_t *, aclFormat) {
return on_init_failed<aclTensorDesc *>(7);
}
static void _WRAPLIB_API_CALL aclDestroyTensorDesc_init(const aclTensorDesc *arg0) {
load_library();
return aclDestroyTensorDesc(arg0);
}
static void _WRAPLIB_API_CALL aclDestroyTensorDesc_error(const aclTensorDesc *) {
return on_init_failed<void >(8);
}
static aclDataType _WRAPLIB_API_CALL aclGetTensorDescType_init(const aclTensorDesc *arg0) {
load_library();
return aclGetTensorDescType(arg0);
}
static aclDataType _WRAPLIB_API_CALL aclGetTensorDescType_error(const aclTensorDesc *) {
return on_init_failed<aclDataType >(9);
}
static aclFormat _WRAPLIB_API_CALL aclGetTensorDescFormat_init(const aclTensorDesc *arg0) {
load_library();
return aclGetTensorDescFormat(arg0);
}
static aclFormat _WRAPLIB_API_CALL aclGetTensorDescFormat_error(const aclTensorDesc *) {
return on_init_failed<aclFormat >(10);
}
static size_t _WRAPLIB_API_CALL aclGetTensorDescSize_init(const aclTensorDesc *arg0) {
load_library();
return aclGetTensorDescSize(arg0);
}
static size_t _WRAPLIB_API_CALL aclGetTensorDescSize_error(const aclTensorDesc *) {
return on_init_failed<size_t >(11);
}
static size_t _WRAPLIB_API_CALL aclGetTensorDescElementCount_init(const aclTensorDesc *arg0) {
load_library();
return aclGetTensorDescElementCount(arg0);
}
static size_t _WRAPLIB_API_CALL aclGetTensorDescElementCount_error(const aclTensorDesc *) {
return on_init_failed<size_t >(12);
}
static size_t _WRAPLIB_API_CALL aclGetTensorDescNumDims_init(const aclTensorDesc *arg0) {
load_library();
return aclGetTensorDescNumDims(arg0);
}
static size_t _WRAPLIB_API_CALL aclGetTensorDescNumDims_error(const aclTensorDesc *) {
return on_init_failed<size_t >(13);
}
static int64_t _WRAPLIB_API_CALL aclGetTensorDescDim_init(const aclTensorDesc *arg0, size_t arg1) {
load_library();
return aclGetTensorDescDim(arg0, arg1);
}
static int64_t _WRAPLIB_API_CALL aclGetTensorDescDim_error(const aclTensorDesc *, size_t) {
return on_init_failed<int64_t >(14);
}
static void _WRAPLIB_API_CALL aclSetTensorDescName_init(aclTensorDesc *arg0, const char *arg1) {
load_library();
return aclSetTensorDescName(arg0, arg1);
}
static void _WRAPLIB_API_CALL aclSetTensorDescName_error(aclTensorDesc *, const char *) {
return on_init_failed<void >(15);
}
static const char _WRAPLIB_API_CALL *aclGetTensorDescName_init(aclTensorDesc *arg0) {
load_library();
return aclGetTensorDescName(arg0);
}
static const char _WRAPLIB_API_CALL *aclGetTensorDescName_error(aclTensorDesc *) {
return on_init_failed<const char *>(16);
}
static aclError _WRAPLIB_API_CALL aclTransTensorDescFormat_init(const aclTensorDesc *arg0, aclFormat arg1, aclTensorDesc **arg2) {
load_library();
return aclTransTensorDescFormat(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclTransTensorDescFormat_error(const aclTensorDesc *, aclFormat, aclTensorDesc **) {
return on_init_failed<aclError >(17);
}
static aclError _WRAPLIB_API_CALL aclSetTensorStorageFormat_init(aclTensorDesc *arg0, aclFormat arg1) {
load_library();
return aclSetTensorStorageFormat(arg0, arg1);
}
static aclError _WRAPLIB_API_CALL aclSetTensorStorageFormat_error(aclTensorDesc *, aclFormat) {
return on_init_failed<aclError >(18);
}
static aclError _WRAPLIB_API_CALL aclSetTensorStorageShape_init(aclTensorDesc *arg0, int arg1, const int64_t *arg2) {
load_library();
return aclSetTensorStorageShape(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclSetTensorStorageShape_error(aclTensorDesc *, int, const int64_t *) {
return on_init_failed<aclError >(19);
}
static void _WRAPLIB_API_CALL aclAppLog_init(aclLogLevel arg0, const char *arg1, const char *arg2, uint32_t arg3, const char *arg4, ...) {
load_library();
return aclAppLog(arg0, arg1, arg2, arg3, arg4);
}
static void _WRAPLIB_API_CALL aclAppLog_error(aclLogLevel, const char *, const char *, uint32_t, const char *, ...) {
return on_init_failed<void >(20);
}
static aclError _WRAPLIB_API_CALL aclrtSetExceptionInfoCallback_init(aclrtExceptionInfoCallback arg0) {
load_library();
return aclrtSetExceptionInfoCallback(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtSetExceptionInfoCallback_error(aclrtExceptionInfoCallback) {
return on_init_failed<aclError >(21);
}
static uint32_t _WRAPLIB_API_CALL aclrtGetTaskIdFromExceptionInfo_init(const aclrtExceptionInfo *arg0) {
load_library();
return aclrtGetTaskIdFromExceptionInfo(arg0);
}
static uint32_t _WRAPLIB_API_CALL aclrtGetTaskIdFromExceptionInfo_error(const aclrtExceptionInfo *) {
return on_init_failed<uint32_t >(22);
}
static uint32_t _WRAPLIB_API_CALL aclrtGetStreamIdFromExceptionInfo_init(const aclrtExceptionInfo *arg0) {
load_library();
return aclrtGetStreamIdFromExceptionInfo(arg0);
}
static uint32_t _WRAPLIB_API_CALL aclrtGetStreamIdFromExceptionInfo_error(const aclrtExceptionInfo *) {
return on_init_failed<uint32_t >(23);
}
static uint32_t _WRAPLIB_API_CALL aclrtGetThreadIdFromExceptionInfo_init(const aclrtExceptionInfo *arg0) {
load_library();
return aclrtGetThreadIdFromExceptionInfo(arg0);
}
static uint32_t _WRAPLIB_API_CALL aclrtGetThreadIdFromExceptionInfo_error(const aclrtExceptionInfo *) {
return on_init_failed<uint32_t >(24);
}
static aclError _WRAPLIB_API_CALL aclrtSubscribeReport_init(uint64_t arg0, aclrtStream arg1) {
load_library();
return aclrtSubscribeReport(arg0, arg1);
}
static aclError _WRAPLIB_API_CALL aclrtSubscribeReport_error(uint64_t, aclrtStream) {
return on_init_failed<aclError >(25);
}
static aclError _WRAPLIB_API_CALL aclrtLaunchCallback_init(aclrtCallback arg0, void *arg1, aclrtCallbackBlockType arg2, aclrtStream arg3) {
load_library();
return aclrtLaunchCallback(arg0, arg1, arg2, arg3);
}
static aclError _WRAPLIB_API_CALL aclrtLaunchCallback_error(aclrtCallback, void *, aclrtCallbackBlockType, aclrtStream) {
return on_init_failed<aclError >(26);
}
static aclError _WRAPLIB_API_CALL aclrtProcessReport_init(int32_t arg0) {
load_library();
return aclrtProcessReport(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtProcessReport_error(int32_t) {
return on_init_failed<aclError >(27);
}
static aclError _WRAPLIB_API_CALL aclrtUnSubscribeReport_init(uint64_t arg0, aclrtStream arg1) {
load_library();
return aclrtUnSubscribeReport(arg0, arg1);
}
static aclError _WRAPLIB_API_CALL aclrtUnSubscribeReport_error(uint64_t, aclrtStream) {
return on_init_failed<aclError >(28);
}
static aclError _WRAPLIB_API_CALL aclrtCreateContext_init(aclrtContext *arg0, int32_t arg1) {
load_library();
return aclrtCreateContext(arg0, arg1);
}
static aclError _WRAPLIB_API_CALL aclrtCreateContext_error(aclrtContext *, int32_t) {
return on_init_failed<aclError >(29);
}
static aclError _WRAPLIB_API_CALL aclrtDestroyContext_init(aclrtContext arg0) {
load_library();
return aclrtDestroyContext(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtDestroyContext_error(aclrtContext) {
return on_init_failed<aclError >(30);
}
static aclError _WRAPLIB_API_CALL aclrtSetCurrentContext_init(aclrtContext arg0) {
load_library();
return aclrtSetCurrentContext(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtSetCurrentContext_error(aclrtContext) {
return on_init_failed<aclError >(31);
}
static aclError _WRAPLIB_API_CALL aclrtGetCurrentContext_init(aclrtContext *arg0) {
load_library();
return aclrtGetCurrentContext(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtGetCurrentContext_error(aclrtContext *) {
return on_init_failed<aclError >(32);
}
static aclError _WRAPLIB_API_CALL aclrtSetDevice_init(int32_t arg0) {
load_library();
return aclrtSetDevice(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtSetDevice_error(int32_t) {
return on_init_failed<aclError >(33);
}
static aclError _WRAPLIB_API_CALL aclrtResetDevice_init(int32_t arg0) {
load_library();
return aclrtResetDevice(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtResetDevice_error(int32_t) {
return on_init_failed<aclError >(34);
}
static aclError _WRAPLIB_API_CALL aclrtGetDevice_init(int32_t *arg0) {
load_library();
return aclrtGetDevice(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtGetDevice_error(int32_t *) {
return on_init_failed<aclError >(35);
}
static aclError _WRAPLIB_API_CALL aclrtGetRunMode_init(aclrtRunMode *arg0) {
load_library();
return aclrtGetRunMode(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtGetRunMode_error(aclrtRunMode *) {
return on_init_failed<aclError >(36);
}
static aclError _WRAPLIB_API_CALL aclrtSynchronizeDevice_init() {
load_library();
return aclrtSynchronizeDevice();
}
static aclError _WRAPLIB_API_CALL aclrtSynchronizeDevice_error() {
return on_init_failed<aclError >(37);
}
static aclError _WRAPLIB_API_CALL aclrtSetTsDevice_init(aclrtTsId arg0) {
load_library();
return aclrtSetTsDevice(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtSetTsDevice_error(aclrtTsId) {
return on_init_failed<aclError >(38);
}
static aclError _WRAPLIB_API_CALL aclrtGetDeviceCount_init(uint32_t *arg0) {
load_library();
return aclrtGetDeviceCount(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtGetDeviceCount_error(uint32_t *) {
return on_init_failed<aclError >(39);
}
static aclError _WRAPLIB_API_CALL aclrtCreateEvent_init(aclrtEvent *arg0) {
load_library();
return aclrtCreateEvent(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtCreateEvent_error(aclrtEvent *) {
return on_init_failed<aclError >(40);
}
static aclError _WRAPLIB_API_CALL aclrtDestroyEvent_init(aclrtEvent arg0) {
load_library();
return aclrtDestroyEvent(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtDestroyEvent_error(aclrtEvent) {
return on_init_failed<aclError >(41);
}
static aclError _WRAPLIB_API_CALL aclrtRecordEvent_init(aclrtEvent arg0, aclrtStream arg1) {
load_library();
return aclrtRecordEvent(arg0, arg1);
}
static aclError _WRAPLIB_API_CALL aclrtRecordEvent_error(aclrtEvent, aclrtStream) {
return on_init_failed<aclError >(42);
}
static aclError _WRAPLIB_API_CALL aclrtResetEvent_init(aclrtEvent arg0, aclrtStream arg1) {
load_library();
return aclrtResetEvent(arg0, arg1);
}
static aclError _WRAPLIB_API_CALL aclrtResetEvent_error(aclrtEvent, aclrtStream) {
return on_init_failed<aclError >(43);
}
static aclError _WRAPLIB_API_CALL aclrtQueryEvent_init(aclrtEvent arg0, aclrtEventStatus *arg1) {
load_library();
return aclrtQueryEvent(arg0, arg1);
}
static aclError _WRAPLIB_API_CALL aclrtQueryEvent_error(aclrtEvent, aclrtEventStatus *) {
return on_init_failed<aclError >(44);
}
static aclError _WRAPLIB_API_CALL aclrtSynchronizeEvent_init(aclrtEvent arg0) {
load_library();
return aclrtSynchronizeEvent(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtSynchronizeEvent_error(aclrtEvent) {
return on_init_failed<aclError >(45);
}
static aclError _WRAPLIB_API_CALL aclrtEventElapsedTime_init(float *arg0, aclrtEvent arg1, aclrtEvent arg2) {
load_library();
return aclrtEventElapsedTime(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclrtEventElapsedTime_error(float *, aclrtEvent, aclrtEvent) {
return on_init_failed<aclError >(46);
}
static aclError _WRAPLIB_API_CALL aclrtMalloc_init(void **arg0, size_t arg1, aclrtMemMallocPolicy arg2) {
load_library();
return aclrtMalloc(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclrtMalloc_error(void **, size_t, aclrtMemMallocPolicy) {
return on_init_failed<aclError >(47);
}
static aclError _WRAPLIB_API_CALL aclrtFree_init(void *arg0) {
load_library();
return aclrtFree(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtFree_error(void *) {
return on_init_failed<aclError >(48);
}
static aclError _WRAPLIB_API_CALL aclrtMallocHost_init(void **arg0, size_t arg1) {
load_library();
return aclrtMallocHost(arg0, arg1);
}
static aclError _WRAPLIB_API_CALL aclrtMallocHost_error(void **, size_t) {
return on_init_failed<aclError >(49);
}
static aclError _WRAPLIB_API_CALL aclrtFreeHost_init(void *arg0) {
load_library();
return aclrtFreeHost(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtFreeHost_error(void *) {
return on_init_failed<aclError >(50);
}
static aclError _WRAPLIB_API_CALL aclrtMemcpy_init(void *arg0, size_t arg1, const void *arg2, size_t arg3, aclrtMemcpyKind arg4) {
load_library();
return aclrtMemcpy(arg0, arg1, arg2, arg3, arg4);
}
static aclError _WRAPLIB_API_CALL aclrtMemcpy_error(void *, size_t, const void *, size_t, aclrtMemcpyKind) {
return on_init_failed<aclError >(51);
}
static aclError _WRAPLIB_API_CALL aclrtMemset_init(void *arg0, size_t arg1, int32_t arg2, size_t arg3) {
load_library();
return aclrtMemset(arg0, arg1, arg2, arg3);
}
static aclError _WRAPLIB_API_CALL aclrtMemset_error(void *, size_t, int32_t, size_t) {
return on_init_failed<aclError >(52);
}
static aclError _WRAPLIB_API_CALL aclrtMemcpyAsync_init(void *arg0, size_t arg1, const void *arg2, size_t arg3, aclrtMemcpyKind arg4, aclrtStream arg5) {
load_library();
return aclrtMemcpyAsync(arg0, arg1, arg2, arg3, arg4, arg5);
}
static aclError _WRAPLIB_API_CALL aclrtMemcpyAsync_error(void *, size_t, const void *, size_t, aclrtMemcpyKind, aclrtStream) {
return on_init_failed<aclError >(53);
}
static aclError _WRAPLIB_API_CALL aclrtMemsetAsync_init(void *arg0, size_t arg1, int32_t arg2, size_t arg3, aclrtStream arg4) {
load_library();
return aclrtMemsetAsync(arg0, arg1, arg2, arg3, arg4);
}
static aclError _WRAPLIB_API_CALL aclrtMemsetAsync_error(void *, size_t, int32_t, size_t, aclrtStream) {
return on_init_failed<aclError >(54);
}
static aclError _WRAPLIB_API_CALL aclrtCreateStream_init(aclrtStream *arg0) {
load_library();
return aclrtCreateStream(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtCreateStream_error(aclrtStream *) {
return on_init_failed<aclError >(55);
}
static aclError _WRAPLIB_API_CALL aclrtDestroyStream_init(aclrtStream arg0) {
load_library();
return aclrtDestroyStream(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtDestroyStream_error(aclrtStream) {
return on_init_failed<aclError >(56);
}
static aclError _WRAPLIB_API_CALL aclrtSynchronizeStream_init(aclrtStream arg0) {
load_library();
return aclrtSynchronizeStream(arg0);
}
static aclError _WRAPLIB_API_CALL aclrtSynchronizeStream_error(aclrtStream) {
return on_init_failed<aclError >(57);
}
static aclError _WRAPLIB_API_CALL aclrtStreamWaitEvent_init(aclrtStream arg0, aclrtEvent arg1) {
load_library();
return aclrtStreamWaitEvent(arg0, arg1);
}
static aclError _WRAPLIB_API_CALL aclrtStreamWaitEvent_error(aclrtStream, aclrtEvent) {
return on_init_failed<aclError >(58);
}
static aclError _WRAPLIB_API_CALL aclopSetModelDir_init(const char *arg0) {
load_library();
return aclopSetModelDir(arg0);
}
static aclError _WRAPLIB_API_CALL aclopSetModelDir_error(const char *) {
return on_init_failed<aclError >(59);
}
static aclError _WRAPLIB_API_CALL aclopLoad_init(const void *arg0, size_t arg1) {
load_library();
return aclopLoad(arg0, arg1);
}
static aclError _WRAPLIB_API_CALL aclopLoad_error(const void *, size_t) {
return on_init_failed<aclError >(60);
}
static aclopAttr _WRAPLIB_API_CALL *aclopCreateAttr_init() {
load_library();
return aclopCreateAttr();
}
static aclopAttr _WRAPLIB_API_CALL *aclopCreateAttr_error() {
return on_init_failed<aclopAttr *>(61);
}
static void _WRAPLIB_API_CALL aclopDestroyAttr_init(const aclopAttr *arg0) {
load_library();
return aclopDestroyAttr(arg0);
}
static void _WRAPLIB_API_CALL aclopDestroyAttr_error(const aclopAttr *) {
return on_init_failed<void >(62);
}
static aclError _WRAPLIB_API_CALL aclopSetAttrBool_init(aclopAttr *arg0, const char *arg1, uint8_t arg2) {
load_library();
return aclopSetAttrBool(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclopSetAttrBool_error(aclopAttr *, const char *, uint8_t) {
return on_init_failed<aclError >(63);
}
static aclError _WRAPLIB_API_CALL aclopSetAttrInt_init(aclopAttr *arg0, const char *arg1, int64_t arg2) {
load_library();
return aclopSetAttrInt(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclopSetAttrInt_error(aclopAttr *, const char *, int64_t) {
return on_init_failed<aclError >(64);
}
static aclError _WRAPLIB_API_CALL aclopSetAttrFloat_init(aclopAttr *arg0, const char *arg1, float arg2) {
load_library();
return aclopSetAttrFloat(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclopSetAttrFloat_error(aclopAttr *, const char *, float) {
return on_init_failed<aclError >(65);
}
static aclError _WRAPLIB_API_CALL aclopSetAttrString_init(aclopAttr *arg0, const char *arg1, const char *arg2) {
load_library();
return aclopSetAttrString(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclopSetAttrString_error(aclopAttr *, const char *, const char *) {
return on_init_failed<aclError >(66);
}
static aclError _WRAPLIB_API_CALL aclopSetAttrListBool_init(aclopAttr *arg0, const char *arg1, int arg2, const uint8_t *arg3) {
load_library();
return aclopSetAttrListBool(arg0, arg1, arg2, arg3);
}
static aclError _WRAPLIB_API_CALL aclopSetAttrListBool_error(aclopAttr *, const char *, int, const uint8_t *) {
return on_init_failed<aclError >(67);
}
static aclError _WRAPLIB_API_CALL aclopSetAttrListInt_init(aclopAttr *arg0, const char *arg1, int arg2, const int64_t *arg3) {
load_library();
return aclopSetAttrListInt(arg0, arg1, arg2, arg3);
}
static aclError _WRAPLIB_API_CALL aclopSetAttrListInt_error(aclopAttr *, const char *, int, const int64_t *) {
return on_init_failed<aclError >(68);
}
static aclError _WRAPLIB_API_CALL aclopSetAttrListFloat_init(aclopAttr *arg0, const char *arg1, int arg2, const float *arg3) {
load_library();
return aclopSetAttrListFloat(arg0, arg1, arg2, arg3);
}
static aclError _WRAPLIB_API_CALL aclopSetAttrListFloat_error(aclopAttr *, const char *, int, const float *) {
return on_init_failed<aclError >(69);
}
static aclError _WRAPLIB_API_CALL aclopSetAttrListString_init(aclopAttr *arg0, const char *arg1, int arg2, const char **arg3) {
load_library();
return aclopSetAttrListString(arg0, arg1, arg2, arg3);
}
static aclError _WRAPLIB_API_CALL aclopSetAttrListString_error(aclopAttr *, const char *, int, const char **) {
return on_init_failed<aclError >(70);
}
static aclError _WRAPLIB_API_CALL aclopSetAttrListListInt_init(aclopAttr *arg0, const char *arg1, int arg2, const int *arg3, const int64_t * const arg4[]) {
load_library();
return aclopSetAttrListListInt(arg0, arg1, arg2, arg3, arg4);
}
static aclError _WRAPLIB_API_CALL aclopSetAttrListListInt_error(aclopAttr *, const char *, int, const int *, const int64_t * const []) {
return on_init_failed<aclError >(71);
}
static aclError _WRAPLIB_API_CALL aclopExecute_init(const char *arg0, int arg1, const aclTensorDesc * const arg2[], const aclDataBuffer * const arg3[], int arg4, const aclTensorDesc * const arg5[], aclDataBuffer * const arg6[], const aclopAttr *arg7, aclrtStream arg8) {
load_library();
return aclopExecute(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
}
static aclError _WRAPLIB_API_CALL aclopExecute_error(const char *, int, const aclTensorDesc * const [], const aclDataBuffer * const [], int, const aclTensorDesc * const [], aclDataBuffer * const [], const aclopAttr *, aclrtStream) {
return on_init_failed<aclError >(72);
}
static aclError _WRAPLIB_API_CALL aclopCreateHandle_init(const char *arg0, int arg1, const aclTensorDesc * const arg2[], int arg3, const aclTensorDesc * const arg4[], const aclopAttr *arg5, aclopHandle **arg6) {
load_library();
return aclopCreateHandle(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
}
static aclError _WRAPLIB_API_CALL aclopCreateHandle_error(const char *, int, const aclTensorDesc * const [], int, const aclTensorDesc * const [], const aclopAttr *, aclopHandle **) {
return on_init_failed<aclError >(73);
}
static void _WRAPLIB_API_CALL aclopDestroyHandle_init(aclopHandle *arg0) {
load_library();
return aclopDestroyHandle(arg0);
}
static void _WRAPLIB_API_CALL aclopDestroyHandle_error(aclopHandle *) {
return on_init_failed<void >(74);
}
static aclError _WRAPLIB_API_CALL aclopExecWithHandle_init(aclopHandle *arg0, int arg1, const aclDataBuffer * const arg2[], int arg3, aclDataBuffer * const arg4[], aclrtStream arg5) {
load_library();
return aclopExecWithHandle(arg0, arg1, arg2, arg3, arg4, arg5);
}
static aclError _WRAPLIB_API_CALL aclopExecWithHandle_error(aclopHandle *, int, const aclDataBuffer * const [], int, aclDataBuffer * const [], aclrtStream) {
return on_init_failed<aclError >(75);
}
static aclError _WRAPLIB_API_CALL aclopCast_init(const aclTensorDesc *arg0, const aclDataBuffer *arg1, const aclTensorDesc *arg2, aclDataBuffer *arg3, uint8_t arg4, aclrtStream arg5) {
load_library();
return aclopCast(arg0, arg1, arg2, arg3, arg4, arg5);
}
static aclError _WRAPLIB_API_CALL aclopCast_error(const aclTensorDesc *, const aclDataBuffer *, const aclTensorDesc *, aclDataBuffer *, uint8_t, aclrtStream) {
return on_init_failed<aclError >(76);
}
static aclError _WRAPLIB_API_CALL aclopCreateHandleForCast_init(aclTensorDesc *arg0, aclTensorDesc *arg1, uint8_t arg2, aclopHandle **arg3) {
load_library();
return aclopCreateHandleForCast(arg0, arg1, arg2, arg3);
}
static aclError _WRAPLIB_API_CALL aclopCreateHandleForCast_error(aclTensorDesc *, aclTensorDesc *, uint8_t, aclopHandle **) {
return on_init_failed<aclError >(77);
}
static aclError _WRAPLIB_API_CALL aclopCreateKernel_init(const char *arg0, const char *arg1, const char *arg2, void *arg3, int arg4, aclopEngineType arg5, aclDataDeallocator arg6) {
load_library();
return aclopCreateKernel(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
}
static aclError _WRAPLIB_API_CALL aclopCreateKernel_error(const char *, const char *, const char *, void *, int, aclopEngineType, aclDataDeallocator) {
return on_init_failed<aclError >(78);
}
static aclError _WRAPLIB_API_CALL aclopRegisterCompileFunc_init(const char *arg0, aclopCompileFunc arg1) {
load_library();
return aclopRegisterCompileFunc(arg0, arg1);
}
static aclError _WRAPLIB_API_CALL aclopRegisterCompileFunc_error(const char *, aclopCompileFunc) {
return on_init_failed<aclError >(79);
}
static aclError _WRAPLIB_API_CALL aclopUnregisterCompileFunc_init(const char *arg0) {
load_library();
return aclopUnregisterCompileFunc(arg0);
}
static aclError _WRAPLIB_API_CALL aclopUnregisterCompileFunc_error(const char *) {
return on_init_failed<aclError >(80);
}
static aclError _WRAPLIB_API_CALL aclopSetKernelArgs_init(aclopKernelDesc *arg0, const char *arg1, uint32_t arg2, const void *arg3, uint32_t arg4) {
load_library();
return aclopSetKernelArgs(arg0, arg1, arg2, arg3, arg4);
}
static aclError _WRAPLIB_API_CALL aclopSetKernelArgs_error(aclopKernelDesc *, const char *, uint32_t, const void *, uint32_t) {
return on_init_failed<aclError >(81);
}
static aclError _WRAPLIB_API_CALL aclopSetKernelWorkspaceSizes_init(aclopKernelDesc *arg0, int arg1, size_t *arg2) {
load_library();
return aclopSetKernelWorkspaceSizes(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclopSetKernelWorkspaceSizes_error(aclopKernelDesc *, int, size_t *) {
return on_init_failed<aclError >(82);
}
static aclError _WRAPLIB_API_CALL aclopUpdateParams_init(const char *arg0, int arg1, const aclTensorDesc * const arg2[], int arg3, const aclTensorDesc * const arg4[], const aclopAttr *arg5) {
load_library();
return aclopUpdateParams(arg0, arg1, arg2, arg3, arg4, arg5);
}
static aclError _WRAPLIB_API_CALL aclopUpdateParams_error(const char *, int, const aclTensorDesc * const [], int, const aclTensorDesc * const [], const aclopAttr *) {
return on_init_failed<aclError >(83);
}
static aclmdlDesc _WRAPLIB_API_CALL *aclmdlCreateDesc_init() {
load_library();
return aclmdlCreateDesc();
}
static aclmdlDesc _WRAPLIB_API_CALL *aclmdlCreateDesc_error() {
return on_init_failed<aclmdlDesc *>(84);
}
static aclError _WRAPLIB_API_CALL aclmdlDestroyDesc_init(aclmdlDesc *arg0) {
load_library();
return aclmdlDestroyDesc(arg0);
}
static aclError _WRAPLIB_API_CALL aclmdlDestroyDesc_error(aclmdlDesc *) {
return on_init_failed<aclError >(85);
}
static aclError _WRAPLIB_API_CALL aclmdlGetDesc_init(aclmdlDesc *arg0, uint32_t arg1) {
load_library();
return aclmdlGetDesc(arg0, arg1);
}
static aclError _WRAPLIB_API_CALL aclmdlGetDesc_error(aclmdlDesc *, uint32_t) {
return on_init_failed<aclError >(86);
}
static size_t _WRAPLIB_API_CALL aclmdlGetNumInputs_init(aclmdlDesc *arg0) {
load_library();
return aclmdlGetNumInputs(arg0);
}
static size_t _WRAPLIB_API_CALL aclmdlGetNumInputs_error(aclmdlDesc *) {
return on_init_failed<size_t >(87);
}
static size_t _WRAPLIB_API_CALL aclmdlGetNumOutputs_init(aclmdlDesc *arg0) {
load_library();
return aclmdlGetNumOutputs(arg0);
}
static size_t _WRAPLIB_API_CALL aclmdlGetNumOutputs_error(aclmdlDesc *) {
return on_init_failed<size_t >(88);
}
static size_t _WRAPLIB_API_CALL aclmdlGetInputSizeByIndex_init(aclmdlDesc *arg0, size_t arg1) {
load_library();
return aclmdlGetInputSizeByIndex(arg0, arg1);
}
static size_t _WRAPLIB_API_CALL aclmdlGetInputSizeByIndex_error(aclmdlDesc *, size_t) {
return on_init_failed<size_t >(89);
}
static size_t _WRAPLIB_API_CALL aclmdlGetOutputSizeByIndex_init(aclmdlDesc *arg0, size_t arg1) {
load_library();
return aclmdlGetOutputSizeByIndex(arg0, arg1);
}
static size_t _WRAPLIB_API_CALL aclmdlGetOutputSizeByIndex_error(aclmdlDesc *, size_t) {
return on_init_failed<size_t >(90);
}
static aclmdlDataset _WRAPLIB_API_CALL *aclmdlCreateDataset_init() {
load_library();
return aclmdlCreateDataset();
}
static aclmdlDataset _WRAPLIB_API_CALL *aclmdlCreateDataset_error() {
return on_init_failed<aclmdlDataset *>(91);
}
static aclError _WRAPLIB_API_CALL aclmdlDestroyDataset_init(const aclmdlDataset *arg0) {
load_library();
return aclmdlDestroyDataset(arg0);
}
static aclError _WRAPLIB_API_CALL aclmdlDestroyDataset_error(const aclmdlDataset *) {
return on_init_failed<aclError >(92);
}
static aclError _WRAPLIB_API_CALL aclmdlAddDatasetBuffer_init(aclmdlDataset *arg0, aclDataBuffer *arg1) {
load_library();
return aclmdlAddDatasetBuffer(arg0, arg1);
}
static aclError _WRAPLIB_API_CALL aclmdlAddDatasetBuffer_error(aclmdlDataset *, aclDataBuffer *) {
return on_init_failed<aclError >(93);
}
static size_t _WRAPLIB_API_CALL aclmdlGetDatasetNumBuffers_init(const aclmdlDataset *arg0) {
load_library();
return aclmdlGetDatasetNumBuffers(arg0);
}
static size_t _WRAPLIB_API_CALL aclmdlGetDatasetNumBuffers_error(const aclmdlDataset *) {
return on_init_failed<size_t >(94);
}
static aclDataBuffer _WRAPLIB_API_CALL *aclmdlGetDatasetBuffer_init(const aclmdlDataset *arg0, size_t arg1) {
load_library();
return aclmdlGetDatasetBuffer(arg0, arg1);
}
static aclDataBuffer _WRAPLIB_API_CALL *aclmdlGetDatasetBuffer_error(const aclmdlDataset *, size_t) {
return on_init_failed<aclDataBuffer *>(95);
}
static aclError _WRAPLIB_API_CALL aclmdlLoadFromFile_init(const char *arg0, uint32_t *arg1) {
load_library();
return aclmdlLoadFromFile(arg0, arg1);
}
static aclError _WRAPLIB_API_CALL aclmdlLoadFromFile_error(const char *, uint32_t *) {
return on_init_failed<aclError >(96);
}
static aclError _WRAPLIB_API_CALL aclmdlLoadFromMem_init(const void *arg0, size_t arg1, uint32_t *arg2) {
load_library();
return aclmdlLoadFromMem(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclmdlLoadFromMem_error(const void *, size_t, uint32_t *) {
return on_init_failed<aclError >(97);
}
static aclError _WRAPLIB_API_CALL aclmdlLoadFromFileWithMem_init(const char *arg0, uint32_t *arg1, void *arg2, size_t arg3, void *arg4, size_t arg5) {
load_library();
return aclmdlLoadFromFileWithMem(arg0, arg1, arg2, arg3, arg4, arg5);
}
static aclError _WRAPLIB_API_CALL aclmdlLoadFromFileWithMem_error(const char *, uint32_t *, void *, size_t, void *, size_t) {
return on_init_failed<aclError >(98);
}
static aclError _WRAPLIB_API_CALL aclmdlLoadFromMemWithMem_init(const void *arg0, size_t arg1, uint32_t *arg2, void *arg3, size_t arg4, void *arg5, size_t arg6) {
load_library();
return aclmdlLoadFromMemWithMem(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
}
static aclError _WRAPLIB_API_CALL aclmdlLoadFromMemWithMem_error(const void *, size_t, uint32_t *, void *, size_t, void *, size_t) {
return on_init_failed<aclError >(99);
}
static aclError _WRAPLIB_API_CALL aclmdlLoadFromFileWithQ_init(const char *arg0, uint32_t *arg1, const uint32_t *arg2, size_t arg3, const uint32_t *arg4, size_t arg5) {
load_library();
return aclmdlLoadFromFileWithQ(arg0, arg1, arg2, arg3, arg4, arg5);
}
static aclError _WRAPLIB_API_CALL aclmdlLoadFromFileWithQ_error(const char *, uint32_t *, const uint32_t *, size_t, const uint32_t *, size_t) {
return on_init_failed<aclError >(100);
}
static aclError _WRAPLIB_API_CALL aclmdlLoadFromMemWithQ_init(const void *arg0, size_t arg1, uint32_t *arg2, const uint32_t *arg3, size_t arg4, const uint32_t *arg5, size_t arg6) {
load_library();
return aclmdlLoadFromMemWithQ(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
}
static aclError _WRAPLIB_API_CALL aclmdlLoadFromMemWithQ_error(const void *, size_t, uint32_t *, const uint32_t *, size_t, const uint32_t *, size_t) {
return on_init_failed<aclError >(101);
}
static aclError _WRAPLIB_API_CALL aclmdlExecute_init(uint32_t arg0, const aclmdlDataset *arg1, aclmdlDataset *arg2) {
load_library();
return aclmdlExecute(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclmdlExecute_error(uint32_t, const aclmdlDataset *, aclmdlDataset *) {
return on_init_failed<aclError >(102);
}
static aclError _WRAPLIB_API_CALL aclmdlExecuteAsync_init(uint32_t arg0, const aclmdlDataset *arg1, aclmdlDataset *arg2, aclrtStream arg3) {
load_library();
return aclmdlExecuteAsync(arg0, arg1, arg2, arg3);
}
static aclError _WRAPLIB_API_CALL aclmdlExecuteAsync_error(uint32_t, const aclmdlDataset *, aclmdlDataset *, aclrtStream) {
return on_init_failed<aclError >(103);
}
static aclError _WRAPLIB_API_CALL aclmdlUnload_init(uint32_t arg0) {
load_library();
return aclmdlUnload(arg0);
}
static aclError _WRAPLIB_API_CALL aclmdlUnload_error(uint32_t) {
return on_init_failed<aclError >(104);
}
static aclError _WRAPLIB_API_CALL aclmdlQuerySize_init(const char *arg0, size_t *arg1, size_t *arg2) {
load_library();
return aclmdlQuerySize(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclmdlQuerySize_error(const char *, size_t *, size_t *) {
return on_init_failed<aclError >(105);
}
static aclError _WRAPLIB_API_CALL aclmdlQuerySizeFromMem_init(const void *arg0, size_t arg1, size_t *arg2, size_t *arg3) {
load_library();
return aclmdlQuerySizeFromMem(arg0, arg1, arg2, arg3);
}
static aclError _WRAPLIB_API_CALL aclmdlQuerySizeFromMem_error(const void *, size_t, size_t *, size_t *) {
return on_init_failed<aclError >(106);
}
static aclError _WRAPLIB_API_CALL aclmdlSetDynamicBatchSize_init(uint32_t arg0, aclmdlDataset *arg1, size_t arg2, uint64_t arg3) {
load_library();
return aclmdlSetDynamicBatchSize(arg0, arg1, arg2, arg3);
}
static aclError _WRAPLIB_API_CALL aclmdlSetDynamicBatchSize_error(uint32_t, aclmdlDataset *, size_t, uint64_t) {
return on_init_failed<aclError >(107);
}
static aclError _WRAPLIB_API_CALL aclmdlSetDynamicHWSize_init(uint32_t arg0, aclmdlDataset *arg1, size_t arg2, uint64_t arg3, uint64_t arg4) {
load_library();
return aclmdlSetDynamicHWSize(arg0, arg1, arg2, arg3, arg4);
}
static aclError _WRAPLIB_API_CALL aclmdlSetDynamicHWSize_error(uint32_t, aclmdlDataset *, size_t, uint64_t, uint64_t) {
return on_init_failed<aclError >(108);
}
static aclError _WRAPLIB_API_CALL aclmdlGetInputDims_init(const aclmdlDesc *arg0, size_t arg1, aclmdlIODims *arg2) {
load_library();
return aclmdlGetInputDims(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclmdlGetInputDims_error(const aclmdlDesc *, size_t, aclmdlIODims *) {
return on_init_failed<aclError >(109);
}
static aclError _WRAPLIB_API_CALL aclmdlGetInputDimsV2_init(const aclmdlDesc *arg0, size_t arg1, aclmdlIODims *arg2) {
load_library();
return aclmdlGetInputDimsV2(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclmdlGetInputDimsV2_error(const aclmdlDesc *, size_t, aclmdlIODims *) {
return on_init_failed<aclError >(110);
}
static aclError _WRAPLIB_API_CALL aclmdlGetOutputDims_init(const aclmdlDesc *arg0, size_t arg1, aclmdlIODims *arg2) {
load_library();
return aclmdlGetOutputDims(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclmdlGetOutputDims_error(const aclmdlDesc *, size_t, aclmdlIODims *) {
return on_init_failed<aclError >(111);
}
static aclError _WRAPLIB_API_CALL aclmdlGetCurOutputDims_init(const aclmdlDesc *arg0, size_t arg1, aclmdlIODims *arg2) {
load_library();
return aclmdlGetCurOutputDims(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclmdlGetCurOutputDims_error(const aclmdlDesc *, size_t, aclmdlIODims *) {
return on_init_failed<aclError >(112);
}
static const char _WRAPLIB_API_CALL *aclmdlGetInputNameByIndex_init(const aclmdlDesc *arg0, size_t arg1) {
load_library();
return aclmdlGetInputNameByIndex(arg0, arg1);
}
static const char _WRAPLIB_API_CALL *aclmdlGetInputNameByIndex_error(const aclmdlDesc *, size_t) {
return on_init_failed<const char *>(113);
}
static const char _WRAPLIB_API_CALL *aclmdlGetOutputNameByIndex_init(const aclmdlDesc *arg0, size_t arg1) {
load_library();
return aclmdlGetOutputNameByIndex(arg0, arg1);
}
static const char _WRAPLIB_API_CALL *aclmdlGetOutputNameByIndex_error(const aclmdlDesc *, size_t) {
return on_init_failed<const char *>(114);
}
static aclFormat _WRAPLIB_API_CALL aclmdlGetInputFormat_init(const aclmdlDesc *arg0, size_t arg1) {
load_library();
return aclmdlGetInputFormat(arg0, arg1);
}
static aclFormat _WRAPLIB_API_CALL aclmdlGetInputFormat_error(const aclmdlDesc *, size_t) {
return on_init_failed<aclFormat >(115);
}
static aclFormat _WRAPLIB_API_CALL aclmdlGetOutputFormat_init(const aclmdlDesc *arg0, size_t arg1) {
load_library();
return aclmdlGetOutputFormat(arg0, arg1);
}
static aclFormat _WRAPLIB_API_CALL aclmdlGetOutputFormat_error(const aclmdlDesc *, size_t) {
return on_init_failed<aclFormat >(116);
}
static aclDataType _WRAPLIB_API_CALL aclmdlGetInputDataType_init(const aclmdlDesc *arg0, size_t arg1) {
load_library();
return aclmdlGetInputDataType(arg0, arg1);
}
static aclDataType _WRAPLIB_API_CALL aclmdlGetInputDataType_error(const aclmdlDesc *, size_t) {
return on_init_failed<aclDataType >(117);
}
static aclDataType _WRAPLIB_API_CALL aclmdlGetOutputDataType_init(const aclmdlDesc *arg0, size_t arg1) {
load_library();
return aclmdlGetOutputDataType(arg0, arg1);
}
static aclDataType _WRAPLIB_API_CALL aclmdlGetOutputDataType_error(const aclmdlDesc *, size_t) {
return on_init_failed<aclDataType >(118);
}
static aclError _WRAPLIB_API_CALL aclmdlGetInputIndexByName_init(const aclmdlDesc *arg0, const char *arg1, size_t *arg2) {
load_library();
return aclmdlGetInputIndexByName(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclmdlGetInputIndexByName_error(const aclmdlDesc *, const char *, size_t *) {
return on_init_failed<aclError >(119);
}
static aclError _WRAPLIB_API_CALL aclmdlGetOutputIndexByName_init(const aclmdlDesc *arg0, const char *arg1, size_t *arg2) {
load_library();
return aclmdlGetOutputIndexByName(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclmdlGetOutputIndexByName_error(const aclmdlDesc *, const char *, size_t *) {
return on_init_failed<aclError >(120);
}
static aclError _WRAPLIB_API_CALL aclmdlGetDynamicBatch_init(const aclmdlDesc *arg0, aclmdlBatch *arg1) {
load_library();
return aclmdlGetDynamicBatch(arg0, arg1);
}
static aclError _WRAPLIB_API_CALL aclmdlGetDynamicBatch_error(const aclmdlDesc *, aclmdlBatch *) {
return on_init_failed<aclError >(121);
}
static aclError _WRAPLIB_API_CALL aclmdlGetDynamicHW_init(const aclmdlDesc *arg0, size_t arg1, aclmdlHW *arg2) {
load_library();
return aclmdlGetDynamicHW(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclmdlGetDynamicHW_error(const aclmdlDesc *, size_t, aclmdlHW *) {
return on_init_failed<aclError >(122);
}
static aclmdlAIPP _WRAPLIB_API_CALL *aclmdlCreateAIPP_init(uint64_t arg0) {
load_library();
return aclmdlCreateAIPP(arg0);
}
static aclmdlAIPP _WRAPLIB_API_CALL *aclmdlCreateAIPP_error(uint64_t) {
return on_init_failed<aclmdlAIPP *>(123);
}
static aclError _WRAPLIB_API_CALL aclmdlDestroyAIPP_init(const aclmdlAIPP *arg0) {
load_library();
return aclmdlDestroyAIPP(arg0);
}
static aclError _WRAPLIB_API_CALL aclmdlDestroyAIPP_error(const aclmdlAIPP *) {
return on_init_failed<aclError >(124);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPInputFormat_init(aclmdlAIPP *arg0, aclAippInputFormat arg1) {
load_library();
return aclmdlSetAIPPInputFormat(arg0, arg1);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPInputFormat_error(aclmdlAIPP *, aclAippInputFormat) {
return on_init_failed<aclError >(125);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPCscParams_init(aclmdlAIPP *arg0, int8_t arg1, int16_t arg2, int16_t arg3, int16_t arg4, int16_t arg5, int16_t arg6, int16_t arg7, int16_t arg8, int16_t arg9, int16_t arg10, uint8_t arg11, uint8_t arg12, uint8_t arg13, uint8_t arg14, uint8_t arg15, uint8_t arg16) {
load_library();
return aclmdlSetAIPPCscParams(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPCscParams_error(aclmdlAIPP *, int8_t, int16_t, int16_t, int16_t, int16_t, int16_t, int16_t, int16_t, int16_t, int16_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t) {
return on_init_failed<aclError >(126);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPRbuvSwapSwitch_init(aclmdlAIPP *arg0, int8_t arg1) {
load_library();
return aclmdlSetAIPPRbuvSwapSwitch(arg0, arg1);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPRbuvSwapSwitch_error(aclmdlAIPP *, int8_t) {
return on_init_failed<aclError >(127);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPAxSwapSwitch_init(aclmdlAIPP *arg0, int8_t arg1) {
load_library();
return aclmdlSetAIPPAxSwapSwitch(arg0, arg1);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPAxSwapSwitch_error(aclmdlAIPP *, int8_t) {
return on_init_failed<aclError >(128);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPSrcImageSize_init(aclmdlAIPP *arg0, int32_t arg1, int32_t arg2) {
load_library();
return aclmdlSetAIPPSrcImageSize(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPSrcImageSize_error(aclmdlAIPP *, int32_t, int32_t) {
return on_init_failed<aclError >(129);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPScfParams_init(aclmdlAIPP *arg0, int8_t arg1, int32_t arg2, int32_t arg3, int32_t arg4, int32_t arg5, uint64_t arg6) {
load_library();
return aclmdlSetAIPPScfParams(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPScfParams_error(aclmdlAIPP *, int8_t, int32_t, int32_t, int32_t, int32_t, uint64_t) {
return on_init_failed<aclError >(130);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPCropParams_init(aclmdlAIPP *arg0, int8_t arg1, int32_t arg2, int32_t arg3, int32_t arg4, int32_t arg5, uint64_t arg6) {
load_library();
return aclmdlSetAIPPCropParams(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPCropParams_error(aclmdlAIPP *, int8_t, int32_t, int32_t, int32_t, int32_t, uint64_t) {
return on_init_failed<aclError >(131);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPPaddingParams_init(aclmdlAIPP *arg0, int8_t arg1, int32_t arg2, int32_t arg3, int32_t arg4, int32_t arg5, uint64_t arg6) {
load_library();
return aclmdlSetAIPPPaddingParams(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPPaddingParams_error(aclmdlAIPP *, int8_t, int32_t, int32_t, int32_t, int32_t, uint64_t) {
return on_init_failed<aclError >(132);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPDtcPixelMean_init(aclmdlAIPP *arg0, int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4, uint64_t arg5) {
load_library();
return aclmdlSetAIPPDtcPixelMean(arg0, arg1, arg2, arg3, arg4, arg5);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPDtcPixelMean_error(aclmdlAIPP *, int16_t, int16_t, int16_t, int16_t, uint64_t) {
return on_init_failed<aclError >(133);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPDtcPixelMin_init(aclmdlAIPP *arg0, float arg1, float arg2, float arg3, float arg4, uint64_t arg5) {
load_library();
return aclmdlSetAIPPDtcPixelMin(arg0, arg1, arg2, arg3, arg4, arg5);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPDtcPixelMin_error(aclmdlAIPP *, float, float, float, float, uint64_t) {
return on_init_failed<aclError >(134);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPPixelVarReci_init(aclmdlAIPP *arg0, float arg1, float arg2, float arg3, float arg4, uint64_t arg5) {
load_library();
return aclmdlSetAIPPPixelVarReci(arg0, arg1, arg2, arg3, arg4, arg5);
}
static aclError _WRAPLIB_API_CALL aclmdlSetAIPPPixelVarReci_error(aclmdlAIPP *, float, float, float, float, uint64_t) {
return on_init_failed<aclError >(135);
}
static aclError _WRAPLIB_API_CALL aclmdlSetInputAIPP_init(uint32_t arg0, aclmdlDataset *arg1, size_t arg2, const aclmdlAIPP *arg3) {
load_library();
return aclmdlSetInputAIPP(arg0, arg1, arg2, arg3);
}
static aclError _WRAPLIB_API_CALL aclmdlSetInputAIPP_error(uint32_t, aclmdlDataset *, size_t, const aclmdlAIPP *) {
return on_init_failed<aclError >(136);
}
static aclError _WRAPLIB_API_CALL aclmdlGetFirstAippInfo_init(uint32_t arg0, size_t arg1, aclAippInfo *arg2) {
load_library();
return aclmdlGetFirstAippInfo(arg0, arg1, arg2);
}
static aclError _WRAPLIB_API_CALL aclmdlGetFirstAippInfo_error(uint32_t, size_t, aclAippInfo *) {
return on_init_failed<aclError >(137);
}
static aclError _WRAPLIB_API_CALL aclInit_init(const char *arg0) {
load_library();
return aclInit(arg0);
}
static aclError _WRAPLIB_API_CALL aclInit_error(const char *) {
return on_init_failed<aclError >(138);
}
static aclError _WRAPLIB_API_CALL aclFinalize_init() {
load_library();
return aclFinalize();
}
static aclError _WRAPLIB_API_CALL aclFinalize_error() {
return on_init_failed<aclError >(139);
}
static constexpr size_t NR_FUNC = 140;
static void* g_func_table[NR_FUNC] = {(void*)(&aclFloat16ToFloat_init),
(void*)(&aclFloatToFloat16_init),
(void*)(&aclCreateDataBuffer_init),
(void*)(&aclDestroyDataBuffer_init),
(void*)(&aclGetDataBufferAddr_init),
(void*)(&aclGetDataBufferSize_init),
(void*)(&aclDataTypeSize_init),
(void*)(&aclCreateTensorDesc_init),
(void*)(&aclDestroyTensorDesc_init),
(void*)(&aclGetTensorDescType_init),
(void*)(&aclGetTensorDescFormat_init),
(void*)(&aclGetTensorDescSize_init),
(void*)(&aclGetTensorDescElementCount_init),
(void*)(&aclGetTensorDescNumDims_init),
(void*)(&aclGetTensorDescDim_init),
(void*)(&aclSetTensorDescName_init),
(void*)(&aclGetTensorDescName_init),
(void*)(&aclTransTensorDescFormat_init),
(void*)(&aclSetTensorStorageFormat_init),
(void*)(&aclSetTensorStorageShape_init),
(void*)(&aclAppLog_init),
(void*)(&aclrtSetExceptionInfoCallback_init),
(void*)(&aclrtGetTaskIdFromExceptionInfo_init),
(void*)(&aclrtGetStreamIdFromExceptionInfo_init),
(void*)(&aclrtGetThreadIdFromExceptionInfo_init),
(void*)(&aclrtSubscribeReport_init),
(void*)(&aclrtLaunchCallback_init),
(void*)(&aclrtProcessReport_init),
(void*)(&aclrtUnSubscribeReport_init),
(void*)(&aclrtCreateContext_init),
(void*)(&aclrtDestroyContext_init),
(void*)(&aclrtSetCurrentContext_init),
(void*)(&aclrtGetCurrentContext_init),
(void*)(&aclrtSetDevice_init),
(void*)(&aclrtResetDevice_init),
(void*)(&aclrtGetDevice_init),
(void*)(&aclrtGetRunMode_init),
(void*)(&aclrtSynchronizeDevice_init),
(void*)(&aclrtSetTsDevice_init),
(void*)(&aclrtGetDeviceCount_init),
(void*)(&aclrtCreateEvent_init),
(void*)(&aclrtDestroyEvent_init),
(void*)(&aclrtRecordEvent_init),
(void*)(&aclrtResetEvent_init),
(void*)(&aclrtQueryEvent_init),
(void*)(&aclrtSynchronizeEvent_init),
(void*)(&aclrtEventElapsedTime_init),
(void*)(&aclrtMalloc_init),
(void*)(&aclrtFree_init),
(void*)(&aclrtMallocHost_init),
(void*)(&aclrtFreeHost_init),
(void*)(&aclrtMemcpy_init),
(void*)(&aclrtMemset_init),
(void*)(&aclrtMemcpyAsync_init),
(void*)(&aclrtMemsetAsync_init),
(void*)(&aclrtCreateStream_init),
(void*)(&aclrtDestroyStream_init),
(void*)(&aclrtSynchronizeStream_init),
(void*)(&aclrtStreamWaitEvent_init),
(void*)(&aclopSetModelDir_init),
(void*)(&aclopLoad_init),
(void*)(&aclopCreateAttr_init),
(void*)(&aclopDestroyAttr_init),
(void*)(&aclopSetAttrBool_init),
(void*)(&aclopSetAttrInt_init),
(void*)(&aclopSetAttrFloat_init),
(void*)(&aclopSetAttrString_init),
(void*)(&aclopSetAttrListBool_init),
(void*)(&aclopSetAttrListInt_init),
(void*)(&aclopSetAttrListFloat_init),
(void*)(&aclopSetAttrListString_init),
(void*)(&aclopSetAttrListListInt_init),
(void*)(&aclopExecute_init),
(void*)(&aclopCreateHandle_init),
(void*)(&aclopDestroyHandle_init),
(void*)(&aclopExecWithHandle_init),
(void*)(&aclopCast_init),
(void*)(&aclopCreateHandleForCast_init),
(void*)(&aclopCreateKernel_init),
(void*)(&aclopRegisterCompileFunc_init),
(void*)(&aclopUnregisterCompileFunc_init),
(void*)(&aclopSetKernelArgs_init),
(void*)(&aclopSetKernelWorkspaceSizes_init),
(void*)(&aclopUpdateParams_init),
(void*)(&aclmdlCreateDesc_init),
(void*)(&aclmdlDestroyDesc_init),
(void*)(&aclmdlGetDesc_init),
(void*)(&aclmdlGetNumInputs_init),
(void*)(&aclmdlGetNumOutputs_init),
(void*)(&aclmdlGetInputSizeByIndex_init),
(void*)(&aclmdlGetOutputSizeByIndex_init),
(void*)(&aclmdlCreateDataset_init),
(void*)(&aclmdlDestroyDataset_init),
(void*)(&aclmdlAddDatasetBuffer_init),
(void*)(&aclmdlGetDatasetNumBuffers_init),
(void*)(&aclmdlGetDatasetBuffer_init),
(void*)(&aclmdlLoadFromFile_init),
(void*)(&aclmdlLoadFromMem_init),
(void*)(&aclmdlLoadFromFileWithMem_init),
(void*)(&aclmdlLoadFromMemWithMem_init),
(void*)(&aclmdlLoadFromFileWithQ_init),
(void*)(&aclmdlLoadFromMemWithQ_init),
(void*)(&aclmdlExecute_init),
(void*)(&aclmdlExecuteAsync_init),
(void*)(&aclmdlUnload_init),
(void*)(&aclmdlQuerySize_init),
(void*)(&aclmdlQuerySizeFromMem_init),
(void*)(&aclmdlSetDynamicBatchSize_init),
(void*)(&aclmdlSetDynamicHWSize_init),
(void*)(&aclmdlGetInputDims_init),
(void*)(&aclmdlGetInputDimsV2_init),
(void*)(&aclmdlGetOutputDims_init),
(void*)(&aclmdlGetCurOutputDims_init),
(void*)(&aclmdlGetInputNameByIndex_init),
(void*)(&aclmdlGetOutputNameByIndex_init),
(void*)(&aclmdlGetInputFormat_init),
(void*)(&aclmdlGetOutputFormat_init),
(void*)(&aclmdlGetInputDataType_init),
(void*)(&aclmdlGetOutputDataType_init),
(void*)(&aclmdlGetInputIndexByName_init),
(void*)(&aclmdlGetOutputIndexByName_init),
(void*)(&aclmdlGetDynamicBatch_init),
(void*)(&aclmdlGetDynamicHW_init),
(void*)(&aclmdlCreateAIPP_init),
(void*)(&aclmdlDestroyAIPP_init),
(void*)(&aclmdlSetAIPPInputFormat_init),
(void*)(&aclmdlSetAIPPCscParams_init),
(void*)(&aclmdlSetAIPPRbuvSwapSwitch_init),
(void*)(&aclmdlSetAIPPAxSwapSwitch_init),
(void*)(&aclmdlSetAIPPSrcImageSize_init),
(void*)(&aclmdlSetAIPPScfParams_init),
(void*)(&aclmdlSetAIPPCropParams_init),
(void*)(&aclmdlSetAIPPPaddingParams_init),
(void*)(&aclmdlSetAIPPDtcPixelMean_init),
(void*)(&aclmdlSetAIPPDtcPixelMin_init),
(void*)(&aclmdlSetAIPPPixelVarReci_init),
(void*)(&aclmdlSetInputAIPP_init),
(void*)(&aclmdlGetFirstAippInfo_init),
(void*)(&aclInit_init),
(void*)(&aclFinalize_init)};
static void* g_func_table_error[NR_FUNC] = {(void*)(&aclFloat16ToFloat_error),
(void*)(&aclFloatToFloat16_error),
(void*)(&aclCreateDataBuffer_error),
(void*)(&aclDestroyDataBuffer_error),
(void*)(&aclGetDataBufferAddr_error),
(void*)(&aclGetDataBufferSize_error),
(void*)(&aclDataTypeSize_error),
(void*)(&aclCreateTensorDesc_error),
(void*)(&aclDestroyTensorDesc_error),
(void*)(&aclGetTensorDescType_error),
(void*)(&aclGetTensorDescFormat_error),
(void*)(&aclGetTensorDescSize_error),
(void*)(&aclGetTensorDescElementCount_error),
(void*)(&aclGetTensorDescNumDims_error),
(void*)(&aclGetTensorDescDim_error),
(void*)(&aclSetTensorDescName_error),
(void*)(&aclGetTensorDescName_error),
(void*)(&aclTransTensorDescFormat_error),
(void*)(&aclSetTensorStorageFormat_error),
(void*)(&aclSetTensorStorageShape_error),
(void*)(&aclAppLog_error),
(void*)(&aclrtSetExceptionInfoCallback_error),
(void*)(&aclrtGetTaskIdFromExceptionInfo_error),
(void*)(&aclrtGetStreamIdFromExceptionInfo_error),
(void*)(&aclrtGetThreadIdFromExceptionInfo_error),
(void*)(&aclrtSubscribeReport_error),
(void*)(&aclrtLaunchCallback_error),
(void*)(&aclrtProcessReport_error),
(void*)(&aclrtUnSubscribeReport_error),
(void*)(&aclrtCreateContext_error),
(void*)(&aclrtDestroyContext_error),
(void*)(&aclrtSetCurrentContext_error),
(void*)(&aclrtGetCurrentContext_error),
(void*)(&aclrtSetDevice_error),
(void*)(&aclrtResetDevice_error),
(void*)(&aclrtGetDevice_error),
(void*)(&aclrtGetRunMode_error),
(void*)(&aclrtSynchronizeDevice_error),
(void*)(&aclrtSetTsDevice_error),
(void*)(&aclrtGetDeviceCount_error),
(void*)(&aclrtCreateEvent_error),
(void*)(&aclrtDestroyEvent_error),
(void*)(&aclrtRecordEvent_error),
(void*)(&aclrtResetEvent_error),
(void*)(&aclrtQueryEvent_error),
(void*)(&aclrtSynchronizeEvent_error),
(void*)(&aclrtEventElapsedTime_error),
(void*)(&aclrtMalloc_error),
(void*)(&aclrtFree_error),
(void*)(&aclrtMallocHost_error),
(void*)(&aclrtFreeHost_error),
(void*)(&aclrtMemcpy_error),
(void*)(&aclrtMemset_error),
(void*)(&aclrtMemcpyAsync_error),
(void*)(&aclrtMemsetAsync_error),
(void*)(&aclrtCreateStream_error),
(void*)(&aclrtDestroyStream_error),
(void*)(&aclrtSynchronizeStream_error),
(void*)(&aclrtStreamWaitEvent_error),
(void*)(&aclopSetModelDir_error),
(void*)(&aclopLoad_error),
(void*)(&aclopCreateAttr_error),
(void*)(&aclopDestroyAttr_error),
(void*)(&aclopSetAttrBool_error),
(void*)(&aclopSetAttrInt_error),
(void*)(&aclopSetAttrFloat_error),
(void*)(&aclopSetAttrString_error),
(void*)(&aclopSetAttrListBool_error),
(void*)(&aclopSetAttrListInt_error),
(void*)(&aclopSetAttrListFloat_error),
(void*)(&aclopSetAttrListString_error),
(void*)(&aclopSetAttrListListInt_error),
(void*)(&aclopExecute_error),
(void*)(&aclopCreateHandle_error),
(void*)(&aclopDestroyHandle_error),
(void*)(&aclopExecWithHandle_error),
(void*)(&aclopCast_error),
(void*)(&aclopCreateHandleForCast_error),
(void*)(&aclopCreateKernel_error),
(void*)(&aclopRegisterCompileFunc_error),
(void*)(&aclopUnregisterCompileFunc_error),
(void*)(&aclopSetKernelArgs_error),
(void*)(&aclopSetKernelWorkspaceSizes_error),
(void*)(&aclopUpdateParams_error),
(void*)(&aclmdlCreateDesc_error),
(void*)(&aclmdlDestroyDesc_error),
(void*)(&aclmdlGetDesc_error),
(void*)(&aclmdlGetNumInputs_error),
(void*)(&aclmdlGetNumOutputs_error),
(void*)(&aclmdlGetInputSizeByIndex_error),
(void*)(&aclmdlGetOutputSizeByIndex_error),
(void*)(&aclmdlCreateDataset_error),
(void*)(&aclmdlDestroyDataset_error),
(void*)(&aclmdlAddDatasetBuffer_error),
(void*)(&aclmdlGetDatasetNumBuffers_error),
(void*)(&aclmdlGetDatasetBuffer_error),
(void*)(&aclmdlLoadFromFile_error),
(void*)(&aclmdlLoadFromMem_error),
(void*)(&aclmdlLoadFromFileWithMem_error),
(void*)(&aclmdlLoadFromMemWithMem_error),
(void*)(&aclmdlLoadFromFileWithQ_error),
(void*)(&aclmdlLoadFromMemWithQ_error),
(void*)(&aclmdlExecute_error),
(void*)(&aclmdlExecuteAsync_error),
(void*)(&aclmdlUnload_error),
(void*)(&aclmdlQuerySize_error),
(void*)(&aclmdlQuerySizeFromMem_error),
(void*)(&aclmdlSetDynamicBatchSize_error),
(void*)(&aclmdlSetDynamicHWSize_error),
(void*)(&aclmdlGetInputDims_error),
(void*)(&aclmdlGetInputDimsV2_error),
(void*)(&aclmdlGetOutputDims_error),
(void*)(&aclmdlGetCurOutputDims_error),
(void*)(&aclmdlGetInputNameByIndex_error),
(void*)(&aclmdlGetOutputNameByIndex_error),
(void*)(&aclmdlGetInputFormat_error),
(void*)(&aclmdlGetOutputFormat_error),
(void*)(&aclmdlGetInputDataType_error),
(void*)(&aclmdlGetOutputDataType_error),
(void*)(&aclmdlGetInputIndexByName_error),
(void*)(&aclmdlGetOutputIndexByName_error),
(void*)(&aclmdlGetDynamicBatch_error),
(void*)(&aclmdlGetDynamicHW_error),
(void*)(&aclmdlCreateAIPP_error),
(void*)(&aclmdlDestroyAIPP_error),
(void*)(&aclmdlSetAIPPInputFormat_error),
(void*)(&aclmdlSetAIPPCscParams_error),
(void*)(&aclmdlSetAIPPRbuvSwapSwitch_error),
(void*)(&aclmdlSetAIPPAxSwapSwitch_error),
(void*)(&aclmdlSetAIPPSrcImageSize_error),
(void*)(&aclmdlSetAIPPScfParams_error),
(void*)(&aclmdlSetAIPPCropParams_error),
(void*)(&aclmdlSetAIPPPaddingParams_error),
(void*)(&aclmdlSetAIPPDtcPixelMean_error),
(void*)(&aclmdlSetAIPPDtcPixelMin_error),
(void*)(&aclmdlSetAIPPPixelVarReci_error),
(void*)(&aclmdlSetInputAIPP_error),
(void*)(&aclmdlGetFirstAippInfo_error),
(void*)(&aclInit_error),
(void*)(&aclFinalize_error)};
static const char* const g_func_name[NR_FUNC] = {"aclFloat16ToFloat",
"aclFloatToFloat16",
"aclCreateDataBuffer",
"aclDestroyDataBuffer",
"aclGetDataBufferAddr",
"aclGetDataBufferSize",
"aclDataTypeSize",
"aclCreateTensorDesc",
"aclDestroyTensorDesc",
"aclGetTensorDescType",
"aclGetTensorDescFormat",
"aclGetTensorDescSize",
"aclGetTensorDescElementCount",
"aclGetTensorDescNumDims",
"aclGetTensorDescDim",
"aclSetTensorDescName",
"aclGetTensorDescName",
"aclTransTensorDescFormat",
"aclSetTensorStorageFormat",
"aclSetTensorStorageShape",
"aclAppLog",
"aclrtSetExceptionInfoCallback",
"aclrtGetTaskIdFromExceptionInfo",
"aclrtGetStreamIdFromExceptionInfo",
"aclrtGetThreadIdFromExceptionInfo",
"aclrtSubscribeReport",
"aclrtLaunchCallback",
"aclrtProcessReport",
"aclrtUnSubscribeReport",
"aclrtCreateContext",
"aclrtDestroyContext",
"aclrtSetCurrentContext",
"aclrtGetCurrentContext",
"aclrtSetDevice",
"aclrtResetDevice",
"aclrtGetDevice",
"aclrtGetRunMode",
"aclrtSynchronizeDevice",
"aclrtSetTsDevice",
"aclrtGetDeviceCount",
"aclrtCreateEvent",
"aclrtDestroyEvent",
"aclrtRecordEvent",
"aclrtResetEvent",
"aclrtQueryEvent",
"aclrtSynchronizeEvent",
"aclrtEventElapsedTime",
"aclrtMalloc",
"aclrtFree",
"aclrtMallocHost",
"aclrtFreeHost",
"aclrtMemcpy",
"aclrtMemset",
"aclrtMemcpyAsync",
"aclrtMemsetAsync",
"aclrtCreateStream",
"aclrtDestroyStream",
"aclrtSynchronizeStream",
"aclrtStreamWaitEvent",
"aclopSetModelDir",
"aclopLoad",
"aclopCreateAttr",
"aclopDestroyAttr",
"aclopSetAttrBool",
"aclopSetAttrInt",
"aclopSetAttrFloat",
"aclopSetAttrString",
"aclopSetAttrListBool",
"aclopSetAttrListInt",
"aclopSetAttrListFloat",
"aclopSetAttrListString",
"aclopSetAttrListListInt",
"aclopExecute",
"aclopCreateHandle",
"aclopDestroyHandle",
"aclopExecWithHandle",
"aclopCast",
"aclopCreateHandleForCast",
"aclopCreateKernel",
"aclopRegisterCompileFunc",
"aclopUnregisterCompileFunc",
"aclopSetKernelArgs",
"aclopSetKernelWorkspaceSizes",
"aclopUpdateParams",
"aclmdlCreateDesc",
"aclmdlDestroyDesc",
"aclmdlGetDesc",
"aclmdlGetNumInputs",
"aclmdlGetNumOutputs",
"aclmdlGetInputSizeByIndex",
"aclmdlGetOutputSizeByIndex",
"aclmdlCreateDataset",
"aclmdlDestroyDataset",
"aclmdlAddDatasetBuffer",
"aclmdlGetDatasetNumBuffers",
"aclmdlGetDatasetBuffer",
"aclmdlLoadFromFile",
"aclmdlLoadFromMem",
"aclmdlLoadFromFileWithMem",
"aclmdlLoadFromMemWithMem",
"aclmdlLoadFromFileWithQ",
"aclmdlLoadFromMemWithQ",
"aclmdlExecute",
"aclmdlExecuteAsync",
"aclmdlUnload",
"aclmdlQuerySize",
"aclmdlQuerySizeFromMem",
"aclmdlSetDynamicBatchSize",
"aclmdlSetDynamicHWSize",
"aclmdlGetInputDims",
"aclmdlGetInputDimsV2",
"aclmdlGetOutputDims",
"aclmdlGetCurOutputDims",
"aclmdlGetInputNameByIndex",
"aclmdlGetOutputNameByIndex",
"aclmdlGetInputFormat",
"aclmdlGetOutputFormat",
"aclmdlGetInputDataType",
"aclmdlGetOutputDataType",
"aclmdlGetInputIndexByName",
"aclmdlGetOutputIndexByName",
"aclmdlGetDynamicBatch",
"aclmdlGetDynamicHW",
"aclmdlCreateAIPP",
"aclmdlDestroyAIPP",
"aclmdlSetAIPPInputFormat",
"aclmdlSetAIPPCscParams",
"aclmdlSetAIPPRbuvSwapSwitch",
"aclmdlSetAIPPAxSwapSwitch",
"aclmdlSetAIPPSrcImageSize",
"aclmdlSetAIPPScfParams",
"aclmdlSetAIPPCropParams",
"aclmdlSetAIPPPaddingParams",
"aclmdlSetAIPPDtcPixelMean",
"aclmdlSetAIPPDtcPixelMin",
"aclmdlSetAIPPPixelVarReci",
"aclmdlSetInputAIPP",
"aclmdlGetFirstAippInfo",
"aclInit",
"aclFinalize"};
static void load_library() {
static bool done = false;
static std::mutex mtx;
std::lock_guard<std::mutex> lg{mtx};
if (done)
return;
void* handle = get_library_handle();
for (size_t i = 0; i < NR_FUNC; ++i) {
void* func;
if (!handle) {
func = nullptr;
} else {
func = resolve_library_func(handle, g_func_name[i]);
}
if (!func) {
func = g_func_table_error[i];
}
__atomic_store_n(g_func_table + i, func, __ATOMIC_RELAXED);
}
done = true;
}
float _WRAPLIB_API_CALL aclFloat16ToFloat(aclFloat16 arg0) {
typedef float (_WRAPLIB_API_CALL *f_ptr_t)(aclFloat16);
ON_ENTRY(aclFloat16ToFloat);
f_ptr_t f = (f_ptr_t)(g_func_table[0]);
return f(arg0);
}
aclFloat16 _WRAPLIB_API_CALL aclFloatToFloat16(float arg0) {
typedef aclFloat16 (_WRAPLIB_API_CALL *f_ptr_t)(float);
ON_ENTRY(aclFloatToFloat16);
f_ptr_t f = (f_ptr_t)(g_func_table[1]);
return f(arg0);
}
aclDataBuffer _WRAPLIB_API_CALL *aclCreateDataBuffer(void *arg0, size_t arg1) {
typedef aclDataBuffer *(_WRAPLIB_API_CALL *f_ptr_t)(void *, size_t);
ON_ENTRY(aclCreateDataBuffer);
f_ptr_t f = (f_ptr_t)(g_func_table[2]);
return f(arg0, arg1);
}
aclError _WRAPLIB_API_CALL aclDestroyDataBuffer(const aclDataBuffer *arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const aclDataBuffer *);
ON_ENTRY(aclDestroyDataBuffer);
f_ptr_t f = (f_ptr_t)(g_func_table[3]);
return f(arg0);
}
void _WRAPLIB_API_CALL *aclGetDataBufferAddr(const aclDataBuffer *arg0) {
typedef void *(_WRAPLIB_API_CALL *f_ptr_t)(const aclDataBuffer *);
ON_ENTRY(aclGetDataBufferAddr);
f_ptr_t f = (f_ptr_t)(g_func_table[4]);
return f(arg0);
}
uint32_t _WRAPLIB_API_CALL aclGetDataBufferSize(const aclDataBuffer *arg0) {
typedef uint32_t (_WRAPLIB_API_CALL *f_ptr_t)(const aclDataBuffer *);
ON_ENTRY(aclGetDataBufferSize);
f_ptr_t f = (f_ptr_t)(g_func_table[5]);
return f(arg0);
}
size_t _WRAPLIB_API_CALL aclDataTypeSize(aclDataType arg0) {
typedef size_t (_WRAPLIB_API_CALL *f_ptr_t)(aclDataType);
ON_ENTRY(aclDataTypeSize);
f_ptr_t f = (f_ptr_t)(g_func_table[6]);
return f(arg0);
}
aclTensorDesc _WRAPLIB_API_CALL *aclCreateTensorDesc(aclDataType arg0, int arg1, const int64_t *arg2, aclFormat arg3) {
typedef aclTensorDesc *(_WRAPLIB_API_CALL *f_ptr_t)(aclDataType, int, const int64_t *, aclFormat);
ON_ENTRY(aclCreateTensorDesc);
f_ptr_t f = (f_ptr_t)(g_func_table[7]);
return f(arg0, arg1, arg2, arg3);
}
void _WRAPLIB_API_CALL aclDestroyTensorDesc(const aclTensorDesc *arg0) {
typedef void (_WRAPLIB_API_CALL *f_ptr_t)(const aclTensorDesc *);
ON_ENTRY(aclDestroyTensorDesc);
f_ptr_t f = (f_ptr_t)(g_func_table[8]);
return f(arg0);
}
aclDataType _WRAPLIB_API_CALL aclGetTensorDescType(const aclTensorDesc *arg0) {
typedef aclDataType (_WRAPLIB_API_CALL *f_ptr_t)(const aclTensorDesc *);
ON_ENTRY(aclGetTensorDescType);
f_ptr_t f = (f_ptr_t)(g_func_table[9]);
return f(arg0);
}
aclFormat _WRAPLIB_API_CALL aclGetTensorDescFormat(const aclTensorDesc *arg0) {
typedef aclFormat (_WRAPLIB_API_CALL *f_ptr_t)(const aclTensorDesc *);
ON_ENTRY(aclGetTensorDescFormat);
f_ptr_t f = (f_ptr_t)(g_func_table[10]);
return f(arg0);
}
size_t _WRAPLIB_API_CALL aclGetTensorDescSize(const aclTensorDesc *arg0) {
typedef size_t (_WRAPLIB_API_CALL *f_ptr_t)(const aclTensorDesc *);
ON_ENTRY(aclGetTensorDescSize);
f_ptr_t f = (f_ptr_t)(g_func_table[11]);
return f(arg0);
}
size_t _WRAPLIB_API_CALL aclGetTensorDescElementCount(const aclTensorDesc *arg0) {
typedef size_t (_WRAPLIB_API_CALL *f_ptr_t)(const aclTensorDesc *);
ON_ENTRY(aclGetTensorDescElementCount);
f_ptr_t f = (f_ptr_t)(g_func_table[12]);
return f(arg0);
}
size_t _WRAPLIB_API_CALL aclGetTensorDescNumDims(const aclTensorDesc *arg0) {
typedef size_t (_WRAPLIB_API_CALL *f_ptr_t)(const aclTensorDesc *);
ON_ENTRY(aclGetTensorDescNumDims);
f_ptr_t f = (f_ptr_t)(g_func_table[13]);
return f(arg0);
}
int64_t _WRAPLIB_API_CALL aclGetTensorDescDim(const aclTensorDesc *arg0, size_t arg1) {
typedef int64_t (_WRAPLIB_API_CALL *f_ptr_t)(const aclTensorDesc *, size_t);
ON_ENTRY(aclGetTensorDescDim);
f_ptr_t f = (f_ptr_t)(g_func_table[14]);
return f(arg0, arg1);
}
void _WRAPLIB_API_CALL aclSetTensorDescName(aclTensorDesc *arg0, const char *arg1) {
typedef void (_WRAPLIB_API_CALL *f_ptr_t)(aclTensorDesc *, const char *);
ON_ENTRY(aclSetTensorDescName);
f_ptr_t f = (f_ptr_t)(g_func_table[15]);
return f(arg0, arg1);
}
const char _WRAPLIB_API_CALL *aclGetTensorDescName(aclTensorDesc *arg0) {
typedef const char *(_WRAPLIB_API_CALL *f_ptr_t)(aclTensorDesc *);
ON_ENTRY(aclGetTensorDescName);
f_ptr_t f = (f_ptr_t)(g_func_table[16]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclTransTensorDescFormat(const aclTensorDesc *arg0, aclFormat arg1, aclTensorDesc **arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const aclTensorDesc *, aclFormat, aclTensorDesc **);
ON_ENTRY(aclTransTensorDescFormat);
f_ptr_t f = (f_ptr_t)(g_func_table[17]);
return f(arg0, arg1, arg2);
}
aclError _WRAPLIB_API_CALL aclSetTensorStorageFormat(aclTensorDesc *arg0, aclFormat arg1) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclTensorDesc *, aclFormat);
ON_ENTRY(aclSetTensorStorageFormat);
f_ptr_t f = (f_ptr_t)(g_func_table[18]);
return f(arg0, arg1);
}
aclError _WRAPLIB_API_CALL aclSetTensorStorageShape(aclTensorDesc *arg0, int arg1, const int64_t *arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclTensorDesc *, int, const int64_t *);
ON_ENTRY(aclSetTensorStorageShape);
f_ptr_t f = (f_ptr_t)(g_func_table[19]);
return f(arg0, arg1, arg2);
}
void _WRAPLIB_API_CALL aclAppLog(aclLogLevel arg0, const char *arg1, const char *arg2, uint32_t arg3, const char *arg4, ...) {
typedef void (_WRAPLIB_API_CALL *f_ptr_t)(aclLogLevel, const char *, const char *, uint32_t, const char *, ...);
ON_ENTRY(aclAppLog);
f_ptr_t f = (f_ptr_t)(g_func_table[20]);
return f(arg0, arg1, arg2, arg3, arg4);
}
aclError _WRAPLIB_API_CALL aclrtSetExceptionInfoCallback(aclrtExceptionInfoCallback arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclrtExceptionInfoCallback);
ON_ENTRY(aclrtSetExceptionInfoCallback);
f_ptr_t f = (f_ptr_t)(g_func_table[21]);
return f(arg0);
}
uint32_t _WRAPLIB_API_CALL aclrtGetTaskIdFromExceptionInfo(const aclrtExceptionInfo *arg0) {
typedef uint32_t (_WRAPLIB_API_CALL *f_ptr_t)(const aclrtExceptionInfo *);
ON_ENTRY(aclrtGetTaskIdFromExceptionInfo);
f_ptr_t f = (f_ptr_t)(g_func_table[22]);
return f(arg0);
}
uint32_t _WRAPLIB_API_CALL aclrtGetStreamIdFromExceptionInfo(const aclrtExceptionInfo *arg0) {
typedef uint32_t (_WRAPLIB_API_CALL *f_ptr_t)(const aclrtExceptionInfo *);
ON_ENTRY(aclrtGetStreamIdFromExceptionInfo);
f_ptr_t f = (f_ptr_t)(g_func_table[23]);
return f(arg0);
}
uint32_t _WRAPLIB_API_CALL aclrtGetThreadIdFromExceptionInfo(const aclrtExceptionInfo *arg0) {
typedef uint32_t (_WRAPLIB_API_CALL *f_ptr_t)(const aclrtExceptionInfo *);
ON_ENTRY(aclrtGetThreadIdFromExceptionInfo);
f_ptr_t f = (f_ptr_t)(g_func_table[24]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtSubscribeReport(uint64_t arg0, aclrtStream arg1) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(uint64_t, aclrtStream);
ON_ENTRY(aclrtSubscribeReport);
f_ptr_t f = (f_ptr_t)(g_func_table[25]);
return f(arg0, arg1);
}
aclError _WRAPLIB_API_CALL aclrtLaunchCallback(aclrtCallback arg0, void *arg1, aclrtCallbackBlockType arg2, aclrtStream arg3) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclrtCallback, void *, aclrtCallbackBlockType, aclrtStream);
ON_ENTRY(aclrtLaunchCallback);
f_ptr_t f = (f_ptr_t)(g_func_table[26]);
return f(arg0, arg1, arg2, arg3);
}
aclError _WRAPLIB_API_CALL aclrtProcessReport(int32_t arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(int32_t);
ON_ENTRY(aclrtProcessReport);
f_ptr_t f = (f_ptr_t)(g_func_table[27]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtUnSubscribeReport(uint64_t arg0, aclrtStream arg1) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(uint64_t, aclrtStream);
ON_ENTRY(aclrtUnSubscribeReport);
f_ptr_t f = (f_ptr_t)(g_func_table[28]);
return f(arg0, arg1);
}
aclError _WRAPLIB_API_CALL aclrtCreateContext(aclrtContext *arg0, int32_t arg1) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclrtContext *, int32_t);
ON_ENTRY(aclrtCreateContext);
f_ptr_t f = (f_ptr_t)(g_func_table[29]);
return f(arg0, arg1);
}
aclError _WRAPLIB_API_CALL aclrtDestroyContext(aclrtContext arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclrtContext);
ON_ENTRY(aclrtDestroyContext);
f_ptr_t f = (f_ptr_t)(g_func_table[30]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtSetCurrentContext(aclrtContext arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclrtContext);
ON_ENTRY(aclrtSetCurrentContext);
f_ptr_t f = (f_ptr_t)(g_func_table[31]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtGetCurrentContext(aclrtContext *arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclrtContext *);
ON_ENTRY(aclrtGetCurrentContext);
f_ptr_t f = (f_ptr_t)(g_func_table[32]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtSetDevice(int32_t arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(int32_t);
ON_ENTRY(aclrtSetDevice);
f_ptr_t f = (f_ptr_t)(g_func_table[33]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtResetDevice(int32_t arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(int32_t);
ON_ENTRY(aclrtResetDevice);
f_ptr_t f = (f_ptr_t)(g_func_table[34]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtGetDevice(int32_t *arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(int32_t *);
ON_ENTRY(aclrtGetDevice);
f_ptr_t f = (f_ptr_t)(g_func_table[35]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtGetRunMode(aclrtRunMode *arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclrtRunMode *);
ON_ENTRY(aclrtGetRunMode);
f_ptr_t f = (f_ptr_t)(g_func_table[36]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtSynchronizeDevice() {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)();
ON_ENTRY(aclrtSynchronizeDevice);
f_ptr_t f = (f_ptr_t)(g_func_table[37]);
return f();
}
aclError _WRAPLIB_API_CALL aclrtSetTsDevice(aclrtTsId arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclrtTsId);
ON_ENTRY(aclrtSetTsDevice);
f_ptr_t f = (f_ptr_t)(g_func_table[38]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtGetDeviceCount(uint32_t *arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(uint32_t *);
ON_ENTRY(aclrtGetDeviceCount);
f_ptr_t f = (f_ptr_t)(g_func_table[39]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtCreateEvent(aclrtEvent *arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclrtEvent *);
ON_ENTRY(aclrtCreateEvent);
f_ptr_t f = (f_ptr_t)(g_func_table[40]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtDestroyEvent(aclrtEvent arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclrtEvent);
ON_ENTRY(aclrtDestroyEvent);
f_ptr_t f = (f_ptr_t)(g_func_table[41]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtRecordEvent(aclrtEvent arg0, aclrtStream arg1) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclrtEvent, aclrtStream);
ON_ENTRY(aclrtRecordEvent);
f_ptr_t f = (f_ptr_t)(g_func_table[42]);
return f(arg0, arg1);
}
aclError _WRAPLIB_API_CALL aclrtResetEvent(aclrtEvent arg0, aclrtStream arg1) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclrtEvent, aclrtStream);
ON_ENTRY(aclrtResetEvent);
f_ptr_t f = (f_ptr_t)(g_func_table[43]);
return f(arg0, arg1);
}
aclError _WRAPLIB_API_CALL aclrtQueryEvent(aclrtEvent arg0, aclrtEventStatus *arg1) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclrtEvent, aclrtEventStatus *);
ON_ENTRY(aclrtQueryEvent);
f_ptr_t f = (f_ptr_t)(g_func_table[44]);
return f(arg0, arg1);
}
aclError _WRAPLIB_API_CALL aclrtSynchronizeEvent(aclrtEvent arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclrtEvent);
ON_ENTRY(aclrtSynchronizeEvent);
f_ptr_t f = (f_ptr_t)(g_func_table[45]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtEventElapsedTime(float *arg0, aclrtEvent arg1, aclrtEvent arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(float *, aclrtEvent, aclrtEvent);
ON_ENTRY(aclrtEventElapsedTime);
f_ptr_t f = (f_ptr_t)(g_func_table[46]);
return f(arg0, arg1, arg2);
}
aclError _WRAPLIB_API_CALL aclrtMalloc(void **arg0, size_t arg1, aclrtMemMallocPolicy arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(void **, size_t, aclrtMemMallocPolicy);
ON_ENTRY(aclrtMalloc);
f_ptr_t f = (f_ptr_t)(g_func_table[47]);
return f(arg0, arg1, arg2);
}
aclError _WRAPLIB_API_CALL aclrtFree(void *arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(void *);
ON_ENTRY(aclrtFree);
f_ptr_t f = (f_ptr_t)(g_func_table[48]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtMallocHost(void **arg0, size_t arg1) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(void **, size_t);
ON_ENTRY(aclrtMallocHost);
f_ptr_t f = (f_ptr_t)(g_func_table[49]);
return f(arg0, arg1);
}
aclError _WRAPLIB_API_CALL aclrtFreeHost(void *arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(void *);
ON_ENTRY(aclrtFreeHost);
f_ptr_t f = (f_ptr_t)(g_func_table[50]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtMemcpy(void *arg0, size_t arg1, const void *arg2, size_t arg3, aclrtMemcpyKind arg4) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(void *, size_t, const void *, size_t, aclrtMemcpyKind);
ON_ENTRY(aclrtMemcpy);
f_ptr_t f = (f_ptr_t)(g_func_table[51]);
return f(arg0, arg1, arg2, arg3, arg4);
}
aclError _WRAPLIB_API_CALL aclrtMemset(void *arg0, size_t arg1, int32_t arg2, size_t arg3) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(void *, size_t, int32_t, size_t);
ON_ENTRY(aclrtMemset);
f_ptr_t f = (f_ptr_t)(g_func_table[52]);
return f(arg0, arg1, arg2, arg3);
}
aclError _WRAPLIB_API_CALL aclrtMemcpyAsync(void *arg0, size_t arg1, const void *arg2, size_t arg3, aclrtMemcpyKind arg4, aclrtStream arg5) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(void *, size_t, const void *, size_t, aclrtMemcpyKind, aclrtStream);
ON_ENTRY(aclrtMemcpyAsync);
f_ptr_t f = (f_ptr_t)(g_func_table[53]);
return f(arg0, arg1, arg2, arg3, arg4, arg5);
}
aclError _WRAPLIB_API_CALL aclrtMemsetAsync(void *arg0, size_t arg1, int32_t arg2, size_t arg3, aclrtStream arg4) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(void *, size_t, int32_t, size_t, aclrtStream);
ON_ENTRY(aclrtMemsetAsync);
f_ptr_t f = (f_ptr_t)(g_func_table[54]);
return f(arg0, arg1, arg2, arg3, arg4);
}
aclError _WRAPLIB_API_CALL aclrtCreateStream(aclrtStream *arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclrtStream *);
ON_ENTRY(aclrtCreateStream);
f_ptr_t f = (f_ptr_t)(g_func_table[55]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtDestroyStream(aclrtStream arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclrtStream);
ON_ENTRY(aclrtDestroyStream);
f_ptr_t f = (f_ptr_t)(g_func_table[56]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtSynchronizeStream(aclrtStream arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclrtStream);
ON_ENTRY(aclrtSynchronizeStream);
f_ptr_t f = (f_ptr_t)(g_func_table[57]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclrtStreamWaitEvent(aclrtStream arg0, aclrtEvent arg1) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclrtStream, aclrtEvent);
ON_ENTRY(aclrtStreamWaitEvent);
f_ptr_t f = (f_ptr_t)(g_func_table[58]);
return f(arg0, arg1);
}
aclError _WRAPLIB_API_CALL aclopSetModelDir(const char *arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const char *);
ON_ENTRY(aclopSetModelDir);
f_ptr_t f = (f_ptr_t)(g_func_table[59]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclopLoad(const void *arg0, size_t arg1) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const void *, size_t);
ON_ENTRY(aclopLoad);
f_ptr_t f = (f_ptr_t)(g_func_table[60]);
return f(arg0, arg1);
}
aclopAttr _WRAPLIB_API_CALL *aclopCreateAttr() {
typedef aclopAttr *(_WRAPLIB_API_CALL *f_ptr_t)();
ON_ENTRY(aclopCreateAttr);
f_ptr_t f = (f_ptr_t)(g_func_table[61]);
return f();
}
void _WRAPLIB_API_CALL aclopDestroyAttr(const aclopAttr *arg0) {
typedef void (_WRAPLIB_API_CALL *f_ptr_t)(const aclopAttr *);
ON_ENTRY(aclopDestroyAttr);
f_ptr_t f = (f_ptr_t)(g_func_table[62]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclopSetAttrBool(aclopAttr *arg0, const char *arg1, uint8_t arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclopAttr *, const char *, uint8_t);
ON_ENTRY(aclopSetAttrBool);
f_ptr_t f = (f_ptr_t)(g_func_table[63]);
return f(arg0, arg1, arg2);
}
aclError _WRAPLIB_API_CALL aclopSetAttrInt(aclopAttr *arg0, const char *arg1, int64_t arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclopAttr *, const char *, int64_t);
ON_ENTRY(aclopSetAttrInt);
f_ptr_t f = (f_ptr_t)(g_func_table[64]);
return f(arg0, arg1, arg2);
}
aclError _WRAPLIB_API_CALL aclopSetAttrFloat(aclopAttr *arg0, const char *arg1, float arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclopAttr *, const char *, float);
ON_ENTRY(aclopSetAttrFloat);
f_ptr_t f = (f_ptr_t)(g_func_table[65]);
return f(arg0, arg1, arg2);
}
aclError _WRAPLIB_API_CALL aclopSetAttrString(aclopAttr *arg0, const char *arg1, const char *arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclopAttr *, const char *, const char *);
ON_ENTRY(aclopSetAttrString);
f_ptr_t f = (f_ptr_t)(g_func_table[66]);
return f(arg0, arg1, arg2);
}
aclError _WRAPLIB_API_CALL aclopSetAttrListBool(aclopAttr *arg0, const char *arg1, int arg2, const uint8_t *arg3) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclopAttr *, const char *, int, const uint8_t *);
ON_ENTRY(aclopSetAttrListBool);
f_ptr_t f = (f_ptr_t)(g_func_table[67]);
return f(arg0, arg1, arg2, arg3);
}
aclError _WRAPLIB_API_CALL aclopSetAttrListInt(aclopAttr *arg0, const char *arg1, int arg2, const int64_t *arg3) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclopAttr *, const char *, int, const int64_t *);
ON_ENTRY(aclopSetAttrListInt);
f_ptr_t f = (f_ptr_t)(g_func_table[68]);
return f(arg0, arg1, arg2, arg3);
}
aclError _WRAPLIB_API_CALL aclopSetAttrListFloat(aclopAttr *arg0, const char *arg1, int arg2, const float *arg3) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclopAttr *, const char *, int, const float *);
ON_ENTRY(aclopSetAttrListFloat);
f_ptr_t f = (f_ptr_t)(g_func_table[69]);
return f(arg0, arg1, arg2, arg3);
}
aclError _WRAPLIB_API_CALL aclopSetAttrListString(aclopAttr *arg0, const char *arg1, int arg2, const char **arg3) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclopAttr *, const char *, int, const char **);
ON_ENTRY(aclopSetAttrListString);
f_ptr_t f = (f_ptr_t)(g_func_table[70]);
return f(arg0, arg1, arg2, arg3);
}
aclError _WRAPLIB_API_CALL aclopSetAttrListListInt(aclopAttr *arg0, const char *arg1, int arg2, const int *arg3, const int64_t * const arg4[]) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclopAttr *, const char *, int, const int *, const int64_t * const []);
ON_ENTRY(aclopSetAttrListListInt);
f_ptr_t f = (f_ptr_t)(g_func_table[71]);
return f(arg0, arg1, arg2, arg3, arg4);
}
aclError _WRAPLIB_API_CALL aclopExecute(const char *arg0, int arg1, const aclTensorDesc * const arg2[], const aclDataBuffer * const arg3[], int arg4, const aclTensorDesc * const arg5[], aclDataBuffer * const arg6[], const aclopAttr *arg7, aclrtStream arg8) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const char *, int, const aclTensorDesc * const [], const aclDataBuffer * const [], int, const aclTensorDesc * const [], aclDataBuffer * const [], const aclopAttr *, aclrtStream);
ON_ENTRY(aclopExecute);
f_ptr_t f = (f_ptr_t)(g_func_table[72]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
}
aclError _WRAPLIB_API_CALL aclopCreateHandle(const char *arg0, int arg1, const aclTensorDesc * const arg2[], int arg3, const aclTensorDesc * const arg4[], const aclopAttr *arg5, aclopHandle **arg6) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const char *, int, const aclTensorDesc * const [], int, const aclTensorDesc * const [], const aclopAttr *, aclopHandle **);
ON_ENTRY(aclopCreateHandle);
f_ptr_t f = (f_ptr_t)(g_func_table[73]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
}
void _WRAPLIB_API_CALL aclopDestroyHandle(aclopHandle *arg0) {
typedef void (_WRAPLIB_API_CALL *f_ptr_t)(aclopHandle *);
ON_ENTRY(aclopDestroyHandle);
f_ptr_t f = (f_ptr_t)(g_func_table[74]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclopExecWithHandle(aclopHandle *arg0, int arg1, const aclDataBuffer * const arg2[], int arg3, aclDataBuffer * const arg4[], aclrtStream arg5) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclopHandle *, int, const aclDataBuffer * const [], int, aclDataBuffer * const [], aclrtStream);
ON_ENTRY(aclopExecWithHandle);
f_ptr_t f = (f_ptr_t)(g_func_table[75]);
return f(arg0, arg1, arg2, arg3, arg4, arg5);
}
aclError _WRAPLIB_API_CALL aclopCast(const aclTensorDesc *arg0, const aclDataBuffer *arg1, const aclTensorDesc *arg2, aclDataBuffer *arg3, uint8_t arg4, aclrtStream arg5) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const aclTensorDesc *, const aclDataBuffer *, const aclTensorDesc *, aclDataBuffer *, uint8_t, aclrtStream);
ON_ENTRY(aclopCast);
f_ptr_t f = (f_ptr_t)(g_func_table[76]);
return f(arg0, arg1, arg2, arg3, arg4, arg5);
}
aclError _WRAPLIB_API_CALL aclopCreateHandleForCast(aclTensorDesc *arg0, aclTensorDesc *arg1, uint8_t arg2, aclopHandle **arg3) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclTensorDesc *, aclTensorDesc *, uint8_t, aclopHandle **);
ON_ENTRY(aclopCreateHandleForCast);
f_ptr_t f = (f_ptr_t)(g_func_table[77]);
return f(arg0, arg1, arg2, arg3);
}
aclError _WRAPLIB_API_CALL aclopCreateKernel(const char *arg0, const char *arg1, const char *arg2, void *arg3, int arg4, aclopEngineType arg5, aclDataDeallocator arg6) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const char *, const char *, const char *, void *, int, aclopEngineType, aclDataDeallocator);
ON_ENTRY(aclopCreateKernel);
f_ptr_t f = (f_ptr_t)(g_func_table[78]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
}
aclError _WRAPLIB_API_CALL aclopRegisterCompileFunc(const char *arg0, aclopCompileFunc arg1) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const char *, aclopCompileFunc);
ON_ENTRY(aclopRegisterCompileFunc);
f_ptr_t f = (f_ptr_t)(g_func_table[79]);
return f(arg0, arg1);
}
aclError _WRAPLIB_API_CALL aclopUnregisterCompileFunc(const char *arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const char *);
ON_ENTRY(aclopUnregisterCompileFunc);
f_ptr_t f = (f_ptr_t)(g_func_table[80]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclopSetKernelArgs(aclopKernelDesc *arg0, const char *arg1, uint32_t arg2, const void *arg3, uint32_t arg4) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclopKernelDesc *, const char *, uint32_t, const void *, uint32_t);
ON_ENTRY(aclopSetKernelArgs);
f_ptr_t f = (f_ptr_t)(g_func_table[81]);
return f(arg0, arg1, arg2, arg3, arg4);
}
aclError _WRAPLIB_API_CALL aclopSetKernelWorkspaceSizes(aclopKernelDesc *arg0, int arg1, size_t *arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclopKernelDesc *, int, size_t *);
ON_ENTRY(aclopSetKernelWorkspaceSizes);
f_ptr_t f = (f_ptr_t)(g_func_table[82]);
return f(arg0, arg1, arg2);
}
aclError _WRAPLIB_API_CALL aclopUpdateParams(const char *arg0, int arg1, const aclTensorDesc * const arg2[], int arg3, const aclTensorDesc * const arg4[], const aclopAttr *arg5) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const char *, int, const aclTensorDesc * const [], int, const aclTensorDesc * const [], const aclopAttr *);
ON_ENTRY(aclopUpdateParams);
f_ptr_t f = (f_ptr_t)(g_func_table[83]);
return f(arg0, arg1, arg2, arg3, arg4, arg5);
}
aclmdlDesc _WRAPLIB_API_CALL *aclmdlCreateDesc() {
typedef aclmdlDesc *(_WRAPLIB_API_CALL *f_ptr_t)();
ON_ENTRY(aclmdlCreateDesc);
f_ptr_t f = (f_ptr_t)(g_func_table[84]);
return f();
}
aclError _WRAPLIB_API_CALL aclmdlDestroyDesc(aclmdlDesc *arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclmdlDesc *);
ON_ENTRY(aclmdlDestroyDesc);
f_ptr_t f = (f_ptr_t)(g_func_table[85]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclmdlGetDesc(aclmdlDesc *arg0, uint32_t arg1) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclmdlDesc *, uint32_t);
ON_ENTRY(aclmdlGetDesc);
f_ptr_t f = (f_ptr_t)(g_func_table[86]);
return f(arg0, arg1);
}
size_t _WRAPLIB_API_CALL aclmdlGetNumInputs(aclmdlDesc *arg0) {
typedef size_t (_WRAPLIB_API_CALL *f_ptr_t)(aclmdlDesc *);
ON_ENTRY(aclmdlGetNumInputs);
f_ptr_t f = (f_ptr_t)(g_func_table[87]);
return f(arg0);
}
size_t _WRAPLIB_API_CALL aclmdlGetNumOutputs(aclmdlDesc *arg0) {
typedef size_t (_WRAPLIB_API_CALL *f_ptr_t)(aclmdlDesc *);
ON_ENTRY(aclmdlGetNumOutputs);
f_ptr_t f = (f_ptr_t)(g_func_table[88]);
return f(arg0);
}
size_t _WRAPLIB_API_CALL aclmdlGetInputSizeByIndex(aclmdlDesc *arg0, size_t arg1) {
typedef size_t (_WRAPLIB_API_CALL *f_ptr_t)(aclmdlDesc *, size_t);
ON_ENTRY(aclmdlGetInputSizeByIndex);
f_ptr_t f = (f_ptr_t)(g_func_table[89]);
return f(arg0, arg1);
}
size_t _WRAPLIB_API_CALL aclmdlGetOutputSizeByIndex(aclmdlDesc *arg0, size_t arg1) {
typedef size_t (_WRAPLIB_API_CALL *f_ptr_t)(aclmdlDesc *, size_t);
ON_ENTRY(aclmdlGetOutputSizeByIndex);
f_ptr_t f = (f_ptr_t)(g_func_table[90]);
return f(arg0, arg1);
}
aclmdlDataset _WRAPLIB_API_CALL *aclmdlCreateDataset() {
typedef aclmdlDataset *(_WRAPLIB_API_CALL *f_ptr_t)();
ON_ENTRY(aclmdlCreateDataset);
f_ptr_t f = (f_ptr_t)(g_func_table[91]);
return f();
}
aclError _WRAPLIB_API_CALL aclmdlDestroyDataset(const aclmdlDataset *arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const aclmdlDataset *);
ON_ENTRY(aclmdlDestroyDataset);
f_ptr_t f = (f_ptr_t)(g_func_table[92]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclmdlAddDatasetBuffer(aclmdlDataset *arg0, aclDataBuffer *arg1) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclmdlDataset *, aclDataBuffer *);
ON_ENTRY(aclmdlAddDatasetBuffer);
f_ptr_t f = (f_ptr_t)(g_func_table[93]);
return f(arg0, arg1);
}
size_t _WRAPLIB_API_CALL aclmdlGetDatasetNumBuffers(const aclmdlDataset *arg0) {
typedef size_t (_WRAPLIB_API_CALL *f_ptr_t)(const aclmdlDataset *);
ON_ENTRY(aclmdlGetDatasetNumBuffers);
f_ptr_t f = (f_ptr_t)(g_func_table[94]);
return f(arg0);
}
aclDataBuffer _WRAPLIB_API_CALL *aclmdlGetDatasetBuffer(const aclmdlDataset *arg0, size_t arg1) {
typedef aclDataBuffer *(_WRAPLIB_API_CALL *f_ptr_t)(const aclmdlDataset *, size_t);
ON_ENTRY(aclmdlGetDatasetBuffer);
f_ptr_t f = (f_ptr_t)(g_func_table[95]);
return f(arg0, arg1);
}
aclError _WRAPLIB_API_CALL aclmdlLoadFromFile(const char *arg0, uint32_t *arg1) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const char *, uint32_t *);
ON_ENTRY(aclmdlLoadFromFile);
f_ptr_t f = (f_ptr_t)(g_func_table[96]);
return f(arg0, arg1);
}
aclError _WRAPLIB_API_CALL aclmdlLoadFromMem(const void *arg0, size_t arg1, uint32_t *arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const void *, size_t, uint32_t *);
ON_ENTRY(aclmdlLoadFromMem);
f_ptr_t f = (f_ptr_t)(g_func_table[97]);
return f(arg0, arg1, arg2);
}
aclError _WRAPLIB_API_CALL aclmdlLoadFromFileWithMem(const char *arg0, uint32_t *arg1, void *arg2, size_t arg3, void *arg4, size_t arg5) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const char *, uint32_t *, void *, size_t, void *, size_t);
ON_ENTRY(aclmdlLoadFromFileWithMem);
f_ptr_t f = (f_ptr_t)(g_func_table[98]);
return f(arg0, arg1, arg2, arg3, arg4, arg5);
}
aclError _WRAPLIB_API_CALL aclmdlLoadFromMemWithMem(const void *arg0, size_t arg1, uint32_t *arg2, void *arg3, size_t arg4, void *arg5, size_t arg6) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const void *, size_t, uint32_t *, void *, size_t, void *, size_t);
ON_ENTRY(aclmdlLoadFromMemWithMem);
f_ptr_t f = (f_ptr_t)(g_func_table[99]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
}
aclError _WRAPLIB_API_CALL aclmdlLoadFromFileWithQ(const char *arg0, uint32_t *arg1, const uint32_t *arg2, size_t arg3, const uint32_t *arg4, size_t arg5) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const char *, uint32_t *, const uint32_t *, size_t, const uint32_t *, size_t);
ON_ENTRY(aclmdlLoadFromFileWithQ);
f_ptr_t f = (f_ptr_t)(g_func_table[100]);
return f(arg0, arg1, arg2, arg3, arg4, arg5);
}
aclError _WRAPLIB_API_CALL aclmdlLoadFromMemWithQ(const void *arg0, size_t arg1, uint32_t *arg2, const uint32_t *arg3, size_t arg4, const uint32_t *arg5, size_t arg6) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const void *, size_t, uint32_t *, const uint32_t *, size_t, const uint32_t *, size_t);
ON_ENTRY(aclmdlLoadFromMemWithQ);
f_ptr_t f = (f_ptr_t)(g_func_table[101]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
}
aclError _WRAPLIB_API_CALL aclmdlExecute(uint32_t arg0, const aclmdlDataset *arg1, aclmdlDataset *arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(uint32_t, const aclmdlDataset *, aclmdlDataset *);
ON_ENTRY(aclmdlExecute);
f_ptr_t f = (f_ptr_t)(g_func_table[102]);
return f(arg0, arg1, arg2);
}
aclError _WRAPLIB_API_CALL aclmdlExecuteAsync(uint32_t arg0, const aclmdlDataset *arg1, aclmdlDataset *arg2, aclrtStream arg3) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(uint32_t, const aclmdlDataset *, aclmdlDataset *, aclrtStream);
ON_ENTRY(aclmdlExecuteAsync);
f_ptr_t f = (f_ptr_t)(g_func_table[103]);
return f(arg0, arg1, arg2, arg3);
}
aclError _WRAPLIB_API_CALL aclmdlUnload(uint32_t arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(uint32_t);
ON_ENTRY(aclmdlUnload);
f_ptr_t f = (f_ptr_t)(g_func_table[104]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclmdlQuerySize(const char *arg0, size_t *arg1, size_t *arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const char *, size_t *, size_t *);
ON_ENTRY(aclmdlQuerySize);
f_ptr_t f = (f_ptr_t)(g_func_table[105]);
return f(arg0, arg1, arg2);
}
aclError _WRAPLIB_API_CALL aclmdlQuerySizeFromMem(const void *arg0, size_t arg1, size_t *arg2, size_t *arg3) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const void *, size_t, size_t *, size_t *);
ON_ENTRY(aclmdlQuerySizeFromMem);
f_ptr_t f = (f_ptr_t)(g_func_table[106]);
return f(arg0, arg1, arg2, arg3);
}
aclError _WRAPLIB_API_CALL aclmdlSetDynamicBatchSize(uint32_t arg0, aclmdlDataset *arg1, size_t arg2, uint64_t arg3) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(uint32_t, aclmdlDataset *, size_t, uint64_t);
ON_ENTRY(aclmdlSetDynamicBatchSize);
f_ptr_t f = (f_ptr_t)(g_func_table[107]);
return f(arg0, arg1, arg2, arg3);
}
aclError _WRAPLIB_API_CALL aclmdlSetDynamicHWSize(uint32_t arg0, aclmdlDataset *arg1, size_t arg2, uint64_t arg3, uint64_t arg4) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(uint32_t, aclmdlDataset *, size_t, uint64_t, uint64_t);
ON_ENTRY(aclmdlSetDynamicHWSize);
f_ptr_t f = (f_ptr_t)(g_func_table[108]);
return f(arg0, arg1, arg2, arg3, arg4);
}
aclError _WRAPLIB_API_CALL aclmdlGetInputDims(const aclmdlDesc *arg0, size_t arg1, aclmdlIODims *arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const aclmdlDesc *, size_t, aclmdlIODims *);
ON_ENTRY(aclmdlGetInputDims);
f_ptr_t f = (f_ptr_t)(g_func_table[109]);
return f(arg0, arg1, arg2);
}
aclError _WRAPLIB_API_CALL aclmdlGetInputDimsV2(const aclmdlDesc *arg0, size_t arg1, aclmdlIODims *arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const aclmdlDesc *, size_t, aclmdlIODims *);
ON_ENTRY(aclmdlGetInputDimsV2);
f_ptr_t f = (f_ptr_t)(g_func_table[110]);
return f(arg0, arg1, arg2);
}
aclError _WRAPLIB_API_CALL aclmdlGetOutputDims(const aclmdlDesc *arg0, size_t arg1, aclmdlIODims *arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const aclmdlDesc *, size_t, aclmdlIODims *);
ON_ENTRY(aclmdlGetOutputDims);
f_ptr_t f = (f_ptr_t)(g_func_table[111]);
return f(arg0, arg1, arg2);
}
aclError _WRAPLIB_API_CALL aclmdlGetCurOutputDims(const aclmdlDesc *arg0, size_t arg1, aclmdlIODims *arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const aclmdlDesc *, size_t, aclmdlIODims *);
ON_ENTRY(aclmdlGetCurOutputDims);
f_ptr_t f = (f_ptr_t)(g_func_table[112]);
return f(arg0, arg1, arg2);
}
const char _WRAPLIB_API_CALL *aclmdlGetInputNameByIndex(const aclmdlDesc *arg0, size_t arg1) {
typedef const char *(_WRAPLIB_API_CALL *f_ptr_t)(const aclmdlDesc *, size_t);
ON_ENTRY(aclmdlGetInputNameByIndex);
f_ptr_t f = (f_ptr_t)(g_func_table[113]);
return f(arg0, arg1);
}
const char _WRAPLIB_API_CALL *aclmdlGetOutputNameByIndex(const aclmdlDesc *arg0, size_t arg1) {
typedef const char *(_WRAPLIB_API_CALL *f_ptr_t)(const aclmdlDesc *, size_t);
ON_ENTRY(aclmdlGetOutputNameByIndex);
f_ptr_t f = (f_ptr_t)(g_func_table[114]);
return f(arg0, arg1);
}
aclFormat _WRAPLIB_API_CALL aclmdlGetInputFormat(const aclmdlDesc *arg0, size_t arg1) {
typedef aclFormat (_WRAPLIB_API_CALL *f_ptr_t)(const aclmdlDesc *, size_t);
ON_ENTRY(aclmdlGetInputFormat);
f_ptr_t f = (f_ptr_t)(g_func_table[115]);
return f(arg0, arg1);
}
aclFormat _WRAPLIB_API_CALL aclmdlGetOutputFormat(const aclmdlDesc *arg0, size_t arg1) {
typedef aclFormat (_WRAPLIB_API_CALL *f_ptr_t)(const aclmdlDesc *, size_t);
ON_ENTRY(aclmdlGetOutputFormat);
f_ptr_t f = (f_ptr_t)(g_func_table[116]);
return f(arg0, arg1);
}
aclDataType _WRAPLIB_API_CALL aclmdlGetInputDataType(const aclmdlDesc *arg0, size_t arg1) {
typedef aclDataType (_WRAPLIB_API_CALL *f_ptr_t)(const aclmdlDesc *, size_t);
ON_ENTRY(aclmdlGetInputDataType);
f_ptr_t f = (f_ptr_t)(g_func_table[117]);
return f(arg0, arg1);
}
aclDataType _WRAPLIB_API_CALL aclmdlGetOutputDataType(const aclmdlDesc *arg0, size_t arg1) {
typedef aclDataType (_WRAPLIB_API_CALL *f_ptr_t)(const aclmdlDesc *, size_t);
ON_ENTRY(aclmdlGetOutputDataType);
f_ptr_t f = (f_ptr_t)(g_func_table[118]);
return f(arg0, arg1);
}
aclError _WRAPLIB_API_CALL aclmdlGetInputIndexByName(const aclmdlDesc *arg0, const char *arg1, size_t *arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const aclmdlDesc *, const char *, size_t *);
ON_ENTRY(aclmdlGetInputIndexByName);
f_ptr_t f = (f_ptr_t)(g_func_table[119]);
return f(arg0, arg1, arg2);
}
aclError _WRAPLIB_API_CALL aclmdlGetOutputIndexByName(const aclmdlDesc *arg0, const char *arg1, size_t *arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const aclmdlDesc *, const char *, size_t *);
ON_ENTRY(aclmdlGetOutputIndexByName);
f_ptr_t f = (f_ptr_t)(g_func_table[120]);
return f(arg0, arg1, arg2);
}
aclError _WRAPLIB_API_CALL aclmdlGetDynamicBatch(const aclmdlDesc *arg0, aclmdlBatch *arg1) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const aclmdlDesc *, aclmdlBatch *);
ON_ENTRY(aclmdlGetDynamicBatch);
f_ptr_t f = (f_ptr_t)(g_func_table[121]);
return f(arg0, arg1);
}
aclError _WRAPLIB_API_CALL aclmdlGetDynamicHW(const aclmdlDesc *arg0, size_t arg1, aclmdlHW *arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const aclmdlDesc *, size_t, aclmdlHW *);
ON_ENTRY(aclmdlGetDynamicHW);
f_ptr_t f = (f_ptr_t)(g_func_table[122]);
return f(arg0, arg1, arg2);
}
aclmdlAIPP _WRAPLIB_API_CALL *aclmdlCreateAIPP(uint64_t arg0) {
typedef aclmdlAIPP *(_WRAPLIB_API_CALL *f_ptr_t)(uint64_t);
ON_ENTRY(aclmdlCreateAIPP);
f_ptr_t f = (f_ptr_t)(g_func_table[123]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclmdlDestroyAIPP(const aclmdlAIPP *arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const aclmdlAIPP *);
ON_ENTRY(aclmdlDestroyAIPP);
f_ptr_t f = (f_ptr_t)(g_func_table[124]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclmdlSetAIPPInputFormat(aclmdlAIPP *arg0, aclAippInputFormat arg1) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclmdlAIPP *, aclAippInputFormat);
ON_ENTRY(aclmdlSetAIPPInputFormat);
f_ptr_t f = (f_ptr_t)(g_func_table[125]);
return f(arg0, arg1);
}
aclError _WRAPLIB_API_CALL aclmdlSetAIPPCscParams(aclmdlAIPP *arg0, int8_t arg1, int16_t arg2, int16_t arg3, int16_t arg4, int16_t arg5, int16_t arg6, int16_t arg7, int16_t arg8, int16_t arg9, int16_t arg10, uint8_t arg11, uint8_t arg12, uint8_t arg13, uint8_t arg14, uint8_t arg15, uint8_t arg16) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclmdlAIPP *, int8_t, int16_t, int16_t, int16_t, int16_t, int16_t, int16_t, int16_t, int16_t, int16_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t);
ON_ENTRY(aclmdlSetAIPPCscParams);
f_ptr_t f = (f_ptr_t)(g_func_table[126]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16);
}
aclError _WRAPLIB_API_CALL aclmdlSetAIPPRbuvSwapSwitch(aclmdlAIPP *arg0, int8_t arg1) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclmdlAIPP *, int8_t);
ON_ENTRY(aclmdlSetAIPPRbuvSwapSwitch);
f_ptr_t f = (f_ptr_t)(g_func_table[127]);
return f(arg0, arg1);
}
aclError _WRAPLIB_API_CALL aclmdlSetAIPPAxSwapSwitch(aclmdlAIPP *arg0, int8_t arg1) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclmdlAIPP *, int8_t);
ON_ENTRY(aclmdlSetAIPPAxSwapSwitch);
f_ptr_t f = (f_ptr_t)(g_func_table[128]);
return f(arg0, arg1);
}
aclError _WRAPLIB_API_CALL aclmdlSetAIPPSrcImageSize(aclmdlAIPP *arg0, int32_t arg1, int32_t arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclmdlAIPP *, int32_t, int32_t);
ON_ENTRY(aclmdlSetAIPPSrcImageSize);
f_ptr_t f = (f_ptr_t)(g_func_table[129]);
return f(arg0, arg1, arg2);
}
aclError _WRAPLIB_API_CALL aclmdlSetAIPPScfParams(aclmdlAIPP *arg0, int8_t arg1, int32_t arg2, int32_t arg3, int32_t arg4, int32_t arg5, uint64_t arg6) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclmdlAIPP *, int8_t, int32_t, int32_t, int32_t, int32_t, uint64_t);
ON_ENTRY(aclmdlSetAIPPScfParams);
f_ptr_t f = (f_ptr_t)(g_func_table[130]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
}
aclError _WRAPLIB_API_CALL aclmdlSetAIPPCropParams(aclmdlAIPP *arg0, int8_t arg1, int32_t arg2, int32_t arg3, int32_t arg4, int32_t arg5, uint64_t arg6) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclmdlAIPP *, int8_t, int32_t, int32_t, int32_t, int32_t, uint64_t);
ON_ENTRY(aclmdlSetAIPPCropParams);
f_ptr_t f = (f_ptr_t)(g_func_table[131]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
}
aclError _WRAPLIB_API_CALL aclmdlSetAIPPPaddingParams(aclmdlAIPP *arg0, int8_t arg1, int32_t arg2, int32_t arg3, int32_t arg4, int32_t arg5, uint64_t arg6) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclmdlAIPP *, int8_t, int32_t, int32_t, int32_t, int32_t, uint64_t);
ON_ENTRY(aclmdlSetAIPPPaddingParams);
f_ptr_t f = (f_ptr_t)(g_func_table[132]);
return f(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
}
aclError _WRAPLIB_API_CALL aclmdlSetAIPPDtcPixelMean(aclmdlAIPP *arg0, int16_t arg1, int16_t arg2, int16_t arg3, int16_t arg4, uint64_t arg5) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclmdlAIPP *, int16_t, int16_t, int16_t, int16_t, uint64_t);
ON_ENTRY(aclmdlSetAIPPDtcPixelMean);
f_ptr_t f = (f_ptr_t)(g_func_table[133]);
return f(arg0, arg1, arg2, arg3, arg4, arg5);
}
aclError _WRAPLIB_API_CALL aclmdlSetAIPPDtcPixelMin(aclmdlAIPP *arg0, float arg1, float arg2, float arg3, float arg4, uint64_t arg5) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclmdlAIPP *, float, float, float, float, uint64_t);
ON_ENTRY(aclmdlSetAIPPDtcPixelMin);
f_ptr_t f = (f_ptr_t)(g_func_table[134]);
return f(arg0, arg1, arg2, arg3, arg4, arg5);
}
aclError _WRAPLIB_API_CALL aclmdlSetAIPPPixelVarReci(aclmdlAIPP *arg0, float arg1, float arg2, float arg3, float arg4, uint64_t arg5) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(aclmdlAIPP *, float, float, float, float, uint64_t);
ON_ENTRY(aclmdlSetAIPPPixelVarReci);
f_ptr_t f = (f_ptr_t)(g_func_table[135]);
return f(arg0, arg1, arg2, arg3, arg4, arg5);
}
aclError _WRAPLIB_API_CALL aclmdlSetInputAIPP(uint32_t arg0, aclmdlDataset *arg1, size_t arg2, const aclmdlAIPP *arg3) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(uint32_t, aclmdlDataset *, size_t, const aclmdlAIPP *);
ON_ENTRY(aclmdlSetInputAIPP);
f_ptr_t f = (f_ptr_t)(g_func_table[136]);
return f(arg0, arg1, arg2, arg3);
}
aclError _WRAPLIB_API_CALL aclmdlGetFirstAippInfo(uint32_t arg0, size_t arg1, aclAippInfo *arg2) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(uint32_t, size_t, aclAippInfo *);
ON_ENTRY(aclmdlGetFirstAippInfo);
f_ptr_t f = (f_ptr_t)(g_func_table[137]);
return f(arg0, arg1, arg2);
}
aclError _WRAPLIB_API_CALL aclInit(const char *arg0) {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)(const char *);
ON_ENTRY(aclInit);
f_ptr_t f = (f_ptr_t)(g_func_table[138]);
return f(arg0);
}
aclError _WRAPLIB_API_CALL aclFinalize() {
typedef aclError (_WRAPLIB_API_CALL *f_ptr_t)();
ON_ENTRY(aclFinalize);
f_ptr_t f = (f_ptr_t)(g_func_table[139]);
return f();
}
......@@ -57,6 +57,7 @@ do
export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DPYTHON_EXECUTABLE=${PYTHON_DIR}/bin/python3"
export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DPYTHON_LIBRARY=${PYTHON_DIR}lib/"
export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DPYTHON_INCLUDE_DIR=${PYTHON_DIR}include/python${MAJOR}.${MINOR}"
export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DMGE_WITH_ATLAS=ON"
if [ ${BUILD_WHL_CPU_ONLY} = "OFF" ]; then
${SRC_DIR}/scripts/cmake-build/host_build.sh -c -t -r
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册