Skip to content

Commit 67f0cb3

Browse files
authored
[Bugfix] Restore Missing ctests (#2649)
1 parent 49f989f commit 67f0cb3

14 files changed

+265
-130
lines changed

test/conv3d.cpp

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* MIT License
44
*
5-
* Copyright (c) 2019 Advanced Micro Devices, Inc.
5+
* Copyright (c) 2024 Advanced Micro Devices, Inc.
66
*
77
* Permission is hereby granted, free of charge, to any person obtaining a copy
88
* of this software and associated documentation files (the "Software"), to deal
@@ -23,40 +23,6 @@
2323
* SOFTWARE.
2424
*
2525
*******************************************************************************/
26-
#include "conv_common.hpp"
27-
28-
template <class T>
29-
struct conv3d_driver : conv_driver<T>
30-
{
31-
conv3d_driver() : conv_driver<T>()
32-
{
33-
this->add(this->input_dims, "input");
34-
this->add(this->weight_tensor_dims, "weights");
35-
this->add(this->batch_size,
36-
"batch_size",
37-
this->generate_data_limited(this->get_batch_sizes(), 1, {8}));
38-
this->add(this->input_channels,
39-
"input_channels",
40-
this->generate_data_limited(this->get_input_channels(), 1, {32}));
41-
this->add(this->output_channels,
42-
"output_channels",
43-
this->generate_data_limited(this->get_output_channels(), 1, {32}));
44-
this->add(this->spatial_dim_elements,
45-
"spatial_dim_elements",
46-
this->generate_data_limited(this->get_3d_spatial_dims(), 1, {16, 16, 16}));
47-
this->add(this->filter_dims,
48-
"filter_dims",
49-
this->generate_data_limited(this->get_3d_filter_dims(), 2, {3, 3, 3}));
50-
this->add(this->pads_strides_dilations,
51-
"pads_strides_dilations",
52-
this->generate_data_limited(this->get_3d_pads_strides_dilations(), 2));
53-
this->add(this->trans_output_pads,
54-
"trans_output_pads",
55-
this->generate_data_limited(this->get_3d_trans_output_pads(), 1));
56-
this->add(this->in_layout, "in_layout", this->generate_data({"NCDHW"}));
57-
this->add(this->fil_layout, "fil_layout", this->generate_data({"NCDHW"}));
58-
this->add(this->out_layout, "out_layout", this->generate_data({"NCDHW"}));
59-
}
60-
};
26+
#include "conv3d.hpp"
6127

6228
int main(int argc, const char* argv[]) { test_drive<conv3d_driver>(argc, argv); }

test/conv3d.hpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
* SOFTWARE.
2424
*
2525
*******************************************************************************/
26-
#include <gtest/gtest.h>
2726
#include "conv_common.hpp"
2827

2928
template <class T>
@@ -59,19 +58,3 @@ struct conv3d_driver : conv_driver<T>
5958
this->add(this->out_layout, "out_layout", this->generate_data({"NCDHW"}));
6059
}
6160
};
62-
63-
class Conv3dFloat : public testing::TestWithParam<std::vector<std::string>>
64-
{
65-
};
66-
67-
class Conv3dHalf : public testing::TestWithParam<std::vector<std::string>>
68-
{
69-
};
70-
71-
class Conv3dBFloat16 : public testing::TestWithParam<std::vector<std::string>>
72-
{
73-
};
74-
75-
class Conv3dInt8 : public testing::TestWithParam<std::vector<std::string>>
76-
{
77-
};

test/gtest/conv3d_codecov.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,22 @@ MIOPEN_DECLARE_ENV_VAR_STR(MIOPEN_TEST_FLAGS_ARGS)
3535

