/** * Copyright 2019-2020 Huawei Technologies Co., Ltd * * 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 CCE_DEF_H__ #define CCE_DEF_H__ #include "runtime/rt.h" namespace cce { /** * @ingroup cce * @brief memory configure for fusion */ typedef struct TagCceFusionMemCfg { uint64_t memAddr; /**< memAddr */ uint32_t memSize; /**< memSize */ uint32_t addrChangeFlag; /**< op data addr change flag. value:0,valid;1,not valid */ uint32_t poolFlag; /**< mempool flag : value:0,is valid; value: 1, not valid */ TagCceFusionMemCfg() { memAddr = 0; memSize = 0; addrChangeFlag = 0; poolFlag = 0; } } CceFusionMemCfg_t; /** * @ingroup cce * @brief return value */ typedef enum tagCcStatus { CC_STATUS_SUCCESS = 0, /**< succ */ CC_STATUS_NOT_INITIALIZED = 1, /**< not init */ CC_STATUS_ALLOC_FAILED = 2, /**< alloc mem failed */ CC_STATUS_BAD_PARAM = 3, /**< para check failed */ CC_STATUS_INTERNAL_ERROR = 4, /**< internal error */ CC_STATUS_KERNEL_ERROR = 5, /**< kernel error */ CC_STATUS_RUNTIME_ERROR = 6, /**< runtime error */ CC_STATUS_NOT_SUPPORTED = 7, /**< unsupport error */ CC_STATUS_INVALID_VALUE = 7, /**< invalid value error for blas*/ CC_STATUS_RESERVED /**< just for check */ } ccStatus_t; /** * @ingroup cce * @brief original data type */ typedef enum tagCcDataType { CC_DATA_FLOAT = 0, /**< float type */ CC_DATA_HALF, /**< fp16 type */ CC_DATA_INT8, /**< int8 type */ CC_DATA_INT32, /**< int32 type */ CC_DATA_UINT8, /**< uint8 type */ CC_DATA_HALF_UINT16_PROPOSAL, /**