Merge pull request !2109 from shenwei41/releasetags/v1.8.0^2
@@ -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 <cstdint> | |||||
#include <cstddef> | |||||
#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<const uint64_t>(reinterpret_cast<const uintptr_t>(ptr)); | |||||
} | |||||
inline void *ValueToPtr(const uint64_t value) | |||||
{ | |||||
return reinterpret_cast<void *>(static_cast<const uintptr_t>(value)); | |||||
} | |||||
template<typename TI, typename TO> | |||||
inline TO *PtrToPtr(TI *ptr) | |||||
{ | |||||
return reinterpret_cast<TO *>(ptr); | |||||
} | |||||
template<typename T> | |||||
inline T *PtrAdd(T * const ptr, const size_t maxIdx, const size_t idx) | |||||
{ | |||||
if ((ptr != nullptr) && (idx < maxIdx)) { | |||||
return reinterpret_cast<T *>(ptr + idx); | |||||
} | |||||
return nullptr; | |||||
} | |||||
#endif // AICPU_TYPE_DEF_H |
@@ -100,7 +100,7 @@ extern "C" { | |||||
MSVP_PROF_API uint64_t ProfGetOpExecutionTime(const void *data, uint32_t len, uint32_t index); | 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; | typedef struct aclprofSubscribeConfig aclprofSubscribeConfig1; | ||||
/// | /// | ||||
/// @ingroup AscendCL | /// @ingroup AscendCL | ||||
@@ -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 |