3636
namespace conv3d_codecov {
3737

38+
class Conv3dFloat : public testing::TestWithParam<std::vector<std::string>>
39+
{
40+
};
41+
42+
class Conv3dHalf : public testing::TestWithParam<std::vector<std::string>>
43+
{
44+
};
45+
46+
class Conv3dBFloat16 : public testing::TestWithParam<std::vector<std::string>>
47+
{
48+
};
49+
50+
class Conv3dInt8 : public testing::TestWithParam<std::vector<std::string>>
51+
{
52+
};
53+
3854
static bool SkipTest(void) { return !miopen::IsEnabled(ENV(CODECOV_TEST)); }
3955

4056
void GetArgs(const std::string& param, std::vector<std::string>& tokens)

test/gtest/immed_conv2d_codecov.cpp

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* MIT License
44
*
5-
* Copyright (c) 2023 Advanced Micro Devices, Inc.
5+
* Copyright (c) 2024 Advanced Micro Devices, Inc.
66
*
77
* Permission is hereby granted, free of charge, to any person obtaining a copy
88
* of this software and associated documentation files (the "Software"), to deal
@@ -29,45 +29,13 @@
2929
#include <gtest/gtest.h>
3030
#include "test_env.hpp"
3131

32+
#include "immed_conv2d.hpp"
33+
3234
MIOPEN_DECLARE_ENV_VAR_BOOL(CODECOV_TEST)
3335
MIOPEN_DECLARE_ENV_VAR_STR(MIOPEN_TEST_FLAGS_ARGS)
3436

3537
namespace immed_conv2d_codecov {
3638

37-
template <class T>
38-
struct conv2d_driver : conv_driver<T, ConvApi::Immediate>
39-
{
40-
conv2d_driver() : conv_driver<T, ConvApi::Immediate>()
41-
{
42-
this->add(this->input_dims, "input");
43-
this->add(this->weight_tensor_dims, "weights");
44-
this->add(this->batch_size,
45-
"batch_size",
46-
this->generate_data_limited(this->get_batch_sizes(), 1, {16}));
47-
this->add(this->input_channels,
48-
"input_channels",
49-
this->generate_data_limited(this->get_input_channels(), 1, {32}));
50-
this->add(this->output_channels,
51-
"output_channels",
52-
this->generate_data_limited(this->get_output_channels(), 1, {32}));
53-
this->add(this->spatial_dim_elements,
54-
"spatial_dim_elements",
55-
this->generate_data_limited(this->get_2d_spatial_dims(), 1, {56, 56}));
56-
this->add(this->filter_dims,
57-
"filter_dims",
58-
this->generate_data_limited(this->get_2d_filter_dims(), 2, {3, 3}));
59-
this->add(this->pads_strides_dilations,
60-
"pads_strides_dilations",
61-
this->generate_data_limited(this->get_2d_pads_strides_dilations(), 2));
62-
this->add(this->trans_output_pads,
63-
"trans_output_pads",
64-
this->generate_data_limited(this->get_2d_trans_output_pads(), 1));
65-
this->add(this->in_layout, "in_layout", this->generate_data({"NCHW"}));
66-
this->add(this->fil_layout, "fil_layout", this->generate_data({"NCHW"}));
67-
this->add(this->out_layout, "out_layout", this->generate_data({"NCHW"}));
68-
}
69-
};
70-
7139
static bool SkipTest(void) { return !miopen::IsEnabled(ENV(CODECOV_TEST)); }
7240

7341
void GetArgs(const std::string& param, std::vector<std::string>& tokens)

test/gtest/immed_conv3d_codecov.cpp

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* MIT License
44
*
5-
* Copyright (c) 2023 Advanced Micro Devices, Inc.
5+
* Copyright (c) 2024 Advanced Micro Devices, Inc.
66
*
77
* Permission is hereby granted, free of charge, to any person obtaining a copy
88
* of this software and associated documentation files (the "Software"), to deal
@@ -28,45 +28,27 @@
2828
#include "get_handle.hpp"
2929
#include "test_env.hpp"
3030

31-
#include "conv3d.hpp"
31+
#include "immed_conv3d.hpp"
3232

3333
MIOPEN_DECLARE_ENV_VAR_BOOL(CODECOV_TEST)
3434
MIOPEN_DECLARE_ENV_VAR_STR(MIOPEN_TEST_FLAGS_ARGS)
3535

3636
namespace immed_conv3d_codecov {
3737

38-
template <class T>
39-
struct conv3d_driver : conv_driver<T, ConvApi::Immediate>
38+
class Conv3dFloat : public testing::TestWithParam<std::vector<std::string>>
39+
{
40+
};
41+
42+
class Conv3dHalf : public testing::TestWithParam<std::vector<std::string>>
43+
{
44+
};
45+
46+
class Conv3dBFloat16 : public testing::TestWithParam<std::vector<std::string>>
47+
{
48+
};
49+
50+
class Conv3dInt8 : public testing::TestWithParam<std::vector<std::string>>
4051
{
41-
conv3d_driver() : conv_driver<T, ConvApi::Immediate>()
42-
{
43-
this->add(this->input_dims, "input");
44-
this->add(this->weight_tensor_dims, "weights");
45-
this->add(this->batch_size,
46-
"batch_size",
47-
this->generate_data_limited(this->get_batch_sizes(), 1, {8}));
48-
this->add(this->input_channels,
49-
"input_channels",
50-
this->generate_data_limited(this->get_input_channels(), 1, {2}));
51-
this->add(this->output_channels,
52-
"output_channels",
53-
this->generate_data_limited(this->get_output_channels(), 1, {16}));
54-
this->add(this->spatial_dim_elements,
55-
"spatial_dim_elements",
56-
this->generate_data_limited(this->get_3d_spatial_dims(), 1, {16, 16, 16}));
57-
this->add(this->filter_dims,
58-
"filter_dims",
59-
this->generate_data_limited(this->get_3d_filter_dims(), 2, {5, 5, 5}));
60-
this->add(this->pads_strides_dilations,
61-
"pads_strides_dilations",
62-
this->generate_data_limited(this->get_3d_pads_strides_dilations(), 2));
63-
this->add(this->trans_output_pads,
64-
"trans_output_pads",
65-
this->generate_data_limited(this->get_3d_trans_output_pads(), 1));
66-
this->add(this->in_layout, "in_layout", this->generate_data({"NCDHW"}));
67-
this->add(this->fil_layout, "fil_layout", this->generate_data({"NCDHW"}));
68-
this->add(this->out_layout, "out_layout", this->generate_data({"NCDHW"}));
69-
}
7052
};
7153

7254
static bool SkipTest(void) { return !miopen::IsEnabled(ENV(CODECOV_TEST)); }

test/gtest/pooling2d_asymmetric.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ MIOPEN_DECLARE_ENV_VAR_STR(MIOPEN_TEST_FLAGS_ARGS)
3636

3737
namespace pooling2d_asymmetric {
3838

39+
class Pooling2dFloat : public testing::TestWithParam<std::vector<std::string>>
40+
{
41+
};
42+
43+
class Pooling2dHalf : public testing::TestWithParam<std::vector<std::string>>
44+
{
45+
};
46+
3947
static bool SkipTest(void) { return miopen::IsDisabled(ENV(MIOPEN_TEST_ALL)); }
4048

4149
void GetArgs(const std::string& param, std::vector<std::string>& tokens)

test/gtest/pooling2d_codecov.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ MIOPEN_DECLARE_ENV_VAR_STR(MIOPEN_TEST_FLAGS_ARGS)
3636

3737
namespace pooling2d_codecov {
3838

39+
class Pooling2dFloat : public testing::TestWithParam<std::vector<std::string>>
40+
{
41+
};
42+
43+
class Pooling2dHalf : public testing::TestWithParam<std::vector<std::string>>
44+
{
45+
};
46+
3947
static bool SkipTest(void) { return !miopen::IsEnabled(ENV(CODECOV_TEST)); }
4048

4149
void GetArgs(const std::string& param, std::vector<std::string>& tokens)

test/gtest/pooling2d_wide.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ MIOPEN_DECLARE_ENV_VAR_STR(MIOPEN_TEST_FLAGS_ARGS)
3636

3737
namespace pooling2d_wide {
3838

39+
class Pooling2dFloat : public testing::TestWithParam<std::vector<std::string>>
40+
{
41+
};
42+
43+
class Pooling2dHalf : public testing::TestWithParam<std::vector<std::string>>
44+
{
45+
};
46+
3947
static bool SkipTest(void) { return miopen::IsDisabled(ENV(MIOPEN_TEST_ALL)); }
4048

4149
void GetArgs(const std::string& param, std::vector<std::string>& tokens)

test/immed_conv2d.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*******************************************************************************
2+
*
3+
* MIT License
4+
*
5+
* Copyright (c) 2024 Advanced Micro Devices, Inc.
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in all
15+
* copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
* SOFTWARE.
24+
*
25+
*******************************************************************************/
26+
#include "immed_conv2d.hpp"
27+
28+
int main(int argc, const char* argv[]) { test_drive<conv2d_driver>(argc, argv); }

test/immed_conv2d.hpp

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*******************************************************************************
2+
*
3+
* MIT License
4+
*
5+
* Copyright (c) 2024 Advanced Micro Devices, Inc.
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in all
15+
* copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
* SOFTWARE.
24+
*
25+
*******************************************************************************/
26+
#include "conv_common.hpp"
27+
28+
template <class T>
29+
struct conv2d_driver : conv_driver<T, ConvApi::Immediate>
30+
{
31+
conv2d_driver() : conv_driver<T, ConvApi::Immediate>()
32+
{
33+
this->add(this->input_dims, "input");
34+
this->add(this->weight_tensor_dims, "weights");
35+
this->add(this->batch_size,
36+
"batch_size",
37+
this->generate_data_limited(this->get_batch_sizes(), 1, {16}));
38+
this->add(this->input_channels,
39+
"input_channels",
40+
this->generate_data_limited(this->get_input_channels(), 1, {32}));
41+
this->add(this->output_channels,
42+
"output_channels",
43+
this->generate_data_limited(this->get_output_channels(), 1, {32}));
44+
this->add(this->spatial_dim_elements,
45+
"spatial_dim_elements",
46+
this->generate_data_limited(this->get_2d_spatial_dims(), 1, {56, 56}));
47+
this->add(this->filter_dims,
48+
"filter_dims",
49+
this->generate_data_limited(this->get_2d_filter_dims(), 2, {3, 3}));
50+
this->add(this->pads_strides_dilations,
51+
"pads_strides_dilations",
52+
this->generate_data_limited(this->get_2d_pads_strides_dilations(), 2));
53+
this->add(this->trans_output_pads,
54+
"trans_output_pads",
55+
this->generate_data_limited(this->get_2d_trans_output_pads(), 1));
56+
this->add(this->in_layout, "in_layout", this->generate_data({"NCHW"}));
57+
this->add(this->fil_layout, "fil_layout", this->generate_data({"NCHW"}));
58+
this->add(this->out_layout, "out_layout", this->generate_data({"NCHW"}));
59+
}
60+
};

0 commit comments

Comments
 (0)