Changeset 137 for trunk/Softwares/MiBench/src/c/benchmark.c
- Timestamp:
- Feb 16, 2010, 1:35:48 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Softwares/MiBench/src/c/benchmark.c
r129 r137 148 148 free(argv[i]); 149 149 free(argv); 150 free(filename); 150 151 } 151 152 #endif … … 175 176 free(argv[i]); 176 177 free(argv); 178 free(filename); 177 179 } 178 180 #endif … … 193 195 194 196 //======================================================================================= 195 // [ run_automative_susan]196 //======================================================================================= 197 #ifdef MIBENCH_SMALL 198 void main_susan_ small (void)197 // [ run_automative_susan_egdes ] 198 //======================================================================================= 199 #ifdef MIBENCH_SMALL 200 void main_susan_edges_small (void) 199 201 { 200 202 int argc = 4; … … 205 207 char * filename_input = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename_input)); 206 208 strcpy(filename_input,MIBENCH_DATA_PATH); strcat(filename_input,_filename_input); 209 char * filename_output = "output_small.edges.pgm"; 210 char * option = "-e"; 207 211 208 212 argv = (char **)malloc ((argc) * sizeof(char *)); … … 214 218 argv[1] = memcpy(argv[1],filename_input ,strlen(filename_input )); 215 219 216 char * filename_output = "output_small.smoothing.pgm";217 char * option = "-s";218 219 220 argv[2] = (char *) malloc (strlen(filename_output)); 220 221 argv[2] = memcpy(argv[2],filename_output,strlen(filename_output)); … … 225 226 main_susan(argc, argv); 226 227 227 for (int i=2; i<argc; ++i) 228 free(argv[i]); 229 230 filename_output = "output_small.edges.pgm"; 231 option = "-e"; 232 233 argv[2] = (char *) malloc (strlen(filename_output)); 234 argv[2] = memcpy(argv[2],filename_output,strlen(filename_output)); 235 236 argv[3] = (char *) malloc (strlen(option )); 237 argv[3] = memcpy(argv[3],option ,strlen(option )); 238 239 main_susan(argc, argv); 240 241 for (int i=2; i<argc; ++i) 242 free(argv[i]); 243 244 for (int i=2; i<argc; ++i) 245 free(argv[i]); 246 247 filename_output = "output_small.cornes.pgm"; 248 option = "-c"; 249 250 argv[2] = (char *) malloc (strlen(filename_output)); 251 argv[2] = memcpy(argv[2],filename_output,strlen(filename_output)); 252 253 argv[3] = (char *) malloc (strlen(option )); 254 argv[3] = memcpy(argv[3],option ,strlen(option )); 255 256 main_susan(argc, argv); 257 258 for (int i=0; i<argc; ++i) 259 free(argv[i]); 260 free(argv); 261 } 262 #endif 263 264 #ifdef MIBENCH_LARGE 265 void main_susan_large (void) 228 for (int i=0; i<argc; ++i) 229 free(argv[i]); 230 free(argv); 231 free(filename_input); 232 } 233 #endif 234 235 #ifdef MIBENCH_LARGE 236 void main_susan_edges_large (void) 266 237 { 267 238 int argc = 4; … … 272 243 char * filename_input = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename_input)); 273 244 strcpy(filename_input,MIBENCH_DATA_PATH); strcat(filename_input,_filename_input); 245 char * filename_output = "output_large.edges.pgm"; 246 char * option = "-e"; 274 247 275 248 argv = (char **)malloc ((argc) * sizeof(char *)); … … 281 254 argv[1] = memcpy(argv[1],filename_input ,strlen(filename_input )); 282 255 256 argv[2] = (char *) malloc (strlen(filename_output)); 257 argv[2] = memcpy(argv[2],filename_output,strlen(filename_output)); 258 259 argv[3] = (char *) malloc (strlen(option )); 260 argv[3] = memcpy(argv[3],option ,strlen(option )); 261 262 main_susan(argc, argv); 263 264 for (int i=0; i<argc; ++i) 265 free(argv[i]); 266 free(argv); 267 free(filename_input); 268 } 269 #endif 270 271 void run_automative_susan_edges (void) 272 { 273 printf("***** automative.susan.edges - Begin *****\n"); 274 275 #ifdef MIBENCH_SMALL 276 main_susan_edges_small (); 277 #endif 278 #ifdef MIBENCH_LARGE 279 main_susan_edges_large (); 280 #endif 281 282 printf("***** automative.susan.edges - End *****\n"); 283 } 284 285 //======================================================================================= 286 // [ run_automative_susan_corners ] 287 //======================================================================================= 288 #ifdef MIBENCH_SMALL 289 void main_susan_corners_small (void) 290 { 291 int argc = 4; 292 char ** argv; 293 294 char * execname = "./susan"; 295 char *_filename_input = "/susan-input_small.pgm"; 296 char * filename_input = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename_input)); 297 strcpy(filename_input,MIBENCH_DATA_PATH); strcat(filename_input,_filename_input); 298 char * filename_output = "output_small.corners.pgm"; 299 char * option = "-c"; 300 301 argv = (char **)malloc ((argc) * sizeof(char *)); 302 303 argv[0] = (char *) malloc (strlen(execname )); 304 argv[0] = memcpy(argv[0],execname ,strlen(execname )); 305 306 argv[1] = (char *) malloc (strlen(filename_input )); 307 argv[1] = memcpy(argv[1],filename_input ,strlen(filename_input )); 308 309 argv[2] = (char *) malloc (strlen(filename_output)); 310 argv[2] = memcpy(argv[2],filename_output,strlen(filename_output)); 311 312 argv[3] = (char *) malloc (strlen(option )); 313 argv[3] = memcpy(argv[3],option ,strlen(option )); 314 315 main_susan(argc, argv); 316 317 for (int i=0; i<argc; ++i) 318 free(argv[i]); 319 free(argv); 320 free(filename_input); 321 } 322 #endif 323 324 #ifdef MIBENCH_LARGE 325 void main_susan_corners_large (void) 326 { 327 int argc = 4; 328 char ** argv; 329 330 char * execname = "./susan"; 331 char *_filename_input = "/susan-input_large.pgm"; 332 char * filename_input = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename_input)); 333 strcpy(filename_input,MIBENCH_DATA_PATH); strcat(filename_input,_filename_input); 334 char * filename_output = "output_small.corners.pgm"; 335 char * option = "-c"; 336 337 argv = (char **)malloc ((argc) * sizeof(char *)); 338 339 argv[0] = (char *) malloc (strlen(execname )); 340 argv[0] = memcpy(argv[0],execname ,strlen(execname )); 341 342 argv[1] = (char *) malloc (strlen(filename_input )); 343 argv[1] = memcpy(argv[1],filename_input ,strlen(filename_input )); 344 345 argv[2] = (char *) malloc (strlen(filename_output)); 346 argv[2] = memcpy(argv[2],filename_output,strlen(filename_output)); 347 348 argv[3] = (char *) malloc (strlen(option )); 349 argv[3] = memcpy(argv[3],option ,strlen(option )); 350 351 main_susan(argc, argv); 352 353 for (int i=0; i<argc; ++i) 354 free(argv[i]); 355 free(argv); 356 free(filename_input); 357 } 358 #endif 359 360 void run_automative_susan_corners (void) 361 { 362 printf("***** automative.susan.corners - Begin *****\n"); 363 364 #ifdef MIBENCH_SMALL 365 main_susan_corners_small (); 366 #endif 367 #ifdef MIBENCH_LARGE 368 main_susan_corners_large (); 369 #endif 370 371 printf("***** automative.susan.corners - End *****\n"); 372 } 373 374 //======================================================================================= 375 // [ run_automative_susan_smoothing ] 376 //======================================================================================= 377 #ifdef MIBENCH_SMALL 378 void main_susan_smoothing_small (void) 379 { 380 int argc = 4; 381 char ** argv; 382 383 char * execname = "./susan"; 384 char *_filename_input = "/susan-input_small.pgm"; 385 char * filename_input = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename_input)); 386 strcpy(filename_input,MIBENCH_DATA_PATH); strcat(filename_input,_filename_input); 387 char * filename_output = "output_small.smoothing.pgm"; 388 char * option = "-s"; 389 390 argv = (char **)malloc ((argc) * sizeof(char *)); 391 392 argv[0] = (char *) malloc (strlen(execname )); 393 argv[0] = memcpy(argv[0],execname ,strlen(execname )); 394 395 argv[1] = (char *) malloc (strlen(filename_input )); 396 argv[1] = memcpy(argv[1],filename_input ,strlen(filename_input )); 397 398 argv[2] = (char *) malloc (strlen(filename_output)); 399 argv[2] = memcpy(argv[2],filename_output,strlen(filename_output)); 400 401 argv[3] = (char *) malloc (strlen(option )); 402 argv[3] = memcpy(argv[3],option ,strlen(option )); 403 404 main_susan(argc, argv); 405 406 for (int i=0; i<argc; ++i) 407 free(argv[i]); 408 free(argv); 409 free(filename_input); 410 } 411 #endif 412 413 #ifdef MIBENCH_LARGE 414 void main_susan_smoothing_large (void) 415 { 416 int argc = 4; 417 char ** argv; 418 419 char * execname = "./susan"; 420 char *_filename_input = "/susan-input_large.pgm"; 421 char * filename_input = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename_input)); 422 strcpy(filename_input,MIBENCH_DATA_PATH); strcat(filename_input,_filename_input); 283 423 char * filename_output = "output_large.smoothing.pgm"; 284 424 char * option = "-s"; 285 425 426 argv = (char **)malloc ((argc) * sizeof(char *)); 427 428 argv[0] = (char *) malloc (strlen(execname )); 429 argv[0] = memcpy(argv[0],execname ,strlen(execname )); 430 431 argv[1] = (char *) malloc (strlen(filename_input )); 432 argv[1] = memcpy(argv[1],filename_input ,strlen(filename_input )); 286 433 argv[2] = (char *) malloc (strlen(filename_output)); 287 434 argv[2] = memcpy(argv[2],filename_output,strlen(filename_output)); … … 291 438 292 439 main_susan(argc, argv); 293 294 for (int i=2; i<argc; ++i) 295 free(argv[i]); 296 297 filename_output = "output_large.edges.pgm"; 298 option = "-e"; 299 300 argv[2] = (char *) malloc (strlen(filename_output)); 301 argv[2] = memcpy(argv[2],filename_output,strlen(filename_output)); 302 303 argv[3] = (char *) malloc (strlen(option )); 304 argv[3] = memcpy(argv[3],option ,strlen(option )); 305 306 main_susan(argc, argv); 307 308 for (int i=2; i<argc; ++i) 309 free(argv[i]); 310 311 for (int i=2; i<argc; ++i) 312 free(argv[i]); 313 314 filename_output = "output_large.cornes.pgm"; 315 option = "-c"; 316 317 argv[2] = (char *) malloc (strlen(filename_output)); 318 argv[2] = memcpy(argv[2],filename_output,strlen(filename_output)); 319 320 argv[3] = (char *) malloc (strlen(option )); 321 argv[3] = memcpy(argv[3],option ,strlen(option )); 322 323 main_susan(argc, argv); 324 325 for (int i=0; i<argc; ++i) 326 free(argv[i]); 327 free(argv); 328 } 329 #endif 440 441 for (int i=0; i<argc; ++i) 442 free(argv[i]); 443 free(argv); 444 free(filename_input); 445 } 446 #endif 447 448 void run_automative_susan_smoothing (void) 449 { 450 printf("***** automative.susan.smoothing - Begin *****\n"); 451 452 #ifdef MIBENCH_SMALL 453 main_susan_smoothing_small (); 454 #endif 455 #ifdef MIBENCH_LARGE 456 main_susan_smoothing_large (); 457 #endif 458 459 printf("***** automative.susan.smoothing - End *****\n"); 460 } 461 462 //======================================================================================= 463 // [ run_automative_susan ] 464 //======================================================================================= 330 465 331 466 void run_automative_susan (void) … … 333 468 printf("***** automative.susan - Begin *****\n"); 334 469 335 #ifdef MIBENCH_SMALL 336 main_susan_small (); 337 #endif 338 #ifdef MIBENCH_LARGE 339 main_susan_large (); 340 #endif 470 run_automative_susan_edges (); 471 run_automative_susan_corners (); 472 run_automative_susan_smoothing (); 473 474 /* 475 #ifdef MIBENCH_SMALL 476 main_susan_edges_small (); 477 main_susan_corners_small (); 478 main_susan_smoothing_small (); 479 #endif 480 #ifdef MIBENCH_LARGE 481 main_susan_edges_large (); 482 main_susan_corners_large (); 483 main_susan_smoothing_large (); 484 #endif 485 */ 341 486 342 487 printf("***** automative.susan - End *****\n"); … … 376 521 free(argv[i]); 377 522 free(argv); 523 free(filename); 378 524 } 379 525 #endif … … 409 555 free(argv[i]); 410 556 free(argv); 557 free(filename); 411 558 } 412 559 #endif … … 470 617 free(argv[i]); 471 618 free(argv); 619 free(filename); 472 620 } 473 621 #endif … … 497 645 free(argv[i]); 498 646 free(argv); 647 free(filename); 499 648 } 500 649 #endif … … 513 662 printf("***** security.sha - End *****\n"); 514 663 } 664 665 666 //======================================================================================= 667 // [ run_all ] 668 //======================================================================================= 669 void run_all (void) 670 { 671 printf("***** all *****\n"); 672 673 run_automative_basicmath (); 674 run_automative_bitcount (); 675 run_automative_qsort (); 676 run_automative_susan_edges (); 677 run_automative_susan_corners (); 678 run_automative_susan_smoothing (); 679 680 run_network_dijkstra (); 681 682 run_office_stringsearch (); 683 684 run_security_sha (); 685 686 return; 687 }
Note: See TracChangeset
for help on using the changeset viewer.