Skip to content
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

Use variadic template for basket extensions #85

Merged
merged 4 commits into from
Oct 3, 2023

Conversation

azaleostu
Copy link
Contributor

This PR changes the hard-coded extension list for the Basket and BasketDiff types to a variadic list.

@azaleostu azaleostu marked this pull request as ready for review June 5, 2023 15:08
@nmellado nmellado force-pushed the variadic-basket branch 2 times, most recently from d4ea82d to 7284bd2 Compare June 9, 2023 15:34
@nmellado
Copy link
Contributor

nmellado commented Aug 3, 2023

@ThibaultLejemble could you check if this works with CUDA ?

@ThibaultLejemble
Copy link
Collaborator

@ThibaultLejemble could you check if this works with CUDA ?

I compiled and ran the Cuda example with this new basket and it works fine!
There was a compilation issue but not related to this PR (see #109).

template <class, class, typename T> class Forward: public T {};
template <class P, class W,
template <class, class, typename> class... Exts>
struct BasketAggregate : BasketAggregateImpl<P, W, PrimitiveBase<P, W>, Exts...>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this intermediate struct since the class Basket could just inherits directly from internal::BasketAggregateImpl<P, W, PrimitiveBase<P, W>, Exts...>::type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose to hide the PrimitiveBase<P, W> part from the Basket class definition as I thought it could be considered an implementation detail, but it is true that what you mentioned is equivalent (I also thought it made the Basket class a bit more readable)

template <class P, class W, int Type,
template <class, class, typename> class Ext0,
template <class, class, typename> class... Exts>
class BasketAutoDiff : public internal::BasketAutoDiffAggregate<P, W, Type, Ext0, Exts...>::type
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the AutoDiff feature in draft or can we review it?
Maybe we can move the AutoDiff feature in another PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added as a followup to #106. The aggregate part should be ready for review, but I don't know what the functionality of the class is going to be yet, so I can remove this from this PR for now, if necessary.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@azaleostu could you remove the autodiff version so we can merge this refactoring, and then add autodiff in another PR (with appropriate testing)

Copy link
Contributor

@nmellado nmellado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the proposal.
Please

  • move autodiff out of the proposal
  • rebase on master
  • update changelog (I can do it if you prefer)

Copy link
Contributor

@nmellado nmellado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there, thx

CHANGELOG Outdated
@@ -31,6 +31,7 @@ improved doc, as well as several bug fixes and API improvements.
- [fitting] Fix a bug in dtau computation for scale-only derivation (#98)
- [fitting] Fix a bug in MlsSphereFitDer weight derivatives (#97)
- [ci] Fix Compiler is out of heap space error on Github (MSVC), by splitting tests (#87)
- [fitting] Use variadic template for basket extensions (#85)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this to line 10

@nmellado nmellado merged commit 2e948d6 into poncateam:master Oct 3, 2023
ThibaultLejemble pushed a commit to ThibaultLejemble/ponca that referenced this pull request Jan 11, 2024
* Use variadic template for basket extensions
* Update Changelog

---------

Co-authored-by: Amael Marquez <[email protected]>
Co-authored-by: mazestic <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants