| 27 | typedef hls::vector<half, D_VEC_SIZE> dhvec; // 256 bits |
| 28 | |
| 29 | static void initialize( half* grad16, uint n_elements ) |
| 30 | { |
| 31 | hvec z = 0.0f; |
| 32 | |
| 33 | uint iteration = n_elements / VEC_SIZE; |
| 34 | vadd_pipeline: for (uint i = 0 ; i < iteration ; i += DATA_SIZE) |
| 35 | { |
| 36 | #pragma HLS PIPELINE rewind |
| 37 | uint size = DATA_SIZE; |
| 38 | //boundary check |
| 39 | if (i + size > iteration) size = iteration - i; |
| 40 | |
| 41 | init_grad: for ( uint x = 0; x < size; ++x) |
| 42 | { |
| 43 | #pragma HLS PIPELINE II=1 |
| 44 | for (uint y = 0 ; y < VEC_SIZE; ++y) |
| 45 | { |
| 46 | #pragma HLS UNROLL |
| 47 | grad16[(i+x) * VEC_SIZE + y] = z[y]; |
| 48 | } |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | void decompressor( ivec* grad_idx, hvec* grad_val, uint n_elements_compressed, half* grad16 ) |
| 54 | { |
nothing calls this directly
no outgoing calls
no test coverage detected