#include "xf_database/direct_group_aggregate.hpp"
template < int op, int DATINW, int DATOUTW, int DIRECTW > void directGroupAggregate ( hls::stream <ap_uint <DATINW>>& vin_strm, hls::stream <bool>& in_e_strm, hls::stream <ap_uint <DATOUTW>>& vout_strm, hls::stream <bool>& out_e_strm, hls::stream <ap_uint <DIRECTW>>& kin_strm, hls::stream <ap_uint <DIRECTW>>& kout_strm )
Group-by aggregation with limited key width.
This primitive is suitable for scenario in which the width of group key is limited, so that a on-chip array directly addressed by the key can be created to store the aggregation value. The total storage required is row size * (2 ^ key width) .
The following aggregate operators are supported:
- AOP_MAX
- AOP_MIN
- AOP_SUM
- AOP_COUNT
- AOP_MEAN
- AOP_VARIANCE
- AOP_NORML1
- AOP_NORML2
The return value is typed the same as the input payload value.
Caution
Attention should be paid for overflow in sum or count.
Parameters:
| op | the aggregate operator, as defined in AggregateOp enum. |
| DATINW | the width of input payload |
| DATOUTW | the width of output aggr-payload |
| DIRECTW | the width of input and output key |
| vin_strm | value input |
| in_e_strm | end flag stream for input data |
| vout_strm | value output |
| out_e_strm | end flag stream for output data |
| kin_strm | group-by key input |
| kout_strm | group-by key output |