Skip to content

Commit

Permalink
GTests renaming: filenames which start with letters N-R (#3216)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vsevolod1983 authored Aug 28, 2024
1 parent 603d290 commit 185f33c
Show file tree
Hide file tree
Showing 16 changed files with 147 additions and 161 deletions.
16 changes: 8 additions & 8 deletions test/gtest/na_infer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@

#include "na.hpp"

struct BNActivInferFloat : BNActivInferTest<float>
struct GPU_BNActivInfer_FP32 : BNActivInferTest<float>
{
};

struct BNActivInferHalf : BNActivInferTest<half_float::half>
struct GPU_BNActivInfer_FP16 : BNActivInferTest<half_float::half>
{
};

Expand All @@ -60,27 +60,27 @@ void RunSolver(miopen::FusionPlanDescriptor& fusePlanDesc,
(invoker)(handle, plan_params);
handle.Finish();
}
TEST_P(BNActivInferFloat, BnFwdInferActivationFused)
TEST_P(GPU_BNActivInfer_FP32, BnFwdInferActivationFused)
{
const auto plan_params = miopen::fusion::FusionInvokeParams(
params, input.desc, in_dev.get(), output.desc, out_dev.get(), false);
RunSolver<miopen::solver::fusion::BnFwdInferActivationFused>(
fusePlanDesc, plan_params, bn_config, test_skipped);
}

INSTANTIATE_TEST_SUITE_P(BNActivInferFloatSuite,
BNActivInferFloat,
INSTANTIATE_TEST_SUITE_P(Full,
GPU_BNActivInfer_FP32,
testing::Combine(testing::Values(miopenActivationRELU),
testing::ValuesIn(Networkna1())));
TEST_P(BNActivInferHalf, DISABLED_BnFwdInferActivationFused)
TEST_P(GPU_BNActivInfer_FP16, DISABLED_BnFwdInferActivationFused)
{
const auto plan_params = miopen::fusion::FusionInvokeParams(
params, input.desc, in_dev.get(), output.desc, out_dev.get(), false);
RunSolver<miopen::solver::fusion::BnFwdInferActivationFused>(
fusePlanDesc, plan_params, bn_config, test_skipped);
}

INSTANTIATE_TEST_SUITE_P(BNActivInferHalfSuite,
BNActivInferHalf,
INSTANTIATE_TEST_SUITE_P(Full,
GPU_BNActivInfer_FP16,
testing::Combine(testing::Values(miopenActivationRELU),
testing::ValuesIn(Networkna1())));
16 changes: 8 additions & 8 deletions test/gtest/nonpack_conv3d_fwd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "get_handle.hpp"
#include "nonpack_conv3d_fwd.hpp"

struct ConvNonpackFwdSolverTest3DHalf : ConvNonpackFwdSolverTest3D<half_float::half>
struct GPU_ConvNonpackFwdSolverTest3D_FP16 : ConvNonpackFwdSolverTest3D<half_float::half>
{
};

Expand Down Expand Up @@ -81,7 +81,7 @@ void SolverFwd(const miopen::TensorDescriptor& inputDesc,
handle.Finish();
}

TEST_P(ConvNonpackFwdSolverTest3DHalf, CKNonPackConvFwd3D)
TEST_P(GPU_ConvNonpackFwdSolverTest3D_FP16, CKNonPackConvFwd3D)
{
SolverFwd<miopen::solver::conv::ConvHipImplicitGemm3DGroupFwdXdlops>(
input.desc,
Expand All @@ -100,24 +100,24 @@ TEST_P(ConvNonpackFwdSolverTest3DHalf, CKNonPackConvFwd3D)
// TODO: write test that varifies if values of alpha beta selects default, scalar or bilinear
// solver.

INSTANTIATE_TEST_SUITE_P(ConvFwdTestDefault,
ConvNonpackFwdSolverTest3DHalf,
INSTANTIATE_TEST_SUITE_P(FullConvFwdDefault,
GPU_ConvNonpackFwdSolverTest3D_FP16,
testing::Combine(testing::Values(miopenConvolutionFwdAlgoImplicitGEMM),
testing::ValuesIn(ConvTestConfigs<NonPackTestCase>()),
testing::ValuesIn({1.0}), // alpha
testing::ValuesIn({0.0}), // beta
testing::Values(miopenTensorNDHWC)));

INSTANTIATE_TEST_SUITE_P(ConvFwdTestScalar,
ConvNonpackFwdSolverTest3DHalf,
INSTANTIATE_TEST_SUITE_P(FullConvFwdScalar,
GPU_ConvNonpackFwdSolverTest3D_FP16,
testing::Combine(testing::Values(miopenConvolutionFwdAlgoImplicitGEMM),
testing::ValuesIn(ConvTestConfigs<NonPackTestCase>()),
testing::ValuesIn({2.0}), // alpha
testing::ValuesIn({0.0}), // beta
testing::Values(miopenTensorNDHWC)));

INSTANTIATE_TEST_SUITE_P(ConvFwdTestBilinear,
ConvNonpackFwdSolverTest3DHalf,
INSTANTIATE_TEST_SUITE_P(FullConvFwdBilinear,
GPU_ConvNonpackFwdSolverTest3D_FP16,
testing::Combine(testing::Values(miopenConvolutionFwdAlgoImplicitGEMM),
testing::ValuesIn(ConvTestConfigs<NonPackTestCase>()),
testing::ValuesIn({2.0}), // alpha
Expand Down
18 changes: 9 additions & 9 deletions test/gtest/pooling2d_asymmetric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ namespace env = miopen::env;

namespace pooling2d_asymmetric {

class Pooling2dFloat : public testing::TestWithParam<std::vector<std::string>>
class GPU_Pooling2d_FP32 : public testing::TestWithParam<std::vector<std::string>>
{
};

class AsymPooling2dHalf : public testing::TestWithParam<std::vector<std::string>>
class GPU_AsymPooling2d_FP16 : public testing::TestWithParam<std::vector<std::string>>
{
};

Expand All @@ -63,8 +63,8 @@ void Run2dDriver(miopenDataType_t prec)
std::vector<std::string> params;
switch(prec)
{
case miopenFloat: params = Pooling2dFloat::GetParam(); break;
case miopenHalf: params = AsymPooling2dHalf::GetParam(); break;
case miopenFloat: params = GPU_Pooling2d_FP32::GetParam(); break;
case miopenHalf: params = GPU_AsymPooling2d_FP16::GetParam(); break;
case miopenBFloat16:
case miopenInt8:
case miopenFloat8:
Expand All @@ -77,7 +77,7 @@ void Run2dDriver(miopenDataType_t prec)
"data type not supported by "
"immed_conv2d_codecov test";

default: params = Pooling2dFloat::GetParam();
default: params = GPU_Pooling2d_FP32::GetParam();
}

for(const auto& test_value : params)
Expand Down Expand Up @@ -116,7 +116,7 @@ std::vector<std::string> GetTestCases(const std::string& precision)
using namespace pooling2d_asymmetric;

/*
TEST_P(Pooling2dFloat, FloatTest_pooling2d_asymmetric)
TEST_P(GPU_Pooling2d_FP32, FloatTest_pooling2d_asymmetric)
{
const auto& handle = get_handle();
if(IsTestSupportedForDevice(handle) && !SkipTest() && IsTestRunWith("--float"))
Expand All @@ -130,7 +130,7 @@ TEST_P(Pooling2dFloat, FloatTest_pooling2d_asymmetric)
};
*/

TEST_P(AsymPooling2dHalf, HalfTest_pooling2d_asymmetric)
TEST_P(GPU_AsymPooling2d_FP16, HalfTest_pooling2d_asymmetric)
{
const auto& handle = get_handle();
if(IsTestSupportedForDevice(handle) && !SkipTest() && IsTestRunWith("--half"))
Expand All @@ -143,6 +143,6 @@ TEST_P(AsymPooling2dHalf, HalfTest_pooling2d_asymmetric)
}
};

// INSTANTIATE_TEST_SUITE_P(Pooling2D, Pooling2dFloat, testing::Values(GetTestCases("--float")));
// INSTANTIATE_TEST_SUITE_P(Full, GPU_Pooling2d_FP32, testing::Values(GetTestCases("--float")));

INSTANTIATE_TEST_SUITE_P(Pooling2D, AsymPooling2dHalf, testing::Values(GetTestCases("--half")));
INSTANTIATE_TEST_SUITE_P(Full, GPU_AsymPooling2d_FP16, testing::Values(GetTestCases("--half")));
18 changes: 9 additions & 9 deletions test/gtest/pooling2d_codecov.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ namespace env = miopen::env;

namespace pooling2d_codecov {

class Pooling2dFloat : public testing::TestWithParam<std::vector<std::string>>
class GPU_Pooling2d_FP32 : public testing::TestWithParam<std::vector<std::string>>
{
};

class Pooling2dHalf : public testing::TestWithParam<std::vector<std::string>>
class GPU_Pooling2d_FP16 : public testing::TestWithParam<std::vector<std::string>>
{
};

Expand All @@ -63,8 +63,8 @@ void Run2dDriver(miopenDataType_t prec)
std::vector<std::string> params;
switch(prec)
{
case miopenHalf: params = Pooling2dHalf::GetParam(); break;
case miopenFloat: params = Pooling2dFloat::GetParam(); break;
case miopenHalf: params = GPU_Pooling2d_FP16::GetParam(); break;
case miopenFloat: params = GPU_Pooling2d_FP32::GetParam(); break;
case miopenBFloat16:
case miopenInt8:
case miopenFloat8:
Expand All @@ -77,7 +77,7 @@ void Run2dDriver(miopenDataType_t prec)
"data type not supported by "
"immed_conv2d_codecov test";

default: params = Pooling2dFloat::GetParam();
default: params = GPU_Pooling2d_FP32::GetParam();
}

for(const auto& test_value : params)
Expand Down Expand Up @@ -115,7 +115,7 @@ std::vector<std::string> GetTestCases(const std::string& precision)
} // namespace pooling2d_codecov
using namespace pooling2d_codecov;

TEST_P(Pooling2dFloat, FloatTest_pooling2d_codecov)
TEST_P(GPU_Pooling2d_FP32, FloatTest_pooling2d_codecov)
{
const auto& handle = get_handle();
if(IsTestSupportedForDevice(handle) && !SkipTest() && IsTestRunWith("--float"))
Expand All @@ -128,7 +128,7 @@ TEST_P(Pooling2dFloat, FloatTest_pooling2d_codecov)
}
};

TEST_P(Pooling2dHalf, HalfTest_pooling2d_codecov)
TEST_P(GPU_Pooling2d_FP16, HalfTest_pooling2d_codecov)
{
const auto& handle = get_handle();
if(IsTestSupportedForDevice(handle) && !SkipTest() && IsTestRunWith("--half"))
Expand All @@ -141,6 +141,6 @@ TEST_P(Pooling2dHalf, HalfTest_pooling2d_codecov)
}
};

INSTANTIATE_TEST_SUITE_P(Pooling2D, Pooling2dFloat, testing::Values(GetTestCases("--float")));
INSTANTIATE_TEST_SUITE_P(Full, GPU_Pooling2d_FP32, testing::Values(GetTestCases("--float")));

INSTANTIATE_TEST_SUITE_P(Pooling2D, Pooling2dHalf, testing::Values(GetTestCases("--half")));
INSTANTIATE_TEST_SUITE_P(Full, GPU_Pooling2d_FP16, testing::Values(GetTestCases("--half")));
18 changes: 9 additions & 9 deletions test/gtest/pooling2d_wide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ namespace env = miopen::env;

namespace pooling2d_wide {

class Pooling2dFloat : public testing::TestWithParam<std::vector<std::string>>
class GPU_Pooling2d_FP32 : public testing::TestWithParam<std::vector<std::string>>
{
};

class WidePooling2dHalf : public testing::TestWithParam<std::vector<std::string>>
class GPU_WidePooling2d_FP16 : public testing::TestWithParam<std::vector<std::string>>
{
};

Expand All @@ -63,8 +63,8 @@ void Run2dDriver(miopenDataType_t prec)
std::vector<std::string> params;
switch(prec)
{
case miopenFloat: params = Pooling2dFloat::GetParam(); break;
case miopenHalf: params = WidePooling2dHalf::GetParam(); break;
case miopenFloat: params = GPU_Pooling2d_FP32::GetParam(); break;
case miopenHalf: params = GPU_WidePooling2d_FP16::GetParam(); break;
case miopenBFloat16:
case miopenInt8:
case miopenFloat8:
Expand All @@ -77,7 +77,7 @@ void Run2dDriver(miopenDataType_t prec)
"data type not supported by "
"immed_conv2d_codecov test";

default: params = Pooling2dFloat::GetParam();
default: params = GPU_Pooling2d_FP32::GetParam();
}

for(const auto& test_value : params)
Expand Down Expand Up @@ -116,7 +116,7 @@ std::vector<std::string> GetTestCases(const std::string& precision)
using namespace pooling2d_wide;

/*
TEST_P(Pooling2dFloat, FloatTest_pooling2d_wide)
TEST_P(GPU_Pooling2d_FP32, FloatTest_pooling2d_wide)
{
const auto& handle = get_handle();
if(IsTestSupportedForDevice(handle) && !SkipTest() && IsTestRunWith("--float"))
Expand All @@ -130,7 +130,7 @@ TEST_P(Pooling2dFloat, FloatTest_pooling2d_wide)
};
*/

TEST_P(WidePooling2dHalf, HalfTest_pooling2d_wide)
TEST_P(GPU_WidePooling2d_FP16, HalfTest_pooling2d_wide)
{
const auto& handle = get_handle();
if(IsTestSupportedForDevice(handle) && !SkipTest() && IsTestRunWith("--half"))
Expand All @@ -143,6 +143,6 @@ TEST_P(WidePooling2dHalf, HalfTest_pooling2d_wide)
}
};

// INSTANTIATE_TEST_SUITE_P(Pooling2D, Pooling2dFloat, testing::Values(GetTestCases("--float")));
// INSTANTIATE_TEST_SUITE_P(Full, GPU_Pooling2d_FP32, testing::Values(GetTestCases("--float")));

INSTANTIATE_TEST_SUITE_P(Pooling2D, WidePooling2dHalf, testing::Values(GetTestCases("--half")));
INSTANTIATE_TEST_SUITE_P(Full, GPU_WidePooling2d_FP16, testing::Values(GetTestCases("--half")));
10 changes: 4 additions & 6 deletions test/gtest/reduce_custom_fp32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ std::vector<std::string> GetTestCases(void)

using TestCase = decltype(GetTestCases())::value_type;

class ConfigWithFloat_reduce_custom_fp32 : public testing::TestWithParam<std::vector<TestCase>>
class GPU_reduce_custom_fp32_FP32 : public testing::TestWithParam<std::vector<TestCase>>
{
};

Expand All @@ -78,7 +78,7 @@ void Run2dDriver(void)
{
GTEST_SKIP();
}
std::vector<std::string> params = ConfigWithFloat_reduce_custom_fp32::GetParam();
std::vector<std::string> params = GPU_reduce_custom_fp32_FP32::GetParam();

for(const auto& test_value : params)
{
Expand All @@ -98,8 +98,6 @@ void Run2dDriver(void)
} // namespace reduce_custom_fp32
using namespace reduce_custom_fp32;

TEST_P(ConfigWithFloat_reduce_custom_fp32, FloatTest_reduce_custom_fp32) { Run2dDriver(); };
TEST_P(GPU_reduce_custom_fp32_FP32, FloatTest_reduce_custom_fp32) { Run2dDriver(); };

INSTANTIATE_TEST_SUITE_P(ReduceCustomFp32,
ConfigWithFloat_reduce_custom_fp32,
testing::Values(GetTestCases()));
INSTANTIATE_TEST_SUITE_P(Full, GPU_reduce_custom_fp32_FP32, testing::Values(GetTestCases()));
22 changes: 10 additions & 12 deletions test/gtest/reduce_custom_fp32_fp16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,11 @@ std::vector<std::string> GetTestCases(const std::string& precision)
// clang-format on
}

class ConfigWithFloat_reduce_custom_fp32_fp16
: public testing::TestWithParam<std::vector<std::string>>
class GPU_reduce_custom_fp32_fp16_FP32 : public testing::TestWithParam<std::vector<std::string>>
{
};

class ConfigWithHalf_reduce_custom_fp32_fp16
: public testing::TestWithParam<std::vector<std::string>>
class GPU_reduce_custom_fp32_fp16_FP16 : public testing::TestWithParam<std::vector<std::string>>
{
};

Expand All @@ -95,8 +93,8 @@ void Run2dDriver(miopenDataType_t prec)
std::vector<std::string> params;
switch(prec)
{
case miopenFloat: params = ConfigWithFloat_reduce_custom_fp32_fp16::GetParam(); break;
case miopenHalf: params = ConfigWithHalf_reduce_custom_fp32_fp16::GetParam(); break;
case miopenFloat: params = GPU_reduce_custom_fp32_fp16_FP32::GetParam(); break;
case miopenHalf: params = GPU_reduce_custom_fp32_fp16_FP16::GetParam(); break;
case miopenInt8:
case miopenBFloat16:
case miopenInt32:
Expand Down Expand Up @@ -128,7 +126,7 @@ void Run2dDriver(miopenDataType_t prec)
} // namespace reduce_custom_fp32_fp16
using namespace reduce_custom_fp32_fp16;

TEST_P(ConfigWithFloat_reduce_custom_fp32_fp16, FloatTest_reduce_custom_fp32_fp16)
TEST_P(GPU_reduce_custom_fp32_fp16_FP32, FloatTest_reduce_custom_fp32_fp16)
{
if(!(IsTestSupportedForDevice() //
&& (!MIOPEN_TEST_ALL // standalone run
Expand All @@ -141,7 +139,7 @@ TEST_P(ConfigWithFloat_reduce_custom_fp32_fp16, FloatTest_reduce_custom_fp32_fp1
Run2dDriver(miopenFloat);
};

TEST_P(ConfigWithHalf_reduce_custom_fp32_fp16, HalfTest_reduce_custom_fp32_fp16)
TEST_P(GPU_reduce_custom_fp32_fp16_FP16, HalfTest_reduce_custom_fp32_fp16)
{
if(!(IsTestSupportedForDevice() //
&& (!MIOPEN_TEST_ALL // standalone run
Expand All @@ -154,10 +152,10 @@ TEST_P(ConfigWithHalf_reduce_custom_fp32_fp16, HalfTest_reduce_custom_fp32_fp16)
Run2dDriver(miopenHalf);
};

INSTANTIATE_TEST_SUITE_P(ReduceCustomFp32,
ConfigWithFloat_reduce_custom_fp32_fp16,
INSTANTIATE_TEST_SUITE_P(Full,
GPU_reduce_custom_fp32_fp16_FP32,
testing::Values(GetTestCases("--float")));

INSTANTIATE_TEST_SUITE_P(ReduceCustomFp32,
ConfigWithHalf_reduce_custom_fp32_fp16,
INSTANTIATE_TEST_SUITE_P(Full,
GPU_reduce_custom_fp32_fp16_FP16,
testing::Values(GetTestCases("--half")));
Loading

0 comments on commit 185f33c

Please sign in to comment.