MCPcopy Create free account
hub / github.com/Xilinx/CHaiDNN / getPerfInfo

Function getPerfInfo

software/interface/xi_interface.cpp:185–311  ·  view source on GitHub ↗

Display Custom layer latency breakup

Source from the content-addressed store, hash-verified

183
184//# Display Custom layer latency breakup
185void getPerfInfo(void *handle)
186{
187 if(handle == NULL)
188 {
189 fprintf(stderr, "Failed to read handle\n");
190 }
191
192 chaihandle_t *chaihandle_info = (chaihandle*)handle;
193 std::vector<xChangeLayer> *hwQueue = chaihandle_info->JobQueue;
194
195 //# Number of layers to be scheduled
196 uint16_t totalLayers = hwQueue[0].size();
197
198 //# Number of layers to be scheduled
199 // uint16_t totalLayers = hwQueue[0].size();
200 if(totalLayers <= 0)
201 {
202 std::cerr << "\n[ERROR] Invalid Queue size !" << std::endl;
203 return;
204 }
205 else
206 {
207#if ENABLE_ERROR_CHECKS
208 std::cerr << "\n[INFOx] Total Layers : " << totalLayers << std::endl << std::endl;
209#endif
210 }
211
212 long long int clock_start, clock_end, frequency;
213
214#ifdef __SDSOC
215 frequency = sds_clock_frequency();
216#endif
217
218 long long strat_clock = 0, end_clock = 0;
219 double tot_time, cust_lat_acc = 0.0, pack_lat_acc = 0.0, unpack_lat_acc = 0.0;
220 double acc = 0.0;
221
222 std::vector<int> xcustomSeq;
223
224 //# Initialize layer-wise sequence
225 for(uint16_t idx = 0; idx < totalLayers; ++idx)
226 {
227 kernel_type_e layerType = hwQueue[0][idx].kernType;
228 switch (layerType)
229 {
230 case XCUSTOM: xcustomSeq.push_back(idx); break;
231 }
232 }
233
234 uint16_t txCustomLayers = xcustomSeq.size();
235 fprintf(stderr, "[INFOx] Total Number of Custom layers : %d\n\n", txCustomLayers);
236
237 short last_cust_idx = xcustomSeq[txCustomLayers-1];
238
239 //# Flag used to accumulate pack/unpack layers used for custom layers
240 bool accu_flag = true;
241
242 //# loop through Num of images

Callers 1

mainFunction · 0.85

Calls 3

sizeMethod · 0.45
push_backMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected