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

[DF] Jitted Min method breaks with RVec columns #6435

Closed
eguiraud opened this issue Sep 24, 2020 · 0 comments · Fixed by #6436 or #6437
Closed

[DF] Jitted Min method breaks with RVec columns #6435

eguiraud opened this issue Sep 24, 2020 · 0 comments · Fixed by #6436 or #6437

Comments

@eguiraud
Copy link
Member

Describe the bug

Jitted Min calls break with RVec columns, although they work fine with scalars and if the RVec type is passed explicitly as a template parameter. Max is not affected.

To Reproduce

#include <ROOT/RDataFrame.hxx>                                                                                          
#include <ROOT/RVec.hxx>                                                                                                
                                                                                                                        
int main() {                                                                                                            
   auto df = ROOT::RDataFrame(1).Define("x", [] { return ROOT::RVec<float>{1,2,3}; });                                  
   df.Max<ROOT::RVec<float>>("x").GetValue();                                                                           
   df.Min<ROOT::RVec<float>>("x").GetValue();                                                                           
   df.Max("x").GetValue();                                                                                              
   df.Min("x").GetValue();     // this one breaks at runtime                                                                                         
   return 0;                                                                                                            
}   

Setup

ROOT 6.22.02

Additional context

First reported on the forum.

@eguiraud eguiraud added this to the 6.24/00 milestone Sep 24, 2020
@eguiraud eguiraud self-assigned this Sep 24, 2020
eguiraud added a commit to eguiraud/root that referenced this issue Sep 24, 2020
eguiraud added a commit to eguiraud/root that referenced this issue Sep 24, 2020
When the Min or Max actions are jitted, their result type is always
double, independently of the column type. If the column type happens
to be of a different type, std::min won't compile because template
parameter type deduction is ambiguous.
We now always explicitly cast the arguments of std::min to the desired
result type to avoid the ambiguity.

This fixes root-project#6435.
eguiraud added a commit to eguiraud/root that referenced this issue Sep 24, 2020
When the Min or Max actions are jitted, their result type is always
double, independently of the column type. If the column type happens
to be of a different type, std::min won't compile because template
parameter type deduction is ambiguous.
We now always explicitly cast the arguments of std::min to the desired
result type to avoid the ambiguity.

This fixes root-project#6435.
eguiraud added a commit that referenced this issue Sep 25, 2020
eguiraud added a commit that referenced this issue Sep 25, 2020
When the Min or Max actions are jitted, their result type is always
double, independently of the column type. If the column type happens
to be of a different type, std::min won't compile because template
parameter type deduction is ambiguous.
We now always explicitly cast the arguments of std::min to the desired
result type to avoid the ambiguity.

This fixes #6435.
@eguiraud eguiraud modified the milestones: 6.24/00, 6.22/04, 6.18/06 Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment