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

feat(mge): aad atlas710 support

GitOrigin-RevId: 6458c5c23cb65a332782f6445eb5da9656f0092f
上级 df5ebd3d
......@@ -19,6 +19,11 @@
extern "C" {
#endif
// Current version is 1.1.0
#define ACL_MAJOR_VERSION 1
#define ACL_MINOR_VERSION 1
#define ACL_PATCH_VERSION 0
/**
* @ingroup AscendCL
* @brief acl initialize
......@@ -26,7 +31,7 @@ extern "C" {
* @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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclInit(const char *configPath);
......@@ -38,11 +43,32 @@ ACL_FUNC_VISIBILITY aclError aclInit(const char *configPath);
* @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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclFinalize();
/**
* @ingroup AscendCL
* @brief query ACL interface version
*
* @param majorVersion[OUT] ACL interface major version
* @param minorVersion[OUT] ACL interface minor version
* @param patchVersion[OUT] ACL interface patch version
* @retval ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclrtGetVersion(int32_t *majorVersion, int32_t *minorVersion, int32_t *patchVersion);
/**
* @ingroup AscendCL
* @brief get recent error message
*
* @retval null for failed
* @retval OtherValues success
*/
ACL_FUNC_VISIBILITY const char *aclGetRecentErrMsg();
#ifdef __cplusplus
}
#endif
......
......@@ -23,7 +23,7 @@ typedef struct aclopKernelDesc aclopKernelDesc;
typedef void (*aclDataDeallocator)(void *data, size_t length);
const int ACL_COMPILE_FLAG_BIN_SELECTOR = 1;
static const int ACL_COMPILE_FLAG_BIN_SELECTOR = 1;
typedef enum aclEngineType {
ACL_ENGINE_SYS,
......@@ -38,7 +38,8 @@ typedef enum aclEngineType {
* @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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetModelDir(const char *modelDir);
......@@ -51,7 +52,8 @@ ACL_FUNC_VISIBILITY aclError aclopSetModelDir(const char *modelDir);
* 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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopLoad(const void *model, size_t modelSize);
......@@ -77,11 +79,12 @@ 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 attr [OUT] 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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetAttrBool(aclopAttr *attr, const char *attrName, uint8_t attrValue);
......@@ -90,10 +93,11 @@ ACL_FUNC_VISIBILITY aclError aclopSetAttrBool(aclopAttr *attr, const char *attrN
* @ingroup AscendCL
* @brief set an attribute. the type of the attribute is int64_t
*
* @param attr [IN] pointer to the instance of aclopAttr
* @param attr [OUT] 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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetAttrInt(aclopAttr *attr, const char *attrName, int64_t attrValue);
......@@ -102,10 +106,11 @@ ACL_FUNC_VISIBILITY aclError aclopSetAttrInt(aclopAttr *attr, const char *attrNa
* @ingroup AscendCL
* @brief set an attribute. the type of the attribute is float
*
* @param attr [IN] pointer to the instance of aclopAttr
* @param attr [OUT] 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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetAttrFloat(aclopAttr *attr, const char *attrName, float attrValue);
......@@ -114,23 +119,53 @@ ACL_FUNC_VISIBILITY aclError aclopSetAttrFloat(aclopAttr *attr, const char *attr
* @ingroup AscendCL
* @brief set an attribute. the type of the attribute is string
*
* @param attr [IN] pointer to the instance of aclopAttr
* @param attr [OUT] 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 ACL_SUCCESS 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 aclDataType
*
* @param attr [OUT] pointer to the instance of aclopAttr
* @param attrName [IN] attribute name
* @param attrValue [IN] attribute value
*
* @retval ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetAttrDataType(aclopAttr *attr, const char *attrName, aclDataType attrValue);
/**
* @ingroup AscendCL
* @brief set an attribute. the type of the attribute is list of aclDataType
*
* @param attr [OUT] 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_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetAttrListDataType(aclopAttr *attr, const char *attrName, int numValues,
const aclDataType values[]);
/**
* @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 attr [OUT] 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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetAttrListBool(aclopAttr *attr, const char *attrName, int numValues,
......@@ -140,11 +175,12 @@ ACL_FUNC_VISIBILITY aclError aclopSetAttrListBool(aclopAttr *attr, const char *a
* @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 attr [OUT] 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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetAttrListInt(aclopAttr *attr, const char *attrName, int numValues,
......@@ -154,11 +190,12 @@ ACL_FUNC_VISIBILITY aclError aclopSetAttrListInt(aclopAttr *attr, const char *at
* @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 attr [OUT] 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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetAttrListFloat(aclopAttr *attr, const char *attrName, int numValues,
......@@ -168,11 +205,12 @@ ACL_FUNC_VISIBILITY aclError aclopSetAttrListFloat(aclopAttr *attr, const char *
* @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 attr [OUT] 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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetAttrListString(aclopAttr *attr, const char *attrName, int numValues,
......@@ -182,12 +220,13 @@ ACL_FUNC_VISIBILITY aclError aclopSetAttrListString(aclopAttr *attr, const char
* @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 attr [OUT] 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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetAttrListListInt(aclopAttr *attr,
......@@ -208,6 +247,7 @@ ACL_FUNC_VISIBILITY aclError aclopSetAttrListListInt(aclopAttr *attr,
* 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
......@@ -218,9 +258,11 @@ ACL_FUNC_VISIBILITY aclError aclopSetAttrListListInt(aclopAttr *attr,
* @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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
// ACL_DEPRECATED_MESSAGE("aclopExecute is deprecated, use aclopExecuteV2 instead")
ACL_FUNC_VISIBILITY aclError aclopExecute(const char *opType,
int numInputs,
const aclTensorDesc *const inputDesc[],
......@@ -231,6 +273,44 @@ ACL_FUNC_VISIBILITY aclError aclopExecute(const char *opType,
const aclopAttr *attr,
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief Load and execute the specified operator
* The difference with aclopExecute is that aclopExecuteV2 will refresh outputDesc
*
* @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 aclopExecuteV2,
* 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|OUT] 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_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopExecuteV2(const char *opType,
int numInputs,
aclTensorDesc *inputDesc[],
aclDataBuffer *inputs[],
int numOutputs,
aclTensorDesc *outputDesc[],
aclDataBuffer *outputs[],
aclopAttr *attr,
aclrtStream stream);
/**
* @ingroup AscendCL
* @brief create a instance of aclopHandle.
......@@ -243,7 +323,8 @@ ACL_FUNC_VISIBILITY aclError aclopExecute(const char *opType,
* @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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopCreateHandle(const char *opType,
......@@ -275,9 +356,10 @@ ACL_FUNC_VISIBILITY void aclopDestroyHandle(aclopHandle *handle);
* 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 outputs [OUT] pointer to array of output buffers
* @param stream [IN] stream
* @retval ACL_ERROR_NONE The function is successfully executed.
*
* @retval ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclopCreateHandle | aclCreateDataBuffer
......@@ -299,7 +381,8 @@ ACL_FUNC_VISIBILITY aclError aclopExecWithHandle(aclopHandle *handle,
* @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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopCast(const aclTensorDesc *srcDesc,
......@@ -316,8 +399,9 @@ ACL_FUNC_VISIBILITY aclError aclopCast(const aclTensorDesc *srcDesc,
* @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.
* @param handle [OUT] pointer to the pointer to the handle
*
* @retval ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopCreateHandleForCast(aclTensorDesc *srcDesc,
......@@ -338,7 +422,8 @@ ACL_FUNC_VISIBILITY aclError aclopCreateHandleForCast(aclTensorDesc *srcDesc,
* @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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclopCompile
......@@ -362,7 +447,8 @@ ACL_FUNC_VISIBILITY aclError aclopCreateKernel(const char *opType,
* @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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
typedef aclError (*aclopCompileFunc)(int numInputs,
......@@ -378,7 +464,8 @@ typedef aclError (*aclopCompileFunc)(int numInputs,
*
* @param opType [IN] op type
* @param func [IN] compile function
* @retval ACL_ERROR_NONE The function is successfully executed.
*
* @retval ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*
* @see aclopUnregisterCompileFunc
......@@ -390,7 +477,8 @@ ACL_FUNC_VISIBILITY aclError aclopRegisterCompileFunc(const char *opType, aclopC
* @brief unregister compile function
*
* @param opType [IN] op type
* @retval ACL_ERROR_NONE The function is successfully executed.
*
* @retval ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopUnregisterCompileFunc(const char *opType);
......@@ -404,7 +492,8 @@ ACL_FUNC_VISIBILITY aclError aclopUnregisterCompileFunc(const char *opType);
* @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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetKernelArgs(aclopKernelDesc *kernelDesc,
......@@ -420,7 +509,8 @@ ACL_FUNC_VISIBILITY aclError aclopSetKernelArgs(aclopKernelDesc *kernelDesc,
* @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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopSetKernelWorkspaceSizes(aclopKernelDesc *kernelDesc, int numWorkspaces,
......@@ -437,7 +527,8 @@ ACL_FUNC_VISIBILITY aclError aclopSetKernelWorkspaceSizes(aclopKernelDesc *kerne
* @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 ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopUpdateParams(const char *opType,
......@@ -447,6 +538,31 @@ ACL_FUNC_VISIBILITY aclError aclopUpdateParams(const char *opType,
const aclTensorDesc *const outputDesc[],
const aclopAttr *attr);
/**
* @ingroup AscendCL
* @brief inferShape the specified operator synchronously
*
* @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 [OUT] 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_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
ACL_FUNC_VISIBILITY aclError aclopInferShape(const char *opType,
int numInputs,
aclTensorDesc *inputDesc[],
aclDataBuffer *inputs[],
int numOutputs,
aclTensorDesc *outputDesc[],
aclopAttr *attr);
#ifdef __cplusplus
}
#endif
......
此差异已折叠。
/**
* Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef INC_EXTERNAL_GE_GE_ERROR_CODES_H_
#define INC_EXTERNAL_GE_GE_ERROR_CODES_H_
#if defined(_MSC_VER)
#ifdef FUNC_VISIBILITY
#define GE_FUNC_VISIBILITY _declspec(dllexport)
#else
#define GE_FUNC_VISIBILITY
#endif
#else
#ifdef FUNC_VISIBILITY
#define GE_FUNC_VISIBILITY __attribute__((visibility("default")))
#else
#define GE_FUNC_VISIBILITY
#endif
#endif
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
static const uint32_t ACL_ERROR_GE_PARAM_INVALID = 145000U;
static const uint32_t ACL_ERROR_GE_EXEC_NOT_INIT = 145001U;
static const uint32_t ACL_ERROR_GE_EXEC_MODEL_PATH_INVALID = 145002U;
static const uint32_t ACL_ERROR_GE_EXEC_MODEL_ID_INVALID = 145003U;
static const uint32_t ACL_ERROR_GE_EXEC_MODEL_DATA_SIZE_INVALID = 145006U;
static const uint32_t ACL_ERROR_GE_EXEC_MODEL_ADDR_INVALID = 145007U;
static const uint32_t ACL_ERROR_GE_EXEC_MODEL_QUEUE_ID_INVALID = 145008U;
static const uint32_t ACL_ERROR_GE_EXEC_LOAD_MODEL_REPEATED = 145009U;
static const uint32_t ACL_ERROR_GE_DYNAMIC_INPUT_ADDR_INVALID = 145011U;
static const uint32_t ACL_ERROR_GE_DYNAMIC_INPUT_LENGTH_INVALID = 145012U;
static const uint32_t ACL_ERROR_GE_DYNAMIC_BATCH_SIZE_INVALID = 145013U;
static const uint32_t ACL_ERROR_GE_AIPP_BATCH_EMPTY = 145014U;
static const uint32_t ACL_ERROR_GE_AIPP_NOT_EXIST = 145015U;
static const uint32_t ACL_ERROR_GE_AIPP_MODE_INVALID = 145016U;
static const uint32_t ACL_ERROR_GE_OP_TASK_TYPE_INVALID = 145017U;
static const uint32_t ACL_ERROR_GE_OP_KERNEL_TYPE_INVALID = 145018U;
static const uint32_t ACL_ERROR_GE_PLGMGR_PATH_INVALID = 145019U;
static const uint32_t ACL_ERROR_GE_FORMAT_INVALID = 145020U;
static const uint32_t ACL_ERROR_GE_SHAPE_INVALID = 145021U;
static const uint32_t ACL_ERROR_GE_DATATYPE_INVALID = 145022U;
static const uint32_t ACL_ERROR_GE_MEMORY_ALLOCATION = 245000U;
static const uint32_t ACL_ERROR_GE_MEMORY_OPERATE_FAILED = 245001U;
static const uint32_t ACL_ERROR_GE_INTERNAL_ERROR = 545000U;
static const uint32_t ACL_ERROR_GE_LOAD_MODEL = 545001U;
static const uint32_t ACL_ERROR_GE_EXEC_LOAD_MODEL_PARTITION_FAILED = 545002U;
static const uint32_t ACL_ERROR_GE_EXEC_LOAD_WEIGHT_PARTITION_FAILED = 545003U;
static const uint32_t ACL_ERROR_GE_EXEC_LOAD_TASK_PARTITION_FAILED = 545004U;
static const uint32_t ACL_ERROR_GE_EXEC_LOAD_KERNEL_PARTITION_FAILED = 545005U;
static const uint32_t ACL_ERROR_GE_EXEC_RELEASE_MODEL_DATA = 545006U;
static const uint32_t ACL_ERROR_GE_COMMAND_HANDLE = 545007U;
static const uint32_t ACL_ERROR_GE_GET_TENSOR_INFO = 545008U;
static const uint32_t ACL_ERROR_GE_UNLOAD_MODEL = 545009U;
#ifdef __cplusplus
} // namespace ge
#endif
#endif // INC_EXTERNAL_GE_GE_ERROR_CODES_H_
/**
* @file rt_error_codes.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_EXTERNEL_RT_ERROR_CODES_H__
#define __INC_EXTERNEL_RT_ERROR_CODES_H__
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
static const int32_t ACL_RT_SUCCESS = 0; // success
static const int32_t ACL_ERROR_RT_PARAM_INVALID = 107000; // param invalid
static const int32_t ACL_ERROR_RT_INVALID_DEVICEID = 107001; // invalid device id
static const int32_t ACL_ERROR_RT_CONTEXT_NULL = 107002; // current context null
static const int32_t ACL_ERROR_RT_STREAM_CONTEXT = 107003; // stream not in current context
static const int32_t ACL_ERROR_RT_MODEL_CONTEXT = 107004; // model not in current context
static const int32_t ACL_ERROR_RT_STREAM_MODEL = 107005; // stream not in model
static const int32_t ACL_ERROR_RT_EVENT_TIMESTAMP_INVALID = 107006; // event timestamp invalid
static const int32_t ACL_ERROR_RT_EVENT_TIMESTAMP_REVERSAL = 107007; // event timestamp reversal
static const int32_t ACL_ERROR_RT_ADDR_UNALIGNED = 107008; // memory address unaligned
static const int32_t ACL_ERROR_RT_FILE_OPEN = 107009; // open file failed
static const int32_t ACL_ERROR_RT_FILE_WRITE = 107010; // write file failed
static const int32_t ACL_ERROR_RT_STREAM_SUBSCRIBE = 107011; // error subscribe stream
static const int32_t ACL_ERROR_RT_THREAD_SUBSCRIBE = 107012; // error subscribe thread
static const int32_t ACL_ERROR_RT_GROUP_NOT_SET = 107013; // group not set
static const int32_t ACL_ERROR_RT_GROUP_NOT_CREATE = 107014; // group not create
static const int32_t ACL_ERROR_RT_STREAM_NO_CB_REG = 107015; // callback not register to stream
static const int32_t ACL_ERROR_RT_INVALID_MEMORY_TYPE = 107016; // invalid memory type
static const int32_t ACL_ERROR_RT_INVALID_HANDLE = 107017; // invalid handle
static const int32_t ACL_ERROR_RT_INVALID_MALLOC_TYPE = 107018; // invalid malloc type
static const int32_t ACL_ERROR_RT_WAIT_TIMEOUT = 107019; // wait timeout
static const int32_t ACL_ERROR_RT_TASK_TIMEOUT = 107020; // task timeout
static const int32_t ACL_ERROR_RT_FEATURE_NOT_SUPPORT = 207000; // feature not support
static const int32_t ACL_ERROR_RT_MEMORY_ALLOCATION = 207001; // memory allocation error
static const int32_t ACL_ERROR_RT_MEMORY_FREE = 207002; // memory free error
static const int32_t ACL_ERROR_RT_AICORE_OVER_FLOW = 207003; // aicore over flow
static const int32_t ACL_ERROR_RT_NO_DEVICE = 207004; // no device
static const int32_t ACL_ERROR_RT_RESOURCE_ALLOC_FAIL = 207005; // resource alloc fail
static const int32_t ACL_ERROR_RT_NO_PERMISSION = 207006; // no permission
static const int32_t ACL_ERROR_RT_NO_EVENT_RESOURCE = 207007; // no event resource
static const int32_t ACL_ERROR_RT_NO_STREAM_RESOURCE = 207008; // no stream resource
static const int32_t ACL_ERROR_RT_NO_NOTIFY_RESOURCE = 207009; // no notify resource
static const int32_t ACL_ERROR_RT_NO_MODEL_RESOURCE = 207010; // no model resource
static const int32_t ACL_ERROR_RT_NO_CDQ_RESOURCE = 207011; // no cdq resource
static const int32_t ACL_ERROR_RT_OVER_LIMIT = 207012; // over limit
static const int32_t ACL_ERROR_RT_QUEUE_EMPTY = 207013; // queue is empty
static const int32_t ACL_ERROR_RT_QUEUE_FULL = 207014; // queue is full
static const int32_t ACL_ERROR_RT_REPEATED_INIT = 207015; // repeated init
static const int32_t ACL_ERROR_RT_AIVEC_OVER_FLOW = 207016; // aivec over flow
static const int32_t ACL_ERROR_RT_INTERNAL_ERROR = 507000; // runtime internal error
static const int32_t ACL_ERROR_RT_TS_ERROR = 507001; // ts internel error
static const int32_t ACL_ERROR_RT_STREAM_TASK_FULL = 507002; // task full in stream
static const int32_t ACL_ERROR_RT_STREAM_TASK_EMPTY = 507003; // task empty in stream
static const int32_t ACL_ERROR_RT_STREAM_NOT_COMPLETE = 507004; // stream not complete
static const int32_t ACL_ERROR_RT_END_OF_SEQUENCE = 507005; // end of sequence
static const int32_t ACL_ERROR_RT_EVENT_NOT_COMPLETE = 507006; // event not complete
static const int32_t ACL_ERROR_RT_CONTEXT_RELEASE_ERROR = 507007; // context release error
static const int32_t ACL_ERROR_RT_SOC_VERSION = 507008; // soc version error
static const int32_t ACL_ERROR_RT_TASK_TYPE_NOT_SUPPORT = 507009; // task type not support
static const int32_t ACL_ERROR_RT_LOST_HEARTBEAT = 507010; // ts lost heartbeat
static const int32_t ACL_ERROR_RT_MODEL_EXECUTE = 507011; // model execute failed
static const int32_t ACL_ERROR_RT_REPORT_TIMEOUT = 507012; // report timeout
static const int32_t ACL_ERROR_RT_SYS_DMA = 507013; // sys dma error
static const int32_t ACL_ERROR_RT_AICORE_TIMEOUT = 507014; // aicore timeout
static const int32_t ACL_ERROR_RT_AICORE_EXCEPTION = 507015; // aicore exception
static const int32_t ACL_ERROR_RT_AICORE_TRAP_EXCEPTION = 507016; // aicore trap exception
static const int32_t ACL_ERROR_RT_AICPU_TIMEOUT = 507017; // aicpu timeout
static const int32_t ACL_ERROR_RT_AICPU_EXCEPTION = 507018; // aicpu exception
static const int32_t ACL_ERROR_RT_AICPU_DATADUMP_RSP_ERR = 507019; // aicpu datadump response error
static const int32_t ACL_ERROR_RT_AICPU_MODEL_RSP_ERR = 507020; // aicpu model operate response error
static const int32_t ACL_ERROR_RT_PROFILING_ERROR = 507021; // profiling error
static const int32_t ACL_ERROR_RT_IPC_ERROR = 507022; // ipc error
static const int32_t ACL_ERROR_RT_MODEL_ABORT_NORMAL = 507023; // model abort normal
static const int32_t ACL_ERROR_RT_KERNEL_UNREGISTERING = 507024; // kernel unregistering
static const int32_t ACL_ERROR_RT_RINGBUFFER_NOT_INIT = 507025; // ringbuffer not init
static const int32_t ACL_ERROR_RT_RINGBUFFER_NO_DATA = 507026; // ringbuffer no data
static const int32_t ACL_ERROR_RT_KERNEL_LOOKUP = 507027; // kernel lookup error
static const int32_t ACL_ERROR_RT_KERNEL_DUPLICATE = 507028; // kernel register duplicate
static const int32_t ACL_ERROR_RT_DEBUG_REGISTER_FAIL = 507029; // debug register failed
static const int32_t ACL_ERROR_RT_DEBUG_UNREGISTER_FAIL = 507030; // debug unregister failed
static const int32_t ACL_ERROR_RT_LABEL_CONTEXT = 507031; // label not in current context
static const int32_t ACL_ERROR_RT_PROGRAM_USE_OUT = 507032; // program register num use out
static const int32_t ACL_ERROR_RT_DEV_SETUP_ERROR = 507033; // device setup error
static const int32_t ACL_ERROR_RT_VECTOR_CORE_TIMEOUT = 507034; // vector core timeout
static const int32_t ACL_ERROR_RT_VECTOR_CORE_EXCEPTION = 507035; // vector core exception
static const int32_t ACL_ERROR_RT_VECTOR_CORE_TRAP_EXCEPTION = 507036; // vector core trap exception
static const int32_t ACL_ERROR_RT_CDQ_BATCH_ABNORMAL = 507037; // cdq alloc batch abnormal
static const int32_t ACL_ERROR_RT_DIE_MODE_CHANGE_ERROR = 507038; // can not change die mode
static const int32_t ACL_ERROR_RT_DIE_SET_ERROR = 507039; // single die mode can not set die
static const int32_t ACL_ERROR_RT_INVALID_DIEID = 507040; // invalid die id
static const int32_t ACL_ERROR_RT_DIE_MODE_NOT_SET = 507041; // die mode not set
static const int32_t ACL_ERROR_RT_DRV_INTERNAL_ERROR = 507899; // drv internal error
static const int32_t ACL_ERROR_RT_AICPU_INTERNAL_ERROR = 507900; // aicpu internal error
static const int32_t ACL_ERROR_RT_SOCKET_CLOSE = 507901; // hdc disconnect
#ifdef __cplusplus
}
#endif
#endif // __INC_EXTERNEL_RT_ERROR_CODES_H__
......@@ -118,9 +118,25 @@ aclmdlAIPP* on_init_failed(int func_idx) {
log_failed_load(func_idx);
return nullptr;
}
template <>
aclmdlConfigHandle* on_init_failed(int func_idx) {
log_failed_load(func_idx);
return nullptr;
}
template <>
tagRtGroupInfo* on_init_failed(int func_idx) {
log_failed_load(func_idx);
return nullptr;
}
} // namespace
//! atlas310
#if !defined(ACL_MAJOR_VERSION)
#include "./libatlas-wrap.h"
//! atlas710
#elif (ACL_MAJOR_VERSION == 1 && ACL_MINOR_VERSION == 1 && ACL_PATCH_VERSION == 0)
#include "./libatlas-wrap_1.1.0.h"
#endif
static const char* default_so_paths[] = {
"/usr/local/Ascend/acllib/lib64/libascendcl.so",
......@@ -153,8 +169,5 @@ static void* resolve_library_func(void* handle, const char* func) {
return nullptr;
}
auto ret = dlsym(handle, func);
if (!ret) {
LOGE("failed to load atlas func: %s", func);
}
return ret;
}
此差异已折叠。
......@@ -53,7 +53,6 @@ const char* megcore::atlas::get_error_str(aclError error) {
switch (error) {
ERROR(ACL_ERROR_NONE);
ERROR(ACL_ERROR_INVALID_PARAM);
ERROR(ACL_ERROR_UNINITIALIZE);
ERROR(ACL_ERROR_REPEAT_INITIALIZE);
......@@ -93,7 +92,19 @@ const char* megcore::atlas::get_error_str(aclError error) {
ERROR(ACL_ERROR_WAIT_CALLBACK_TIMEOUT);
ERROR(ACL_ERROR_REPEAT_FINALIZE);
ERROR(ACL_ERROR_NOT_STATIC_AIPP);
ERROR(ACL_ERROR_COMPILING_STUB_MODE);
ERROR(ACL_ERROR_GROUP_NOT_SET);
ERROR(ACL_ERROR_GROUP_NOT_CREATE);
ERROR(ACL_ERROR_PROF_ALREADY_RUN);
ERROR(ACL_ERROR_PROF_NOT_RUN);
ERROR(ACL_ERROR_DUMP_ALREADY_RUN);
ERROR(ACL_ERROR_DUMP_NOT_RUN);
ERROR(ACL_ERROR_PROF_REPEAT_SUBSCRIBE);
ERROR(ACL_ERROR_PROF_API_CONFLICT);
ERROR(ACL_ERROR_INVALID_MAX_OPQUEUE_NUM_CONFIG);
ERROR(ACL_ERROR_INVALID_OPP_PATH);
ERROR(ACL_ERROR_OP_UNSUPPORTED_DYNAMIC);
ERROR(ACL_ERROR_RELATIVE_RESOURCE_NOT_CLEARED);
ERROR(ACL_ERROR_BAD_ALLOC);
ERROR(ACL_ERROR_API_NOT_SUPPORT);
ERROR(ACL_ERROR_INVALID_DEVICE);
......@@ -101,9 +112,8 @@ const char* megcore::atlas::get_error_str(aclError error) {
ERROR(ACL_ERROR_RESOURCE_NOT_MATCH);
ERROR(ACL_ERROR_INVALID_RESOURCE_HANDLE);
ERROR(ACL_ERROR_FEATURE_UNSUPPORTED);
ERROR(ACL_ERROR_PROF_MODULES_UNSUPPORTED);
ERROR(ACL_ERROR_STORAGE_OVER_LIMIT);
ERROR(ACL_ERROR_INTERNAL_ERROR);
ERROR(ACL_ERROR_FAILURE);
ERROR(ACL_ERROR_GE_FAILURE);
......@@ -111,6 +121,123 @@ const char* megcore::atlas::get_error_str(aclError error) {
ERROR(ACL_ERROR_DRV_FAILURE);
ERROR(ACL_ERROR_PROFILING_FAILURE);
ERROR(ACL_ERROR_GE_PARAM_INVALID);
ERROR(ACL_ERROR_GE_EXEC_NOT_INIT);
ERROR(ACL_ERROR_GE_EXEC_MODEL_PATH_INVALID);
ERROR(ACL_ERROR_GE_EXEC_MODEL_ID_INVALID);
ERROR(ACL_ERROR_GE_EXEC_MODEL_DATA_SIZE_INVALID);
ERROR(ACL_ERROR_GE_EXEC_MODEL_ADDR_INVALID);
ERROR(ACL_ERROR_GE_EXEC_MODEL_QUEUE_ID_INVALID);
ERROR(ACL_ERROR_GE_EXEC_LOAD_MODEL_REPEATED);
ERROR(ACL_ERROR_GE_DYNAMIC_INPUT_ADDR_INVALID);
ERROR(ACL_ERROR_GE_DYNAMIC_INPUT_LENGTH_INVALID);
ERROR(ACL_ERROR_GE_DYNAMIC_BATCH_SIZE_INVALID);
ERROR(ACL_ERROR_GE_AIPP_BATCH_EMPTY);
ERROR(ACL_ERROR_GE_AIPP_NOT_EXIST);
ERROR(ACL_ERROR_GE_AIPP_MODE_INVALID);
ERROR(ACL_ERROR_GE_OP_TASK_TYPE_INVALID);
ERROR(ACL_ERROR_GE_OP_KERNEL_TYPE_INVALID);
ERROR(ACL_ERROR_GE_PLGMGR_PATH_INVALID);
ERROR(ACL_ERROR_GE_FORMAT_INVALID);
ERROR(ACL_ERROR_GE_SHAPE_INVALID);
ERROR(ACL_ERROR_GE_DATATYPE_INVALID);
ERROR(ACL_ERROR_GE_MEMORY_ALLOCATION);
ERROR(ACL_ERROR_GE_MEMORY_OPERATE_FAILED);
ERROR(ACL_ERROR_GE_INTERNAL_ERROR);
ERROR(ACL_ERROR_GE_LOAD_MODEL);
ERROR(ACL_ERROR_GE_EXEC_LOAD_MODEL_PARTITION_FAILED);
ERROR(ACL_ERROR_GE_EXEC_LOAD_WEIGHT_PARTITION_FAILED);
ERROR(ACL_ERROR_GE_EXEC_LOAD_TASK_PARTITION_FAILED);
ERROR(ACL_ERROR_GE_EXEC_LOAD_KERNEL_PARTITION_FAILED);
ERROR(ACL_ERROR_GE_EXEC_RELEASE_MODEL_DATA);
ERROR(ACL_ERROR_GE_COMMAND_HANDLE);
ERROR(ACL_ERROR_GE_GET_TENSOR_INFO);
ERROR(ACL_ERROR_GE_UNLOAD_MODEL);
ERROR(ACL_ERROR_RT_PARAM_INVALID);
ERROR(ACL_ERROR_RT_INVALID_DEVICEID);
ERROR(ACL_ERROR_RT_CONTEXT_NULL);
ERROR(ACL_ERROR_RT_STREAM_CONTEXT);
ERROR(ACL_ERROR_RT_MODEL_CONTEXT);
ERROR(ACL_ERROR_RT_STREAM_MODEL);
ERROR(ACL_ERROR_RT_EVENT_TIMESTAMP_INVALID);
ERROR(ACL_ERROR_RT_EVENT_TIMESTAMP_REVERSAL);
ERROR(ACL_ERROR_RT_ADDR_UNALIGNED);
ERROR(ACL_ERROR_RT_FILE_OPEN);
ERROR(ACL_ERROR_RT_FILE_WRITE);
ERROR(ACL_ERROR_RT_STREAM_SUBSCRIBE);
ERROR(ACL_ERROR_RT_THREAD_SUBSCRIBE);
ERROR(ACL_ERROR_RT_GROUP_NOT_SET);
ERROR(ACL_ERROR_RT_GROUP_NOT_CREATE);
ERROR(ACL_ERROR_RT_STREAM_NO_CB_REG);
ERROR(ACL_ERROR_RT_INVALID_MEMORY_TYPE);
ERROR(ACL_ERROR_RT_INVALID_HANDLE);
ERROR(ACL_ERROR_RT_INVALID_MALLOC_TYPE);
ERROR(ACL_ERROR_RT_WAIT_TIMEOUT);
ERROR(ACL_ERROR_RT_TASK_TIMEOUT);
ERROR(ACL_ERROR_RT_FEATURE_NOT_SUPPORT);
ERROR(ACL_ERROR_RT_MEMORY_ALLOCATION);
ERROR(ACL_ERROR_RT_MEMORY_FREE);
ERROR(ACL_ERROR_RT_AICORE_OVER_FLOW);
ERROR(ACL_ERROR_RT_NO_DEVICE);
ERROR(ACL_ERROR_RT_RESOURCE_ALLOC_FAIL);
ERROR(ACL_ERROR_RT_NO_PERMISSION);
ERROR(ACL_ERROR_RT_NO_EVENT_RESOURCE);
ERROR(ACL_ERROR_RT_NO_STREAM_RESOURCE);
ERROR(ACL_ERROR_RT_NO_NOTIFY_RESOURCE);
ERROR(ACL_ERROR_RT_NO_MODEL_RESOURCE);
ERROR(ACL_ERROR_RT_NO_CDQ_RESOURCE);
ERROR(ACL_ERROR_RT_OVER_LIMIT);
ERROR(ACL_ERROR_RT_QUEUE_EMPTY);
ERROR(ACL_ERROR_RT_QUEUE_FULL);
ERROR(ACL_ERROR_RT_REPEATED_INIT);
ERROR(ACL_ERROR_RT_AIVEC_OVER_FLOW);
ERROR(ACL_ERROR_RT_INTERNAL_ERROR);
ERROR(ACL_ERROR_RT_TS_ERROR);
ERROR(ACL_ERROR_RT_STREAM_TASK_FULL);
ERROR(ACL_ERROR_RT_STREAM_TASK_EMPTY);
ERROR(ACL_ERROR_RT_STREAM_NOT_COMPLETE);
ERROR(ACL_ERROR_RT_END_OF_SEQUENCE);
ERROR(ACL_ERROR_RT_EVENT_NOT_COMPLETE);
ERROR(ACL_ERROR_RT_CONTEXT_RELEASE_ERROR);
ERROR(ACL_ERROR_RT_SOC_VERSION);
ERROR(ACL_ERROR_RT_TASK_TYPE_NOT_SUPPORT);
ERROR(ACL_ERROR_RT_LOST_HEARTBEAT);
ERROR(ACL_ERROR_RT_MODEL_EXECUTE);
ERROR(ACL_ERROR_RT_REPORT_TIMEOUT);
ERROR(ACL_ERROR_RT_SYS_DMA);
ERROR(ACL_ERROR_RT_AICORE_TIMEOUT);
ERROR(ACL_ERROR_RT_AICORE_EXCEPTION);
ERROR(ACL_ERROR_RT_AICORE_TRAP_EXCEPTION);
ERROR(ACL_ERROR_RT_AICPU_TIMEOUT);
ERROR(ACL_ERROR_RT_AICPU_EXCEPTION);
ERROR(ACL_ERROR_RT_AICPU_DATADUMP_RSP_ERR);
ERROR(ACL_ERROR_RT_AICPU_MODEL_RSP_ERR);
ERROR(ACL_ERROR_RT_PROFILING_ERROR);
ERROR(ACL_ERROR_RT_IPC_ERROR);
ERROR(ACL_ERROR_RT_MODEL_ABORT_NORMAL);
ERROR(ACL_ERROR_RT_KERNEL_UNREGISTERING);
ERROR(ACL_ERROR_RT_RINGBUFFER_NOT_INIT);
ERROR(ACL_ERROR_RT_RINGBUFFER_NO_DATA);
ERROR(ACL_ERROR_RT_KERNEL_LOOKUP);
ERROR(ACL_ERROR_RT_KERNEL_DUPLICATE);
ERROR(ACL_ERROR_RT_DEBUG_REGISTER_FAIL);
ERROR(ACL_ERROR_RT_DEBUG_UNREGISTER_FAIL);
ERROR(ACL_ERROR_RT_LABEL_CONTEXT);
ERROR(ACL_ERROR_RT_PROGRAM_USE_OUT);
ERROR(ACL_ERROR_RT_DEV_SETUP_ERROR);
ERROR(ACL_ERROR_RT_VECTOR_CORE_TIMEOUT);
ERROR(ACL_ERROR_RT_VECTOR_CORE_EXCEPTION);
ERROR(ACL_ERROR_RT_VECTOR_CORE_TRAP_EXCEPTION);
ERROR(ACL_ERROR_RT_CDQ_BATCH_ABNORMAL);
ERROR(ACL_ERROR_RT_DIE_MODE_CHANGE_ERROR);
ERROR(ACL_ERROR_RT_DIE_SET_ERROR);
ERROR(ACL_ERROR_RT_INVALID_DIEID);
ERROR(ACL_ERROR_RT_DIE_MODE_NOT_SET);
ERROR(ACL_ERROR_RT_DRV_INTERNAL_ERROR);
ERROR(ACL_ERROR_RT_AICPU_INTERNAL_ERROR);
ERROR(ACL_ERROR_RT_SOCKET_CLOSE);
default:
return "unknown error";
}
......
......@@ -30,13 +30,23 @@ VarNodeArray TraceResult::dump(
std::vector<std::pair<size_t, std::string>> outputs, bool prefer_input_names) {
// var -> VarNode
std::vector<VarNode*> nodes(vars.size(), nullptr);
auto get_compnode = [](const VarInfo& info) -> CompNode {
auto& orig_cn = *(info.device);
std::string device_name_prefix =
orig_cn.locator_logical().to_string().substr(0, 3);
if (device_name_prefix == "cpu" || device_name_prefix == "gpu" ||
device_name_prefix == "xpu") {
return CompNode::load("xpux");
}
return orig_cn;
};
// make h2d node for each input
for (auto&& [input, name, shape] : inputs) {
auto& var = vars[input];
auto& node = nodes[input];
// TODO: cambricon CompNode
auto host = std::make_shared<HostTensorND>(
CompNode::load("xpux"), shape, *var.dtype);
auto host =
std::make_shared<HostTensorND>(get_compnode(var), shape, *var.dtype);
OperatorNodeConfig config;
// if prefer_input_names, prefer names from dump args
// else prefer names got from trace procedure
......
......@@ -390,7 +390,8 @@ public:
init();
int32_t device_id = -1;
auto err = aclrtGetDevice(&device_id);
if (err == ACL_ERROR_INVALID_DEVICE || device != device_id) {
if (err == ACL_ERROR_INVALID_DEVICE || err == ACL_ERROR_RT_CONTEXT_NULL ||
device != device_id) {
MGB_ATLAS_CHECK(aclrtSetDevice(device));
} else {
MGB_ATLAS_CHECK(err);
......
......@@ -191,7 +191,9 @@ AtlasRuntimeOpr::AtlasRuntimeOpr(
MegBrainError,
"Unsupported aclAippInputFormat for input %zu. ", i);
}
} else if (ACL_ERROR_NOT_STATIC_AIPP == acl_err) {
} else if (
ACL_ERROR_NOT_STATIC_AIPP == acl_err ||
ACL_ERROR_GE_AIPP_NOT_EXIST == acl_err) {
m_aipp_input_format[i] = AippInputFormat::NO_AIPP;
} else {
MGB_ATLAS_CHECK(acl_err);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册