Skip to content

Commit

Permalink
resolve warnings, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cderb committed Dec 12, 2023
1 parent 532c75f commit 3e9d843
Show file tree
Hide file tree
Showing 27 changed files with 148 additions and 233 deletions.
13 changes: 0 additions & 13 deletions test/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ endforeach()



#function(add_gtest TEST_NAME)
if( NOT (TEST_NAME IN_LIST SKIP_TESTS))
message("Adding miopen_gtest: " ${TESTS_CPP})
add_executable(miopen_gtest ${TESTS_CPP} ${SOURCES})
Expand All @@ -56,15 +55,3 @@ if( NOT (TEST_NAME IN_LIST SKIP_TESTS))
gtest_discover_tests(miopen_gtest PROPERTIES ENVIRONMENT "MIOPEN_USER_DB_PATH=${CMAKE_CURRENT_BINARY_DIR};MIOPEN_TEST_FLOAT_ARG=${MIOPEN_TEST_FLOAT_ARG};MIOPEN_TEST_ALL=${MIOPEN_TEST_ALL};MIOPEN_TEST_MLIR=${MIOPEN_TEST_MLIR};MIOPEN_TEST_COMPOSABLEKERNEL=${MIOPEN_TEST_COMPOSABLEKERNEL}")

endif()
#endfunction()

#file(GLOB TESTS *.cpp)
## Remove files that do not contain tests
#foreach(SOURCE ${SOURCES})
# list(REMOVE_ITEM TESTS ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE})
#endforeach()
#
#foreach(TEST ${TESTS})
# get_filename_component(BASE_NAME ${TEST} NAME_WE)
# add_gtest(${BASE_NAME})
#endforeach()
2 changes: 1 addition & 1 deletion test/gtest/bad_fusion_plan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,4 @@ TEST(TestFusionPlan, UnSupportedFusionPlanDuringSearchMode)

#endif

} //namespace bad_fusion_plan
} // namespace bad_fusion_plan
64 changes: 0 additions & 64 deletions test/gtest/bn_test_data.cpp

This file was deleted.

41 changes: 39 additions & 2 deletions test/gtest/bn_test_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,45 @@ struct BNTestCase
std::vector<size_t> GetInput() const { return {N, C, H, W}; }
};

template<typename T>
extern std::vector<T> Network1();
template <typename T>
std::vector<T> Network1();

template <>
inline std::vector<BNTestCase> Network1()
{
// pyt_mlperf_resnet50v1.5
return {
{192, 1, 8, 8, miopenBNSpatial, miopen::batchnorm::Direction::Backward, 1, 0},
{16, 8, 128, 256, miopenBNSpatial, miopen::batchnorm::Direction::ForwardTraining, 1, 0},
{16, 8, 128, 256, miopenBNSpatial, miopen::batchnorm::Direction::ForwardInference, 1, 0},
{64, 2048, 7, 7, miopenBNSpatial, miopen::batchnorm::Direction::Backward, 0, 1},
{64, 2048, 7, 7, miopenBNSpatial, miopen::batchnorm::Direction::ForwardTraining, 1, 1},
{64, 2048, 7, 7, miopenBNSpatial, miopen::batchnorm::Direction::ForwardInference, 1, 0},
{64, 256, 14, 14, miopenBNSpatial, miopen::batchnorm::Direction::Backward, 0, 1},
{64, 256, 14, 14, miopenBNSpatial, miopen::batchnorm::Direction::ForwardTraining, 1, 1},
{64, 256, 14, 14, miopenBNSpatial, miopen::batchnorm::Direction::ForwardInference, 1, 0},
{64, 256, 28, 28, miopenBNSpatial, miopen::batchnorm::Direction::Backward, 0, 1},
{64, 256, 28, 28, miopenBNSpatial, miopen::batchnorm::Direction::ForwardTraining, 1, 1},
{64, 256, 28, 28, miopenBNSpatial, miopen::batchnorm::Direction::ForwardInference, 1, 0},
{64, 256, 56, 56, miopenBNSpatial, miopen::batchnorm::Direction::Backward, 0, 1},
{64, 256, 56, 56, miopenBNSpatial, miopen::batchnorm::Direction::ForwardTraining, 1, 1},
{64, 256, 56, 56, miopenBNSpatial, miopen::batchnorm::Direction::ForwardInference, 1, 0},
{64, 512, 14, 14, miopenBNSpatial, miopen::batchnorm::Direction::Backward, 0, 1},
{64, 512, 14, 14, miopenBNSpatial, miopen::batchnorm::Direction::ForwardTraining, 1, 1},
{64, 512, 14, 14, miopenBNSpatial, miopen::batchnorm::Direction::ForwardInference, 1, 0},
{64, 512, 28, 28, miopenBNSpatial, miopen::batchnorm::Direction::Backward, 0, 1},
{64, 512, 28, 28, miopenBNSpatial, miopen::batchnorm::Direction::ForwardTraining, 1, 1},
{64, 512, 28, 28, miopenBNSpatial, miopen::batchnorm::Direction::ForwardInference, 1, 0},
{64, 512, 7, 7, miopenBNSpatial, miopen::batchnorm::Direction::Backward, 0, 1},
{64, 512, 7, 7, miopenBNSpatial, miopen::batchnorm::Direction::ForwardTraining, 1, 1},
{64, 512, 7, 7, miopenBNSpatial, miopen::batchnorm::Direction::ForwardInference, 1, 0},
{64, 64, 112, 112, miopenBNSpatial, miopen::batchnorm::Direction::Backward, 0, 1},
{64, 64, 112, 112, miopenBNSpatial, miopen::batchnorm::Direction::ForwardTraining, 1, 1},
{64, 64, 112, 112, miopenBNSpatial, miopen::batchnorm::Direction::ForwardInference, 1, 0},
{64, 64, 56, 56, miopenBNSpatial, miopen::batchnorm::Direction::Backward, 0, 1},
{64, 64, 56, 56, miopenBNSpatial, miopen::batchnorm::Direction::ForwardTraining, 1, 1},
{64, 64, 56, 56, miopenBNSpatial, miopen::batchnorm::Direction::ForwardInference, 1, 0}};
}

template <typename XDataType, typename YDataType, typename TConfig>
struct BNTestData
Expand Down
13 changes: 7 additions & 6 deletions test/gtest/cba_find2_infer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,12 @@ TEST_P(ConvBiasActivFind2InferTestFloatFusionFind, ConvBiasActivFind2Float_testF
}
}

INSTANTIATE_TEST_SUITE_P(CBAFind2InferSolverTest,
ConvBiasActivFind2InferTestFloatFusionFind,
testing::Combine(testing::Values(miopenActivationRELU),
testing::ValuesIn(GetNetworkForFusionCompileStepTest<ConvTestCaseBase>()),
testing::Values(miopenTensorNCHW)));
INSTANTIATE_TEST_SUITE_P(
CBAFind2InferSolverTest,
ConvBiasActivFind2InferTestFloatFusionFind,
testing::Combine(testing::Values(miopenActivationRELU),
testing::ValuesIn(GetNetworkForFusionCompileStepTest<ConvTestCaseBase>()),
testing::Values(miopenTensorNCHW)));

#endif

Expand All @@ -175,4 +176,4 @@ INSTANTIATE_TEST_SUITE_P(CBAFind2InferSolverTest,
testing::ValuesIn(GetNetwork1<ConvTestCaseBase>()),
testing::Values(miopenTensorNHWC)));

} //namespace cba_find2_infer
} // namespace cba_find2_infer
13 changes: 7 additions & 6 deletions test/gtest/cba_infer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,12 @@ TEST_P(ConvBiasActivInferTestFloatFusionCompileStep, ConvBiasActivAsm1x1UFloat_t
fusePlanDesc, plan_params, conv_config, test_skipped);
}

INSTANTIATE_TEST_SUITE_P(CBAInferSolverTest,
ConvBiasActivInferTestFloatFusionCompileStep,
testing::Combine(testing::Values(miopenActivationRELU),
testing::ValuesIn(GetNetworkForFusionCompileStepTest<ConvTestCaseBase>()),
testing::Values(miopenTensorNCHW)));
INSTANTIATE_TEST_SUITE_P(
CBAInferSolverTest,
ConvBiasActivInferTestFloatFusionCompileStep,
testing::Combine(testing::Values(miopenActivationRELU),
testing::ValuesIn(GetNetworkForFusionCompileStepTest<ConvTestCaseBase>()),
testing::Values(miopenTensorNCHW)));

#endif

Expand All @@ -180,4 +181,4 @@ INSTANTIATE_TEST_SUITE_P(CBAInferSolverTest,
testing::ValuesIn(GetNetwork1<ConvTestCaseBase>()),
testing::Values(miopenTensorNHWC)));

} //namespace cba_infer
} // namespace cba_infer
6 changes: 4 additions & 2 deletions test/gtest/conv_embed_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,13 @@ std::vector<std::string> GetTestCases(const std::string& precision)
return test_cases;
}

