-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Add CombineAs<R>()
parameters generator
#4727
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
@derekmauro As soon as I understand you are the one of maintainers. Can you please review this feature and help to bring it faster to the release? We really need it in GROMACS. |
Rebased onto main and adapted to use the new version of ConvertGenerator |
@zhanyongwan @derekmauro Hello! Please take a look at this feature. We really need it in GROMACS. |
Hi @Stoorx , I'm not an owner of this project. Let me talk to Derek about this. Meanwhile, I suppose you can have a local workaround by defining this in your own code? Thanks. |
Hello! Thank you so much!
Yes, we can use the struct KernelInputParameters
{
using TupleT = std::tuple<Nbnxm::KernelType, CoulombKernelType, int>;
//! The kernel type and cluster pair layout
Nbnxm::KernelType kernelType;
//! The Coulomb kernel type
CoulombKernelType coulombKernelType;
//! The VdW interaction type
int vdwKernelType;
KernelInputParameters(TupleT t) :
kernelType(std::get<0>(t)), coulombKernelType(std::get<1>(t)), vdwKernelType(std::get<2>(t))
{
}
}; This pull request proposes the Thank you! |
I believe this is from GCC14 building in C++20 mode:
|
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.
Thanks!
I have no idea how to fix it. It seems to me that the code is valid and should not fail. Can you give me some advise? |
CombineTo<R>()
parameters generatorCombineAs<R>()
parameters generator
I can not see the CI build logs since it refers to some internal domain 'fusion2'. Maybe you could provide some instructions to reproduce it locally or give me the full log? |
|
||
static_assert(std::is_copy_constructible_v<CopyConstructible>); | ||
ParamGenerator<CopyConstructible> gen = testing::CombineAs<CopyConstructible>( | ||
Values(CopyConstructible{0, "A"}, CopyConstructible{1, "B"})); |
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.
This syntax is invalid as CopyConstructible
has a user-defined ctor. It must be constructed using a constructor as CopyConstructible(...)
instead of CopyConstructible{...}
.
Please define a CopyConstructible(int, std::string)
ctor to be used this.
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.
Done. Please check
…pe transformations
`CombineAs<R>()` allows to construct the required type directly from combined arguments. As it would be a composition of `ConvertGenerator()` and `Combine()`, but without `std::tuple` in between.
Hello! Are there any updates for this PR? Can you please take a look at it? @zhanyong-wan |
Hi Stoorx, I'm not an owner of the repo and don't have the power to approve PRs. We'll need @derekmauro to do the final review. Thanks. |
CombineTo()
allows the user to combine two or more sequences to produce values of a Cartesian product of those sequences' elements converted to the required type. The behavior of this function is the same as already implemented and well-knownCombine()
.CombineTo()
allows to use struct-parametrized tests directly instead of dealing with tuples. Maybe the better naming for this function isCombineAs()
The behavior of other functions have not been changed (according to the tests passing). The additional basic test cases are provided for this feature. Feel free to give me some ideas to make better coverage.
Dear maintainers, please note, this feature is very necessary in GROMACS project and we want it as soon as possible. I see that 1.16.0 has been released. Maybe it is possible to make the new release faster and include this feature in the upcoming release somehow? Or maybe backport it as 1.16.1 too?