Repository navigation
Replies: 4 comments
|
I have no strong preference of where histogram should be placed as you mention there are reasons to have it in each of I don't see a problem to adding it to I realize I haven't added much to the conversation, but I don't have a strong opinion here for the outcome, other than if we do add / move it to numeric, we need to change the specification. |
True, we are not obligated. However, it makes sense to consider the spirit of the standard. At least from my perspective,
Yes, I would remove it eventually if it's removed from the spec. It's not a problem to keep in the implementation, but it would be kind of an (undocumented?) extension to the spec, and I prefer to avoid extensions unless it's really a well-thought decision of not adding a feature to the specification. |
|
The specification update uxlfoundation/oneAPI-spec#657 proposes defining these algorithms in |
Uh oh!
There was an error while loading. Please reload this page.
Currently, all non-standard algorithms of oneDPL are defined in the
<oneapi/dpl/algorithm>header. This is also described in the specification:However some algorithms, namely,
{inclusive,exclusive}_scan_by_segment,reduce_by_segment, andhistogram, might better be defined in<oneapi/dpl/numeric>instead. The segmented algorithms would then reside in the same header as their non-segmented standard "ancestors". And histogram is currently defined to operate only with arithmetic types, so it is effectively a numeric algorithm.The obvious downside is that this change would break existing codes that include only
<...algorithm>but not<...numeric>. Perhaps the implementation would need to provide the definitions through both headers during a deprecation period. Not sure if the major version bump would be necessary for such a change.Another concern is specific for
histogramwhich, in principle, can be extended to non-numeric types with an extra overload taking a predicate for comparison with interval boundaries or a function to compute bin indexes for the input values. Such algorithms might also be considered as additions to thecountfamily and reside in<...algorithm>.Tagging @danhoeflinger @MikeDvorskiy
All reactions