INSTANTIATE_TEST_SUITE_P(ConvEmbedDB, ConvEmbedConfigFloat, testing::Values(GetTestCases("--float")));
INSTANTIATE_TEST_SUITE_P(ConvEmbedDB,
ConvEmbedConfigFloat,
testing::Values(GetTestCases("--float")));
INSTANTIATE_TEST_SUITE_P(ConvEmbedDB, ConvEmbedConfigHalf, testing::Values(GetTestCases("--half")));
INSTANTIATE_TEST_SUITE_P(ConvEmbedDB, ConvEmbedConfigInt8, testing::Values(GetTestCases("--int8")));
INSTANTIATE_TEST_SUITE_P(ConvEmbedDB,
ConvEmbedConfigBFloat16,
testing::Values(GetTestCases("--bfloat16")));

} //namespace conv_embed_db
} // namespace conv_embed_db
2 changes: 1 addition & 1 deletion test/gtest/conv_f8_bwd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,4 @@ INSTANTIATE_TEST_SUITE_P(ConvBwdTest,
testing::ValuesIn(ConvTestConfigs()),
testing::Values(miopenTensorNDHWC)));

} //namespace conv_f8_bwd
} // namespace conv_f8_bwd
2 changes: 1 addition & 1 deletion test/gtest/conv_f8_fwd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,4 @@ INSTANTIATE_TEST_SUITE_P(ConvFwdTest,
testing::ValuesIn(ConvTestConfigs()),
testing::Values(miopenTensorNDHWC)));

} //namespace conv_f8_fwd
} // namespace conv_f8_fwd
2 changes: 1 addition & 1 deletion test/gtest/conv_f8_wrw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,4 @@ INSTANTIATE_TEST_SUITE_P(
testing::ValuesIn(ConvTestConfigs()),
testing::Values(miopenTensorNDHWC)));

} //namespace conv_f8_wrw
} // namespace conv_f8_wrw
2 changes: 1 addition & 1 deletion test/gtest/conv_hip_igemm_xdlops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,4 @@ INSTANTIATE_TEST_SUITE_P(ConvHipIgemmXdlops,
ConvHipIgemmXdlopsConfigInt8,
testing::Values(GetTestCases("--int8")));

} //namespace conv_hip_igem_xdlops
} // namespace conv_hip_igem_xdlops
2 changes: 1 addition & 1 deletion test/gtest/conv_igemm_dynamic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,4 @@ std::vector<TestCase> GetTestCases(const std::string& precision)

INSTANTIATE_TEST_SUITE_P(ConvIgemmDynamic, Conv2dFloat, testing::Values(GetTestCases("--float")));

} //namespace conv_igemm_dynamic
} // namespace conv_igemm_dynamic
14 changes: 10 additions & 4 deletions test/gtest/conv_igemm_mlir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,16 @@ std::vector<TestCase> GetTestCases(const std::string& precision)
return test_cases;
}
// Float for FWD, BWD, WRW
INSTANTIATE_TEST_SUITE_P(ConvIgemmMlir, ConvIgemmMlirConfigFloat, testing::Values(GetTestCases("--float")));
INSTANTIATE_TEST_SUITE_P(ConvIgemmMlir,
ConvIgemmMlirConfigFloat,
testing::Values(GetTestCases("--float")));
// Half for FWD, BWD, WRW
INSTANTIATE_TEST_SUITE_P(ConvIgemmMlir, ConvIgemmMlirConfigHalf, testing::Values(GetTestCases("--half")));
INSTANTIATE_TEST_SUITE_P(ConvIgemmMlir,
ConvIgemmMlirConfigHalf,
testing::Values(GetTestCases("--half")));
// Int8 for FWD
INSTANTIATE_TEST_SUITE_P(ConvIgemmMlir, ConvIgemmMlirConfigInt8, testing::Values(GetTestCases("--int8")));
INSTANTIATE_TEST_SUITE_P(ConvIgemmMlir,
ConvIgemmMlirConfigInt8,
testing::Values(GetTestCases("--int8")));

} //namespace conv_igemm_mlir
} // namespace conv_igemm_mlir
2 changes: 1 addition & 1 deletion test/gtest/conv_igemm_mlir_xdlops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,4 @@ INSTANTIATE_TEST_SUITE_P(ConvIgemmMlirXdlops,
ConvIgemmMlirXdlopsConfigInt8,
testing::Values(GetTestCases("--int8")));

} //namespace conv_igemm_mlir_xdlops
} // namespace conv_igemm_mlir_xdlops
72 changes: 0 additions & 72 deletions test/gtest/conv_test_base.cpp

This file was deleted.

Loading

0 comments on commit 3e9d843

Please sign in to comment.