* Copyright (c) 2026 Huawei Technologies Co., Ltd.
* This program is free software, you can redistribute it and/or modify it under the terms and conditions of
* CANN Open Software License Agreement Version 2.0 (the "License").
* Please refer to the License for details. You may not use this file except in compliance with the License.
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
* See LICENSE in the root of the software repository for the full text of the License.
*/
* \file handle.hpp
* \brief Handle 管理头文件
*/
#ifndef ACLTENSOR_LIB_CORE_HANDLE_HPP
#define ACLTENSOR_LIB_CORE_HANDLE_HPP
#include <cstdint>
#include "cann_ops_tensor_types.h"
namespace acltensor {
* @brief SoC 类型枚举
*
* 注意:当前版本仅支持 Ascend950,其他枚举项暂不支持。
*/
enum class SocType : uint32_t
{
UNKNOWN = 0,
ASCEND950
};
* @brief Ascend 设备信息
*/
class AscendDevice {
public:
AscendDevice();
~AscendDevice() = default;
int32_t getDeviceId() const { return deviceId_; }
uint32_t getCoreNum() const { return coreNum_; }
uint64_t getUbSize() const { return ubSize_; }
SocType getSocType() const { return socType_; }
const char* getSocName() const { return socName_; }
bool supportsFp32() const { return true; }
private:
int32_t deviceId_ = -1;
uint32_t coreNum_ = 0;
uint64_t ubSize_ = 0;
SocType socType_ = SocType::UNKNOWN;
char socName_[64] = {0};
};
}
* @brief 对外句柄结构体
*/
struct acltensorHandle {
acltensor::AscendDevice device;
};
#endif