* Copyright (c) 2025 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.
*/
#ifndef GE_COMMON_MEMORY__FEATURE_MEMORY_IMPL_H
#define GE_COMMON_MEMORY__FEATURE_MEMORY_IMPL_H
#include "ge/ge_feature_memory.h"
namespace ge {
class FeatureMemory::FeatureMemoryData {
public:
struct MemoryAttr {
bool is_fixed;
};
FeatureMemoryData() = default;
~FeatureMemoryData() = default;
MemoryType GetType() const;
size_t GetSize() const;
bool IsFixed() const;
private:
friend class FeatureMemory::Builder;
void SetTypeSize(const MemoryType type, const size_t size, const FeatureMemoryData::MemoryAttr &mem_attr);
MemoryType type_;
size_t size_;
bool is_fixed_;
};
class FeatureMemory::Builder {
public:
Builder() = default;
~Builder() = default;
static FeatureMemoryPtr Build(const MemoryType type, const size_t size,
const FeatureMemoryData::MemoryAttr &mem_attr);
};
}
#endif