-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gtest] Combine gtests into single binary. #2599
Changes from all commits
faac072
ad3e487
645e289
f094cc9
85e64f8
47ee6e0
457d265
3dc71ef
c3229b8
532c75f
3e9d843
9c45745
1f87519
89f4782
b0d705d
f529d95
0f54296
a6cbc3b
c67f69e
8ac0916
f68938d
d912f17
7711895
d13348e
48a16ba
ce6a22c
aeaa83f
9b8cfa4
eb3812c
1e7c6fc
6d4e0e5
5c88612
ed002f5
7132297
a13243f
fed0b7c
b2eeb23
a719d15
cfdd95c
996e342
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,12 +23,13 @@ | |
* SOFTWARE. | ||
* | ||
*******************************************************************************/ | ||
#include <gtest/gtest.h> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ⚓ |
||
#include "conv_common.hpp" | ||
|
||
template <class T> | ||
struct conv3d_driver : conv_driver<T, ConvApi::Immediate> | ||
struct conv3d_driver : conv_driver<T> | ||
{ | ||
conv3d_driver() : conv_driver<T, ConvApi::Immediate>() | ||
conv3d_driver() : conv_driver<T>() | ||
{ | ||
this->add(this->input_dims, "input"); | ||
this->add(this->weight_tensor_dims, "weights"); | ||
|
@@ -37,16 +38,16 @@ struct conv3d_driver : conv_driver<T, ConvApi::Immediate> | |
this->generate_data_limited(this->get_batch_sizes(), 1, {8})); | ||
this->add(this->input_channels, | ||
"input_channels", | ||
this->generate_data_limited(this->get_input_channels(), 1, {2})); | ||
this->generate_data_limited(this->get_input_channels(), 1, {32})); | ||
this->add(this->output_channels, | ||
"output_channels", | ||
this->generate_data_limited(this->get_output_channels(), 1, {16})); | ||
this->generate_data_limited(this->get_output_channels(), 1, {32})); | ||
this->add(this->spatial_dim_elements, | ||
"spatial_dim_elements", | ||
this->generate_data_limited(this->get_3d_spatial_dims(), 1, {16, 16, 16})); | ||
this->add(this->filter_dims, | ||
"filter_dims", | ||
this->generate_data_limited(this->get_3d_filter_dims(), 2, {5, 5, 5})); | ||
this->generate_data_limited(this->get_3d_filter_dims(), 2, {3, 3, 3})); | ||
this->add(this->pads_strides_dilations, | ||
"pads_strides_dilations", | ||
this->generate_data_limited(this->get_3d_pads_strides_dilations(), 2)); | ||
|
@@ -59,4 +60,18 @@ struct conv3d_driver : conv_driver<T, ConvApi::Immediate> | |
} | ||
}; | ||
|
||
int main(int argc, const char* argv[]) { test_drive<conv3d_driver>(argc, argv); } | ||
class Conv3dFloat : public testing::TestWithParam<std::vector<std::string>> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are all these class definitions exactly the same? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are ostensibly configuration definitions split by precision. Though in this instance their data is defined entirely by the test fetching function and as such have no defined members at this level. It's conceivable that they could be summarized into a single class. |
||
{ | ||
}; | ||
|
||
class Conv3dHalf : public testing::TestWithParam<std::vector<std::string>> | ||
{ | ||
}; | ||
|
||
class Conv3dBFloat16 : public testing::TestWithParam<std::vector<std::string>> | ||
{ | ||
}; | ||
|
||
class Conv3dInt8 : public testing::TestWithParam<std::vector<std::string>> | ||
{ | ||
}; | ||
Comment on lines
+67
to
+77
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These definitions are used by gtests only and should reside in gtest/*.cpp files within respective namespaces. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renaming of .cpp to .hpp silently removes
test_*
executable, and, consequently,test_* --all
from full tests etc.