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

Function decompressor

hls_smartInfinity/src/kernel_cpp/adagrad_topk.cpp:53–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void decompressor( ivec* grad_idx, hvec* grad_val, uint n_elements_compressed, half* grad16 )
54{
55 ivec g_idx[DATA_SIZE];
56 hvec g_val[DATA_SIZE];
57
58 uint iteration = n_elements_compressed / VEC_SIZE;
59
60 decompressor : for ( uint i = 0 ; i < iteration ; i+= DATA_SIZE )
61 {
62 #pragma HLS PIPELINE rewind
63 uint size = DATA_SIZE;
64 //boundary check
65 if (i + size > iteration) size = iteration - i;
66
67 read_grad_idx: for (uint x = 0 ; x < size; ++x)
68 {
69 #pragma HLS PIPELINE II=1
70 g_idx[x] = grad_idx[i + x];
71 }
72 read_grad_val: for (uint x = 0 ; x < size ; ++x)
73 {
74 #pragma HLS PIPELINE II=1
75 g_val[x] = grad_val[i + x];
76 }
77 write_grad: for (uint x = 0 ; x < size; ++x)
78 {
79 inner_write_grad: for (uint y = 0 ; y < VEC_SIZE; ++y)
80 {
81 #pragma HLS PIPELINE II=1
82 grad16[ g_idx[x][y] ] = g_val[x][y];
83 }
84 }
85 }
86}
87
88
89void adagrad ( half* grad16, dhvec* param16, vec* param, vec* exp_avg_sq, uint n_elements,

Callers 1

adagrad_topk.cppFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected