* 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 <gtest/gtest.h>
#include "../../{{op_name}}_param.h"
#include "tiling_case_executor.h"
namespace {
{
OpName
}
}
UT {
class {
{
OpName
}
} Arch32TilingTest : public testing::TestWithParam < {
{
OpName
}
}
TilingUtParam>{protected : static void SetUpTestCase(){
std::cout << "{{OpName}} Arch32 TilingTest SetUp" << std::endl;
}
static void TearDownTestCase() {
std::cout << "{{OpName}} Arch32 TilingTest TearDown" << std::endl;
}
}
;
TEST_P(
{
{
OpName
}
} Arch32TilingTest,
param) {
auto param = GetParam();
struct EmptyCompileInfo {
} compileInfo;
const std::string A2SocInfo =
"{\n"
" \"hardware_info\": {\n"
" \"BT_SIZE\": 0,\n"
" \"load3d_constraints\": \"1\",\n"
" \"Intrinsic_fix_pipe_l0c2out\": false,\n"
" \"Intrinsic_data_move_l12ub\": true,\n"
" \"Intrinsic_data_move_l0c2ub\": true,\n"
" \"Intrinsic_data_move_out2l1_nd2nz\": false,\n"
" \"UB_SIZE\": 196608,\n"
" \"L2_SIZE\": 201326592,\n"
" \"L1_SIZE\": 524288,\n"
" \"L0A_SIZE\": 65536,\n"
" \"L0B_SIZE\": 65536,\n"
" \"L0C_SIZE\": 131072,\n"
" \"vector_core_cnt\": 40,\n"
" \"cube_core_cnt\": 20,\n"
" \"socVersion\": \"Ascend910_B3\"\n"
" }\n"
"}";
gert::TilingContextPara tilingContextPara(
"{{OpName}}",
{
param.input0,
param.input1,
},
{
param.output0,
},
{
{"attr_int",
Ops::Transformer::AnyValue::CreateFrom<int64_t>(param.attr_int)},
{"attr_float",
Ops::Transformer::AnyValue::CreateFrom<float>(param.attr_float)},
{"attr_string", Ops::Transformer::AnyValue::CreateFrom<std::string>(
param.attr_string)},
{"attr_bool",
Ops::Transformer::AnyValue::CreateFrom<bool>(param.attr_bool)},
},
param.inputInstance,
param.outputInstance,
&compileInfo,
"Ascend910B",
40,
196608,
4096,
A2SocInfo
);
ExecuteTestCase(tilingContextPara, param.expectResult, param.expectTilingKey,
param.expectTilingDataHash, {},
0,
true
);
}
INSTANTIATE_TEST_SUITE_P(
{{OpName}},
{
{
OpName
}
} Arch32TilingTest,
testing::ValuesIn(GetCasesFromCsv<{
{
OpName
}
} TilingUtParam>(ReplaceFileExtension2Csv(__FILE__))),
PrintCaseInfoString<{
{
OpName
}
} TilingUtParam>);
}