void DeconvForwardWrapper(short* in1, short* in2, short* in3, short* weights, short* bias, int * out, int *scalars)
| 335 | void DeconvWrapper(short* deconvIN, short* deconvWT, short* deconvBias, unsigned long long int* deconvIDout, int *scalar_deconv_args); |
| 336 | //void DeconvForwardWrapper(short* in1, short* in2, short* in3, short* weights, short* bias, int * out, int *scalars) |
| 337 | void DeconvForward( |
| 338 | short* deconvIN1, short* deconvIN2, short* deconvIN3, |
| 339 | short* deconvWT, |
| 340 | short* deconvBias, int* deconvIDout, |
| 341 | int *scalar_deconv_args |
| 342 | ) |
| 343 | { |
| 344 | //# Re-arrage previous layer output for Deconv input |
| 345 | DeconvInReArrange((IO_DATA_TYPE *)deconvIN1, (IO_DATA_TYPE *)deconvIN2, deconvIN3, scalar_deconv_args[1], scalar_deconv_args[2], scalar_deconv_args[0]); |
| 346 | |
| 347 | /*FILE *fp = fopen("deconv_in.txt", "w"); |
| 348 | if(fp == NULL) |
| 349 | { |
| 350 | fprintf(stderr, "Failed to create file\n"); |
| 351 | } |
| 352 | for(int i = 0; i < 24*16*16; i++) |
| 353 | { |
| 354 | fprintf(fp, "%hd\n", deconvIN3[i]); |
| 355 | } |
| 356 | fclose(fp);*/ |
| 357 | |
| 358 | /* |
| 359 | #ifdef __SDSOC |
| 360 | FILE *fp = fopen("/mnt/models/AlexNetFCN/caffe_ref/score_fr_out.txt", "r"); |
| 361 | #else |
| 362 | FILE *fp = fopen("/proj/sdxapps/refdes/API_MIGRATE/sd_card/quant_models/AlexNetFCN-8Bit/caffe_ref/score_fr_out.txt", "r"); |
| 363 | #endif |
| 364 | if(fp == NULL) |
| 365 | { |
| 366 | fprintf(stderr, "cant read file\n"); |
| 367 | return; |
| 368 | } |
| 369 | |
| 370 | for(int i = 0; i < 21*16*16; i++) |
| 371 | { |
| 372 | float val; |
| 373 | fscanf(fp, "%f", &val); |
| 374 | short ival = (short)val; |
| 375 | short hls_val = (short)val;//ConvertToFP(val, ival, 3); |
| 376 | for(int j = 0; j < XBATCH_SIZE; j++) |
| 377 | { |
| 378 | int idx = j*21*16*16; |
| 379 | deconvIN3[i+idx] = hls_val; |
| 380 | } |
| 381 | } |
| 382 | |
| 383 | //for(int i = 0; i < 10; i++) |
| 384 | // fprintf(stderr, "in[%d] = %hd\n", i, deconv_in[i]); |
| 385 | */ |
| 386 | |
| 387 | int o_width = AlignSize(scalar_deconv_args[3], 2); |
| 388 | int n_planes = AlignSize(scalar_deconv_args[0], 32); |
| 389 | for(int batch_id = 0; batch_id < XBATCH_SIZE; ++batch_id) |
| 390 | { |
| 391 | //fprintf(stderr, "[INFOx] Batch : %d\n", batch_id); |
| 392 | short* deconv_in = (short *)(deconvIN3+(batch_id*scalar_deconv_args[1]*scalar_deconv_args[2]*n_planes)); |
| 393 | |
| 394 | //# Hardcoded output depth as 1 |
no test coverage detected