MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / initialize

Function initialize

hls_smartInfinity/src/kernel_cpp/adagrad_topk.cpp:29–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27typedef hls::vector<half, D_VEC_SIZE> dhvec; // 256 bits
28
29static 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
53void decompressor( ivec* grad_idx, hvec* grad_val, uint n_elements_compressed, half* grad16 )
54{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected