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

Function initialize

hls_smartInfinity/src/kernel_cpp/g16_adam.cpp:27–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25typedef hls::vector<half, D_VEC_SIZE> hvec; // 256 bits
26
27static void initialize( half* grad16, uint n_elements )
28{
29 half z = 0.0f;
30
31 uint iteration = n_elements / VEC_SIZE;
32 vadd_pipeline: for (uint i = 0 ; i < iteration ; i += DATA_SIZE)
33 {
34 uint size = DATA_SIZE;
35 //boundary check
36 if (i + size > iteration) size = iteration - i;
37
38 init_grad: for ( uint x = 0; x < size; ++x)
39 {
40 #pragma HLS PIPELINE II=1
41 for (uint y = 0 ; y < VEC_SIZE; ++y){
42 grad16[(i+x) * VEC_SIZE + y] = z;
43 }
44 }
45 }
46}
47
48void decompressor( uint* grad_idx, half* grad_val, uint n_elements_compressed, half* grad16 )
49{

Callers 1

g16_adam.cppFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected