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

Function initialize

hls_smartInfinity/src/kernel_cpp/adam_topk.cpp:29–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28
29static void initialize( float* grad, uint n_elements )
30{
31 vec 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 uint ix = (i + x)* VEC_SIZE;
44 #pragma HLS PIPELINE II=1
45 inner_init_grad:for (uint y = 0 ; y < VEC_SIZE; ++y)
46 {
47 #pragma HLS UNROLL
48 grad[ ix + y] = z[y];
49 }
50 }
51 }
52}
53
54void decompressor( ivec* grad_idx, vec* grad_val, uint n_elements_compressed, float* grad )
55{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected