Skip to content

Commit

Permalink
[GTests] Rename non-unique test names (TEST, TEST_P, TEST_F, TYPED_TE…
Browse files Browse the repository at this point in the history
…ST). Part 2. (#3449)

[GTests] Rename non-unique test names (TEST, TEST_P, TEST_F, TYPED_TEST). Part 2
  • Loading branch information
Vsevolod1983 authored Dec 27, 2024
1 parent 60a7c7d commit ec5dadb
Show file tree
Hide file tree
Showing 32 changed files with 340 additions and 217 deletions.
10 changes: 6 additions & 4 deletions test/gtest/conv_igemm_dynamic_dlops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,20 +153,22 @@ bool IsTestSupportedForDevice()

} // namespace

class GPU_Conv2dDefault_FP16 : public HalfTestCase<std::vector<TestCase>>
class GPU_Conv2dDefaultIGemmDynamicDLops_FP16 : public HalfTestCase<std::vector<TestCase>>
{
};

TEST_P(GPU_Conv2dDefault_FP16, HalfTest_conv_igemm_dynamic_dlops)
TEST_P(GPU_Conv2dDefaultIGemmDynamicDLops_FP16, HalfTest_conv_igemm_dynamic_dlops)
{
if(IsTestSupportedForDevice() && !SkipTest())
{
invoke_with_params<conv2d_driver, GPU_Conv2dDefault_FP16>(default_check);
invoke_with_params<conv2d_driver, GPU_Conv2dDefaultIGemmDynamicDLops_FP16>(default_check);
}
else
{
GTEST_SKIP();
}
};

INSTANTIATE_TEST_SUITE_P(Full, GPU_Conv2dDefault_FP16, testing::Values(GetTestCases()));
INSTANTIATE_TEST_SUITE_P(Full,
GPU_Conv2dDefaultIGemmDynamicDLops_FP16,
testing::Values(GetTestCases()));
20 changes: 12 additions & 8 deletions test/gtest/conv_igemm_dynamic_xdlops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,39 +116,43 @@ bool IsTestSupportedForDevice(const miopen::Handle& handle)
} // namespace conv_igemm_dynamic_xdlops
using namespace conv_igemm_dynamic_xdlops;

class GPU_Conv2dDefault_FP32 : public FloatTestCase<std::vector<TestCase>>
class GPU_Conv2dDefaultIGemmDynamicXDLops_FP32 : public FloatTestCase<std::vector<TestCase>>
{
};

class GPU_Conv2dDefault_FP16 : public HalfTestCase<std::vector<TestCase>>
class GPU_Conv2dDefaultIGemmDynamicXDLops_FP16 : public HalfTestCase<std::vector<TestCase>>
{
};

TEST_P(GPU_Conv2dDefault_FP32, FloatTest_conv_igemm_dynamic_xdlops)
TEST_P(GPU_Conv2dDefaultIGemmDynamicXDLops_FP32, FloatTest_conv_igemm_dynamic_xdlops)
{
const auto& handle = get_handle();
if(IsTestSupportedForDevice(handle))
{
invoke_with_params<conv2d_driver, GPU_Conv2dDefault_FP32>(default_check);
invoke_with_params<conv2d_driver, GPU_Conv2dDefaultIGemmDynamicXDLops_FP32>(default_check);
}
else
{
GTEST_SKIP();
}
};

TEST_P(GPU_Conv2dDefault_FP16, HalfTest_conv_igemm_dynamic_xdlops)
TEST_P(GPU_Conv2dDefaultIGemmDynamicXDLops_FP16, HalfTest_conv_igemm_dynamic_xdlops)
{
const auto& handle = get_handle();
if(IsTestSupportedForDevice(handle))
{
invoke_with_params<conv2d_driver, GPU_Conv2dDefault_FP16>(default_check);
invoke_with_params<conv2d_driver, GPU_Conv2dDefaultIGemmDynamicXDLops_FP16>(default_check);
}
else
{
GTEST_SKIP();
}
};

INSTANTIATE_TEST_SUITE_P(Full, GPU_Conv2dDefault_FP32, testing::Values(GetTestCases()));
INSTANTIATE_TEST_SUITE_P(Full, GPU_Conv2dDefault_FP16, testing::Values(GetTestCases()));
INSTANTIATE_TEST_SUITE_P(Full,
GPU_Conv2dDefaultIGemmDynamicXDLops_FP32,
testing::Values(GetTestCases()));
INSTANTIATE_TEST_SUITE_P(Full,
GPU_Conv2dDefaultIGemmDynamicXDLops_FP16,
testing::Values(GetTestCases()));
24 changes: 12 additions & 12 deletions test/gtest/conv_igemm_mlir_fwd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,45 +67,45 @@ bool IsTestSupportedForDevice()

} // namespace

class GPU_Conv2dDefaultMLIRTest_FP32 : public FloatTestCase<std::vector<TestCase>>
class GPU_Conv2dMLIRTestIGemmFwd_FP32 : public FloatTestCase<std::vector<TestCase>>
{
};
class GPU_Conv2dDefaultMLIRTest_FP16 : public HalfTestCase<std::vector<TestCase>>
class GPU_Conv2dMLIRTestIGemmFwd_FP16 : public HalfTestCase<std::vector<TestCase>>
{
};
class GPU_Conv2dDefaultMLIRTest_I8 : public Int8TestCase<std::vector<TestCase>>
class GPU_Conv2dMLIRTestIGemmFwd_I8 : public Int8TestCase<std::vector<TestCase>>
{
};

TEST_P(GPU_Conv2dDefaultMLIRTest_FP32, FloatTest_conv_igemm_mlir_fwd)
TEST_P(GPU_Conv2dMLIRTestIGemmFwd_FP32, FloatTest_conv_igemm_mlir_fwd)
{
if(IsTestSupportedForDevice())
{
invoke_with_params<conv2d_driver, GPU_Conv2dDefaultMLIRTest_FP32>(db_check);
invoke_with_params<conv2d_driver, GPU_Conv2dMLIRTestIGemmFwd_FP32>(db_check);
}
else
{
GTEST_SKIP();
}
};

TEST_P(GPU_Conv2dDefaultMLIRTest_FP16, HalfTest_conv_igemm_mlir_fwd)
TEST_P(GPU_Conv2dMLIRTestIGemmFwd_FP16, HalfTest_conv_igemm_mlir_fwd)
{
if(IsTestSupportedForDevice())
{
invoke_with_params<conv2d_driver, GPU_Conv2dDefaultMLIRTest_FP16>(db_check);
invoke_with_params<conv2d_driver, GPU_Conv2dMLIRTestIGemmFwd_FP16>(db_check);
}
else
{
GTEST_SKIP();
}
};

TEST_P(GPU_Conv2dDefaultMLIRTest_I8, Int8Test_conv_igemm_mlir_fwd)
TEST_P(GPU_Conv2dMLIRTestIGemmFwd_I8, Int8Test_conv_igemm_mlir_fwd)
{
if(IsTestSupportedForDevice())
{
invoke_with_params<conv2d_driver, GPU_Conv2dDefaultMLIRTest_I8>(db_check);
invoke_with_params<conv2d_driver, GPU_Conv2dMLIRTestIGemmFwd_I8>(db_check);
}
else
{
Expand All @@ -114,8 +114,8 @@ TEST_P(GPU_Conv2dDefaultMLIRTest_I8, Int8Test_conv_igemm_mlir_fwd)
};

// Float for FWD, BWD, WRW
INSTANTIATE_TEST_SUITE_P(Full, GPU_Conv2dDefaultMLIRTest_FP32, testing::Values(GetTestCases()));
INSTANTIATE_TEST_SUITE_P(Full, GPU_Conv2dMLIRTestIGemmFwd_FP32, testing::Values(GetTestCases()));
// Half for FWD, BWD, WRW
INSTANTIATE_TEST_SUITE_P(Full, GPU_Conv2dDefaultMLIRTest_FP16, testing::Values(GetTestCases()));
INSTANTIATE_TEST_SUITE_P(Full, GPU_Conv2dMLIRTestIGemmFwd_FP16, testing::Values(GetTestCases()));
// Int8 for FWD
INSTANTIATE_TEST_SUITE_P(Full, GPU_Conv2dDefaultMLIRTest_I8, testing::Values(GetTestCases()));
INSTANTIATE_TEST_SUITE_P(Full, GPU_Conv2dMLIRTestIGemmFwd_I8, testing::Values(GetTestCases()));
10 changes: 6 additions & 4 deletions test/gtest/conv_igemm_mlir_xdlops_bwd_wrw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ bool IsTestSupportedForDevice()

} // namespace

class GPU_Conv2dDefaultMLIRTest_FP32 : public FloatTestCase<std::vector<TestCase>>
class GPU_Conv2dMLIRTestIGemmXDlopsBwdWrw_FP32 : public FloatTestCase<std::vector<TestCase>>
{
};

TEST_P(GPU_Conv2dDefaultMLIRTest_FP32, FloatTest_conv_igemm_mlir_xdlops_bwd_wrw)
TEST_P(GPU_Conv2dMLIRTestIGemmXDlopsBwdWrw_FP32, FloatTest_conv_igemm_mlir_xdlops_bwd_wrw)
{
if(IsTestSupportedForDevice())
{
invoke_with_params<conv2d_driver, GPU_Conv2dDefaultMLIRTest_FP32>(db_check);
invoke_with_params<conv2d_driver, GPU_Conv2dMLIRTestIGemmXDlopsBwdWrw_FP32>(db_check);
}
else
{
Expand All @@ -100,4 +100,6 @@ TEST_P(GPU_Conv2dDefaultMLIRTest_FP32, FloatTest_conv_igemm_mlir_xdlops_bwd_wrw)
};

// Half for FWD, BWD, WRW
INSTANTIATE_TEST_SUITE_P(Full, GPU_Conv2dDefaultMLIRTest_FP32, testing::Values(GetTestCases()));
INSTANTIATE_TEST_SUITE_P(Full,
GPU_Conv2dMLIRTestIGemmXDlopsBwdWrw_FP32,
testing::Values(GetTestCases()));
20 changes: 12 additions & 8 deletions test/gtest/conv_igemm_mlir_xdlops_fwd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,31 @@ bool IsTestSupportedForDevice()

} // namespace

class GPU_Conv2dDefaultMLIRTest_FP32 : public FloatTestCase<std::vector<TestCase>>
class GPU_Conv2dMLIRTestIGemmXDLopsFwd_FP32 : public FloatTestCase<std::vector<TestCase>>
{
};

class GPU_Conv2dDefaultMLIRTest_I8 : public Int8TestCase<std::vector<TestCase>>
class GPU_Conv2dMLIRTestIGemmXDLopsFwd_I8 : public Int8TestCase<std::vector<TestCase>>
{
};

TEST_P(GPU_Conv2dDefaultMLIRTest_FP32, FloatTest_conv_igemm_mlir_xdlops_fwd)
TEST_P(GPU_Conv2dMLIRTestIGemmXDLopsFwd_FP32, FloatTest_conv_igemm_mlir_xdlops_fwd)
{
if(IsTestSupportedForDevice())
{
invoke_with_params<conv2d_driver, GPU_Conv2dDefaultMLIRTest_FP32>(db_check);
invoke_with_params<conv2d_driver, GPU_Conv2dMLIRTestIGemmXDLopsFwd_FP32>(db_check);
}
else
{
GTEST_SKIP();
}
};

TEST_P(GPU_Conv2dDefaultMLIRTest_I8, Int8Test_conv_igemm_mlir_xdlops_fwd)
TEST_P(GPU_Conv2dMLIRTestIGemmXDLopsFwd_I8, Int8Test_conv_igemm_mlir_xdlops_fwd)
{
if(IsTestSupportedForDevice())
{
invoke_with_params<conv2d_driver, GPU_Conv2dDefaultMLIRTest_I8>(db_check);
invoke_with_params<conv2d_driver, GPU_Conv2dMLIRTestIGemmXDLopsFwd_I8>(db_check);
}
else
{
Expand All @@ -101,6 +101,10 @@ TEST_P(GPU_Conv2dDefaultMLIRTest_I8, Int8Test_conv_igemm_mlir_xdlops_fwd)
};

// Half for FWD, BWD, WRW
INSTANTIATE_TEST_SUITE_P(Full, GPU_Conv2dDefaultMLIRTest_FP32, testing::Values(GetTestCases()));
INSTANTIATE_TEST_SUITE_P(Full,
GPU_Conv2dMLIRTestIGemmXDLopsFwd_FP32,
testing::Values(GetTestCases()));
// Int8 for FWD
INSTANTIATE_TEST_SUITE_P(Full, GPU_Conv2dDefaultMLIRTest_I8, testing::Values(GetTestCases()));
INSTANTIATE_TEST_SUITE_P(Full,
GPU_Conv2dMLIRTestIGemmXDLopsFwd_I8,
testing::Values(GetTestCases()));
4 changes: 2 additions & 2 deletions test/gtest/log_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
#if MIOPEN_BACKEND_HIP
#include "log.hpp"

TEST(CPU_LOG_TEST_NONE, AssertLogCmdOutput)
TEST(CPU_LOG_TEST_ASSERT_NONE, AssertLogCmdOutput)
{
TestLogFun(miopen::debug::LogCmdConvolution, logConv, true);
}

TEST(CPU_LOG_TEST_NONE, AssertLogFindCmdOutput)
TEST(CPU_LOG_TEST_ASSERT_NONE, AssertLogFindCmdOutput)
{
TestLogFun(miopen::debug::LogCmdFindConvolution, logFindConv, true);
}
Expand Down
8 changes: 4 additions & 4 deletions test/gtest/log_test_neg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@
#if MIOPEN_BACKEND_HIP
#include "log.hpp"

TEST(CPU_LOG_TEST_NONE, AssertLogCmdOutput_Neg)
TEST(CPU_LOG_TEST_NEG_NONE, AssertLogCmdOutput_Neg)
{
TestLogFun(miopen::debug::LogCmdConvolution, logConv, false);
}

TEST(CPU_LOG_TEST_NONE, AssertLogFindCmdOutput_Neg)
TEST(CPU_LOG_TEST_NEG_NONE, AssertLogFindCmdOutput_Neg)
{
TestLogFun(miopen::debug::LogCmdFindConvolution, logFindConv, false);
}

TEST(CPU_LOG_TEST_NONE, AssertTestLogCmdCBAFusionOutput_Neg)
TEST(CPU_LOG_TEST_NEG_NONE, AssertTestLogCmdCBAFusionOutput_Neg)
{
TestLogCmdCBAFusion(miopen::debug::LogCmdFusion, logFusionConvBiasActiv, false);
}

TEST(CPU_LOG_TEST_NONE, AssertTestLogCmdBNormFusionOutput_Neg)
TEST(CPU_LOG_TEST_NEG_NONE, AssertTestLogCmdBNormFusionOutput_Neg)
{
TestLogCmdBNormFusion(miopen::debug::LogCmdFusion, logBnormActiv, false);
}
Expand Down
10 changes: 6 additions & 4 deletions test/gtest/regression_half_mi100.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,22 @@ bool IsTestSupportedForDevice()

} // namespace

class GPU_Conv2dDefault_FP16 : public HalfTestCase<std::vector<TestCase>>
class GPU_Conv2dDefaultRegressionMI100_FP16 : public HalfTestCase<std::vector<TestCase>>
{
};

TEST_P(GPU_Conv2dDefault_FP16, HalfTest_regression_half_mi100)
TEST_P(GPU_Conv2dDefaultRegressionMI100_FP16, HalfTest_regression_half_mi100)
{
if(IsTestSupportedForDevice())
{
invoke_with_params<conv2d_driver, GPU_Conv2dDefault_FP16>(default_check);
invoke_with_params<conv2d_driver, GPU_Conv2dDefaultRegressionMI100_FP16>(default_check);
}
else
{
GTEST_SKIP();
}
};

INSTANTIATE_TEST_SUITE_P(Smoke, GPU_Conv2dDefault_FP16, testing::Values(GetTestCases()));
INSTANTIATE_TEST_SUITE_P(Smoke,
GPU_Conv2dDefaultRegressionMI100_FP16,
testing::Values(GetTestCases()));
10 changes: 6 additions & 4 deletions test/gtest/smoke_solver_ConvAsmImplicitGemmV4R1Dynamic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,22 @@ bool IsTestSupportedForDevice()

} // namespace

class GPU_Conv2dDefault_FP32 : public FloatTestCase<std::vector<TestCase>>
class GPU_Conv2dDefaultGemmV4R1Dynamic_FP32 : public FloatTestCase<std::vector<TestCase>>
{
};

TEST_P(GPU_Conv2dDefault_FP32, FloatTest_smoke_solver_ConvAsmImplicitGemmV4R1Dynamic)
TEST_P(GPU_Conv2dDefaultGemmV4R1Dynamic_FP32, FloatTest_smoke_solver_ConvAsmImplicitGemmV4R1Dynamic)
{
if(IsTestSupportedForDevice() && !SkipTest())
{
invoke_with_params<conv2d_driver, GPU_Conv2dDefault_FP32>(default_check);
invoke_with_params<conv2d_driver, GPU_Conv2dDefaultGemmV4R1Dynamic_FP32>(default_check);
}
else
{
GTEST_SKIP();
}
};

INSTANTIATE_TEST_SUITE_P(Smoke, GPU_Conv2dDefault_FP32, testing::Values(GetTestCases()));
INSTANTIATE_TEST_SUITE_P(Smoke,
GPU_Conv2dDefaultGemmV4R1Dynamic_FP32,
testing::Values(GetTestCases()));
10 changes: 6 additions & 4 deletions test/gtest/smoke_solver_ConvAsm_5x10_7x7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,22 @@ bool IsTestSupportedForDevice()

} // namespace

class GPU_Conv2dDefault_FP32 : public FloatTestCase<std::vector<TestCase>>
class GPU_Conv2dDefaultAsm_5x10_7x7_FP32 : public FloatTestCase<std::vector<TestCase>>
{
};

TEST_P(GPU_Conv2dDefault_FP32, FloatTest_smoke_solver_ConvAsm_5x10_7x7)
TEST_P(GPU_Conv2dDefaultAsm_5x10_7x7_FP32, FloatTest_smoke_solver_ConvAsm_5x10_7x7)
{
if(IsTestSupportedForDevice() && !SkipTest())
{
invoke_with_params<conv2d_driver, GPU_Conv2dDefault_FP32>(default_check);
invoke_with_params<conv2d_driver, GPU_Conv2dDefaultAsm_5x10_7x7_FP32>(default_check);
}
else
{
GTEST_SKIP();
}
};

INSTANTIATE_TEST_SUITE_P(Smoke, GPU_Conv2dDefault_FP32, testing::Values(GetTestCases()));
INSTANTIATE_TEST_SUITE_P(Smoke,
GPU_Conv2dDefaultAsm_5x10_7x7_FP32,
testing::Values(GetTestCases()));
10 changes: 6 additions & 4 deletions test/gtest/smoke_solver_ConvBinWinograd3x3U.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,22 @@ bool IsTestSupportedForDevice()

} // namespace

class GPU_Conv2dDefault_FP32 : public FloatTestCase<std::vector<TestCase>>
class GPU_Conv2dDefaultBinWinograd3x3U_FP32 : public FloatTestCase<std::vector<TestCase>>
{
};

TEST_P(GPU_Conv2dDefault_FP32, FloatTest_smoke_solver_ConvBinWinograd3x3U)
TEST_P(GPU_Conv2dDefaultBinWinograd3x3U_FP32, FloatTest_smoke_solver_ConvBinWinograd3x3U)
{
if(IsTestSupportedForDevice() && !SkipTest())
{
invoke_with_params<conv2d_driver, GPU_Conv2dDefault_FP32>(default_check);
invoke_with_params<conv2d_driver, GPU_Conv2dDefaultBinWinograd3x3U_FP32>(default_check);
}
else
{
GTEST_SKIP();
}
};

INSTANTIATE_TEST_SUITE_P(Smoke, GPU_Conv2dDefault_FP32, testing::Values(GetTestCases()));
INSTANTIATE_TEST_SUITE_P(Smoke,
GPU_Conv2dDefaultBinWinograd3x3U_FP32,
testing::Values(GetTestCases()));
Loading

0 comments on commit ec5dadb

Please sign in to comment.