/**
 * 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.
 */
#include "ascendc_ir.h"
#include "defalut_reg_func.h"
#include "common/checker.h"

namespace af {
namespace ascir {
constexpr int32_t BASIC_TMP_SIZE = 8192;

//ZerosLike impl by duplicate api, just duplivate zero to output 
std::vector<std::unique_ptr<TmpBufDesc>> CalcZerosLikeTmpSize(const AscNode &node)
{
    AscNodeInputs node_inputs = node.inputs;
    auto type_size = Expression(Symbol(GetSizeByDataType(node_inputs[0].attr.dtype)));

    Expression input_size = GetInputSize(node_inputs);

    Expression min_temp_size = sym::Max(type_size * input_size, Symbol(BASIC_TMP_SIZE));

    TmpBufDesc desc = {min_temp_size, -1};
    std::vector<std::unique_ptr<TmpBufDesc>> tmp_buf_descs;
    tmp_buf_descs.emplace_back(std::make_unique<TmpBufDesc>(desc));
    return tmp_buf_descs;
}
}
}