diff --git a/third_party/fwkacllib/inc/common/type_def.h b/third_party/fwkacllib/inc/common/type_def.h new file mode 100644 index 00000000..1bbaf32d --- /dev/null +++ b/third_party/fwkacllib/inc/common/type_def.h @@ -0,0 +1,52 @@ +/** +* Copyright (c) Huawei Technologies Co., Ltd. 2021. 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. +* +* Description:interface. +* Create: 2021-12-21 +*/ +#ifndef AICPU_TYPE_DEF_H +#define AICPU_TYPE_DEF_H + +#include +#include +#ifndef char_t +typedef char char_t; +#endif + +#ifndef float32_t +typedef float float32_t; +#endif + +#ifndef float64_t +typedef double float64_t; +#endif + +inline uint64_t PtrToValue(const void *ptr) +{ + return static_cast(reinterpret_cast(ptr)); +} + +inline void *ValueToPtr(const uint64_t value) +{ + return reinterpret_cast(static_cast(value)); +} + +template +inline TO *PtrToPtr(TI *ptr) +{ + return reinterpret_cast(ptr); +} + +template +inline T *PtrAdd(T * const ptr, const size_t maxIdx, const size_t idx) +{ + if ((ptr != nullptr) && (idx < maxIdx)) { + return reinterpret_cast(ptr + idx); + } + return nullptr; +} +#endif // AICPU_TYPE_DEF_H diff --git a/third_party/fwkacllib/inc/toolchain/prof_acl_api.h b/third_party/fwkacllib/inc/toolchain/prof_acl_api.h index 15baae46..e592526b 100644 --- a/third_party/fwkacllib/inc/toolchain/prof_acl_api.h +++ b/third_party/fwkacllib/inc/toolchain/prof_acl_api.h @@ -100,7 +100,7 @@ extern "C" { MSVP_PROF_API uint64_t ProfGetOpExecutionTime(const void *data, uint32_t len, uint32_t index); -typedef in32_t Status; +typedef int32_t Status; typedef struct aclprofSubscribeConfig aclprofSubscribeConfig1; /// /// @ingroup AscendCL diff --git a/third_party/fwkacllib/inc/tsd/status.h b/third_party/fwkacllib/inc/tsd/status.h new file mode 100644 index 00000000..e0a9b619 --- /dev/null +++ b/third_party/fwkacllib/inc/tsd/status.h @@ -0,0 +1,29 @@ +/** + * Copyright (c) Hisilicon Technologies Co., Ltd. 2019-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_TDT_STATUS_H +#define INC_TDT_STATUS_H +#include "common/type_def.h" +namespace tsd { +#ifdef __cplusplus + using TSD_StatusT = uint32_t; +#else + typedef uint32_t TSD_StatusT; +#endif + // success code + constexpr TSD_StatusT TSD_OK = 0U; +} +#endif // INC_TDT_STATUS_H