[117] | 1 | // $Id: benchmark.c 137 2010-02-16 12:35:48Z rosiere $ |
---|
| 2 | |
---|
| 3 | #include <stdlib.h> |
---|
| 4 | #include <string.h> |
---|
| 5 | #include <stdio.h> |
---|
| 6 | |
---|
| 7 | #ifndef MIBENCH_DATA_PATH |
---|
| 8 | # error "MIBENCH_DATA_PATH must be defined" |
---|
| 9 | #endif |
---|
| 10 | |
---|
[129] | 11 | #if !defined(MIBENCH_SMALL) && !defined(MIBENCH_LARGE) |
---|
| 12 | # error "MIBENCH_SMALL or MIBENCH_LARGE must be defined" |
---|
| 13 | #endif |
---|
[117] | 14 | |
---|
| 15 | //-----[ automative ]----------------------------- |
---|
| 16 | int main_basicmath_small (void); |
---|
| 17 | int main_basicmath_large (void); |
---|
| 18 | int main_bitcount (int argc, char *argv[]); |
---|
| 19 | int main_qsort_small (int argc, char *argv[]); |
---|
| 20 | int main_qsort_large (int argc, char *argv[]); |
---|
| 21 | int main_susan (int argc, char *argv[]); |
---|
| 22 | //-----[ office ]--------------------------------- |
---|
| 23 | int main_stringsearch_small (void); |
---|
| 24 | int main_stringsearch_large (void); |
---|
| 25 | //-----[ network ]-------------------------------- |
---|
| 26 | int main_dijkstra (int argc, char *argv[]); |
---|
[118] | 27 | //-----[ security ]------------------------------- |
---|
[117] | 28 | int main_sha (int argc, char *argv[]); |
---|
| 29 | |
---|
| 30 | //======================================================================================= |
---|
| 31 | // [ run_none ] |
---|
| 32 | //======================================================================================= |
---|
| 33 | void run_none (void) |
---|
| 34 | { |
---|
| 35 | printf("***** none *****\n"); |
---|
| 36 | return; |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | //======================================================================================= |
---|
| 40 | // [ run_automative_basicmath ] |
---|
| 41 | //======================================================================================= |
---|
| 42 | void run_automative_basicmath (void) |
---|
| 43 | { |
---|
| 44 | printf("***** automative.basicmath - Begin *****\n"); |
---|
| 45 | |
---|
[129] | 46 | #ifdef MIBENCH_SMALL |
---|
[117] | 47 | main_basicmath_small (); |
---|
| 48 | #endif |
---|
[129] | 49 | #ifdef MIBENCH_LARGE |
---|
[117] | 50 | main_basicmath_large (); |
---|
| 51 | #endif |
---|
| 52 | |
---|
| 53 | printf("***** automative.basicmath - End *****\n"); |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | //======================================================================================= |
---|
| 57 | // [ run_automative_bitcount ] |
---|
| 58 | //======================================================================================= |
---|
[129] | 59 | #ifdef MIBENCH_SMALL |
---|
[117] | 60 | void main_bitcount_small (void) |
---|
| 61 | { |
---|
| 62 | int argc = 2; |
---|
| 63 | char ** argv; |
---|
| 64 | |
---|
| 65 | char * execname = "./bitcount"; |
---|
| 66 | char * iteration = "75000"; |
---|
| 67 | |
---|
| 68 | argv = (char **)malloc ((argc) * sizeof(char *)); |
---|
| 69 | |
---|
| 70 | argv[0] = (char *) malloc (strlen(execname )); |
---|
| 71 | argv[0] = memcpy(argv[0],execname ,strlen(execname )); |
---|
| 72 | |
---|
| 73 | argv[1] = (char *) malloc (strlen(iteration)); |
---|
| 74 | argv[1] = memcpy(argv[1],iteration,strlen(iteration)); |
---|
| 75 | |
---|
| 76 | main_bitcount(argc, argv); |
---|
| 77 | |
---|
| 78 | for (int i=0; i<argc; ++i) |
---|
| 79 | free(argv[i]); |
---|
| 80 | free(argv); |
---|
| 81 | } |
---|
| 82 | #endif |
---|
| 83 | |
---|
[129] | 84 | #ifdef MIBENCH_LARGE |
---|
[117] | 85 | void main_bitcount_large (void) |
---|
| 86 | { |
---|
| 87 | int argc = 2; |
---|
| 88 | char ** argv; |
---|
| 89 | |
---|
| 90 | char * execname = "./bitcount"; |
---|
| 91 | char * iteration = "1125000"; |
---|
| 92 | |
---|
| 93 | argv = (char **)malloc ((argc) * sizeof(char *)); |
---|
| 94 | |
---|
| 95 | argv[0] = (char *) malloc (strlen(execname )); |
---|
| 96 | argv[0] = memcpy(argv[0],execname ,strlen(execname )); |
---|
| 97 | |
---|
| 98 | argv[1] = (char *) malloc (strlen(iteration)); |
---|
| 99 | argv[1] = memcpy(argv[1],iteration,strlen(iteration)); |
---|
| 100 | |
---|
| 101 | main_bitcount(argc, argv); |
---|
| 102 | |
---|
| 103 | for (int i=0; i<argc; ++i) |
---|
| 104 | free(argv[i]); |
---|
| 105 | free(argv); |
---|
| 106 | } |
---|
| 107 | #endif |
---|
| 108 | |
---|
| 109 | void run_automative_bitcount (void) |
---|
| 110 | { |
---|
| 111 | printf("***** automative.bitcount - Begin *****\n"); |
---|
| 112 | |
---|
[129] | 113 | #ifdef MIBENCH_SMALL |
---|
[117] | 114 | main_bitcount_small (); |
---|
| 115 | #endif |
---|
[129] | 116 | #ifdef MIBENCH_LARGE |
---|
[117] | 117 | main_bitcount_large (); |
---|
| 118 | #endif |
---|
| 119 | |
---|
| 120 | printf("***** automative.bitcount - End *****\n"); |
---|
| 121 | } |
---|
| 122 | |
---|
| 123 | //======================================================================================= |
---|
| 124 | // [ run_automative_qsort ] |
---|
| 125 | //======================================================================================= |
---|
[129] | 126 | #ifdef MIBENCH_SMALL |
---|
[117] | 127 | void _main_qsort_small (void) |
---|
| 128 | { |
---|
| 129 | int argc = 2; |
---|
| 130 | char ** argv; |
---|
| 131 | |
---|
| 132 | char * execname = "./qsort"; |
---|
| 133 | char *_filename = "/qsort-input_small.dat"; |
---|
| 134 | char * filename = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename)); |
---|
| 135 | strcpy(filename,MIBENCH_DATA_PATH); strcat(filename,_filename); |
---|
| 136 | |
---|
| 137 | argv = (char **)malloc ((argc) * sizeof(char *)); |
---|
| 138 | |
---|
| 139 | argv[0] = (char *) malloc (strlen(execname )); |
---|
| 140 | argv[0] = memcpy(argv[0],execname ,strlen(execname)); |
---|
| 141 | |
---|
| 142 | argv[1] = (char *) malloc (strlen(filename )); |
---|
| 143 | argv[1] = memcpy(argv[1],filename ,strlen(filename)); |
---|
| 144 | |
---|
| 145 | main_qsort_small(argc, argv); |
---|
| 146 | |
---|
| 147 | for (int i=0; i<argc; ++i) |
---|
| 148 | free(argv[i]); |
---|
| 149 | free(argv); |
---|
[137] | 150 | free(filename); |
---|
[117] | 151 | } |
---|
| 152 | #endif |
---|
| 153 | |
---|
[129] | 154 | #ifdef MIBENCH_LARGE |
---|
[117] | 155 | void _main_qsort_large (void) |
---|
| 156 | { |
---|
| 157 | int argc = 2; |
---|
| 158 | char ** argv; |
---|
| 159 | |
---|
| 160 | char * execname = "./qsort"; |
---|
| 161 | char *_filename = "/qsort-input_large.dat"; |
---|
| 162 | char * filename = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename)); |
---|
| 163 | strcpy(filename,MIBENCH_DATA_PATH); strcat(filename,_filename); |
---|
| 164 | |
---|
| 165 | argv = (char **)malloc ((argc) * sizeof(char *)); |
---|
| 166 | |
---|
| 167 | argv[0] = (char *) malloc (strlen(execname )); |
---|
| 168 | argv[0] = memcpy(argv[0],execname ,strlen(execname)); |
---|
| 169 | |
---|
| 170 | argv[1] = (char *) malloc (strlen(filename )); |
---|
| 171 | argv[1] = memcpy(argv[1],filename ,strlen(filename)); |
---|
| 172 | |
---|
| 173 | main_qsort_large(argc, argv); |
---|
| 174 | |
---|
| 175 | for (int i=0; i<argc; ++i) |
---|
| 176 | free(argv[i]); |
---|
| 177 | free(argv); |
---|
[137] | 178 | free(filename); |
---|
[117] | 179 | } |
---|
| 180 | #endif |
---|
| 181 | |
---|
| 182 | void run_automative_qsort (void) |
---|
| 183 | { |
---|
| 184 | printf("***** automative.qsort - Begin *****\n"); |
---|
| 185 | |
---|
[129] | 186 | #ifdef MIBENCH_SMALL |
---|
[117] | 187 | _main_qsort_small (); |
---|
| 188 | #endif |
---|
[129] | 189 | #ifdef MIBENCH_LARGE |
---|
[117] | 190 | _main_qsort_large (); |
---|
| 191 | #endif |
---|
| 192 | |
---|
| 193 | printf("***** automative.qsort - End *****\n"); |
---|
| 194 | } |
---|
| 195 | |
---|
| 196 | //======================================================================================= |
---|
[137] | 197 | // [ run_automative_susan_egdes ] |
---|
[117] | 198 | //======================================================================================= |
---|
[129] | 199 | #ifdef MIBENCH_SMALL |
---|
[137] | 200 | void main_susan_edges_small (void) |
---|
[117] | 201 | { |
---|
| 202 | int argc = 4; |
---|
| 203 | char ** argv; |
---|
| 204 | |
---|
| 205 | char * execname = "./susan"; |
---|
| 206 | char *_filename_input = "/susan-input_small.pgm"; |
---|
| 207 | char * filename_input = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename_input)); |
---|
| 208 | strcpy(filename_input,MIBENCH_DATA_PATH); strcat(filename_input,_filename_input); |
---|
[137] | 209 | char * filename_output = "output_small.edges.pgm"; |
---|
| 210 | char * option = "-e"; |
---|
[117] | 211 | |
---|
| 212 | argv = (char **)malloc ((argc) * sizeof(char *)); |
---|
| 213 | |
---|
| 214 | argv[0] = (char *) malloc (strlen(execname )); |
---|
| 215 | argv[0] = memcpy(argv[0],execname ,strlen(execname )); |
---|
| 216 | |
---|
| 217 | argv[1] = (char *) malloc (strlen(filename_input )); |
---|
| 218 | argv[1] = memcpy(argv[1],filename_input ,strlen(filename_input )); |
---|
| 219 | |
---|
| 220 | argv[2] = (char *) malloc (strlen(filename_output)); |
---|
| 221 | argv[2] = memcpy(argv[2],filename_output,strlen(filename_output)); |
---|
| 222 | |
---|
| 223 | argv[3] = (char *) malloc (strlen(option )); |
---|
| 224 | argv[3] = memcpy(argv[3],option ,strlen(option )); |
---|
| 225 | |
---|
| 226 | main_susan(argc, argv); |
---|
| 227 | |
---|
[137] | 228 | for (int i=0; i<argc; ++i) |
---|
[117] | 229 | free(argv[i]); |
---|
[137] | 230 | free(argv); |
---|
| 231 | free(filename_input); |
---|
| 232 | } |
---|
| 233 | #endif |
---|
[117] | 234 | |
---|
[137] | 235 | #ifdef MIBENCH_LARGE |
---|
| 236 | void main_susan_edges_large (void) |
---|
| 237 | { |
---|
| 238 | int argc = 4; |
---|
| 239 | char ** argv; |
---|
[117] | 240 | |
---|
[137] | 241 | char * execname = "./susan"; |
---|
| 242 | char *_filename_input = "/susan-input_large.pgm"; |
---|
| 243 | char * filename_input = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename_input)); |
---|
| 244 | strcpy(filename_input,MIBENCH_DATA_PATH); strcat(filename_input,_filename_input); |
---|
| 245 | char * filename_output = "output_large.edges.pgm"; |
---|
| 246 | char * option = "-e"; |
---|
| 247 | |
---|
| 248 | argv = (char **)malloc ((argc) * sizeof(char *)); |
---|
| 249 | |
---|
| 250 | argv[0] = (char *) malloc (strlen(execname )); |
---|
| 251 | argv[0] = memcpy(argv[0],execname ,strlen(execname )); |
---|
| 252 | |
---|
| 253 | argv[1] = (char *) malloc (strlen(filename_input )); |
---|
| 254 | argv[1] = memcpy(argv[1],filename_input ,strlen(filename_input )); |
---|
| 255 | |
---|
[117] | 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 | |
---|
[137] | 264 | for (int i=0; i<argc; ++i) |
---|
[117] | 265 | free(argv[i]); |
---|
[137] | 266 | free(argv); |
---|
| 267 | free(filename_input); |
---|
| 268 | } |
---|
| 269 | #endif |
---|
[117] | 270 | |
---|
[137] | 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 |
---|
[117] | 281 | |
---|
[137] | 282 | printf("***** automative.susan.edges - End *****\n"); |
---|
| 283 | } |
---|
[117] | 284 | |
---|
[137] | 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 | |
---|
[117] | 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); |
---|
[137] | 320 | free(filename_input); |
---|
[117] | 321 | } |
---|
| 322 | #endif |
---|
| 323 | |
---|
[129] | 324 | #ifdef MIBENCH_LARGE |
---|
[137] | 325 | void main_susan_corners_large (void) |
---|
[117] | 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); |
---|
[137] | 334 | char * filename_output = "output_small.corners.pgm"; |
---|
| 335 | char * option = "-c"; |
---|
[117] | 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); |
---|
[137] | 352 | |
---|
| 353 | for (int i=0; i<argc; ++i) |
---|
[117] | 354 | free(argv[i]); |
---|
[137] | 355 | free(argv); |
---|
| 356 | free(filename_input); |
---|
| 357 | } |
---|
| 358 | #endif |
---|
[117] | 359 | |
---|
[137] | 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 |
---|
[117] | 370 | |
---|
[137] | 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 | |
---|
[117] | 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 | |
---|
[137] | 406 | for (int i=0; i<argc; ++i) |
---|
[117] | 407 | free(argv[i]); |
---|
[137] | 408 | free(argv); |
---|
| 409 | free(filename_input); |
---|
| 410 | } |
---|
| 411 | #endif |
---|
[117] | 412 | |
---|
[137] | 413 | #ifdef MIBENCH_LARGE |
---|
| 414 | void main_susan_smoothing_large (void) |
---|
| 415 | { |
---|
| 416 | int argc = 4; |
---|
| 417 | char ** argv; |
---|
[117] | 418 | |
---|
[137] | 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); |
---|
| 423 | char * filename_output = "output_large.smoothing.pgm"; |
---|
| 424 | char * option = "-s"; |
---|
[117] | 425 | |
---|
[137] | 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 )); |
---|
[117] | 433 | argv[2] = (char *) malloc (strlen(filename_output)); |
---|
| 434 | argv[2] = memcpy(argv[2],filename_output,strlen(filename_output)); |
---|
| 435 | |
---|
| 436 | argv[3] = (char *) malloc (strlen(option )); |
---|
| 437 | argv[3] = memcpy(argv[3],option ,strlen(option )); |
---|
| 438 | |
---|
| 439 | main_susan(argc, argv); |
---|
| 440 | |
---|
| 441 | for (int i=0; i<argc; ++i) |
---|
| 442 | free(argv[i]); |
---|
| 443 | free(argv); |
---|
[137] | 444 | free(filename_input); |
---|
[117] | 445 | } |
---|
| 446 | #endif |
---|
| 447 | |
---|
[137] | 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 | //======================================================================================= |
---|
| 465 | |
---|
[117] | 466 | void run_automative_susan (void) |
---|
| 467 | { |
---|
| 468 | printf("***** automative.susan - Begin *****\n"); |
---|
| 469 | |
---|
[137] | 470 | run_automative_susan_edges (); |
---|
| 471 | run_automative_susan_corners (); |
---|
| 472 | run_automative_susan_smoothing (); |
---|
| 473 | |
---|
| 474 | /* |
---|
[129] | 475 | #ifdef MIBENCH_SMALL |
---|
[137] | 476 | main_susan_edges_small (); |
---|
| 477 | main_susan_corners_small (); |
---|
| 478 | main_susan_smoothing_small (); |
---|
[117] | 479 | #endif |
---|
[129] | 480 | #ifdef MIBENCH_LARGE |
---|
[137] | 481 | main_susan_edges_large (); |
---|
| 482 | main_susan_corners_large (); |
---|
| 483 | main_susan_smoothing_large (); |
---|
[117] | 484 | #endif |
---|
[137] | 485 | */ |
---|
[117] | 486 | |
---|
| 487 | printf("***** automative.susan - End *****\n"); |
---|
| 488 | } |
---|
| 489 | |
---|
| 490 | //======================================================================================= |
---|
| 491 | // [ run_network_dijkstra ] |
---|
| 492 | //======================================================================================= |
---|
| 493 | |
---|
[129] | 494 | #ifdef MIBENCH_SMALL |
---|
[117] | 495 | void main_dijkstra_small (void) |
---|
| 496 | { |
---|
| 497 | int argc = 3; |
---|
| 498 | |
---|
| 499 | char ** argv; |
---|
| 500 | |
---|
| 501 | char * execname = "./dijkstra"; |
---|
| 502 | char *_filename = "/dijkstra-input.dat"; |
---|
| 503 | char * filename = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename)); |
---|
| 504 | strcpy(filename,MIBENCH_DATA_PATH); strcat(filename,_filename); |
---|
| 505 | char * nb_path = "20"; |
---|
| 506 | |
---|
| 507 | argv = (char **)malloc ((argc) * sizeof(char *)); |
---|
| 508 | |
---|
| 509 | argv[0] = (char *) malloc (strlen(execname )); |
---|
| 510 | argv[0] = memcpy(argv[0],execname ,strlen(execname )); |
---|
| 511 | |
---|
| 512 | argv[1] = (char *) malloc (strlen(filename )); |
---|
| 513 | argv[1] = memcpy(argv[1],filename ,strlen(filename )); |
---|
| 514 | |
---|
| 515 | argv[2] = (char *) malloc (strlen(nb_path )); |
---|
| 516 | argv[2] = memcpy(argv[2],nb_path ,strlen(nb_path )); |
---|
| 517 | |
---|
| 518 | main_dijkstra(argc, argv); |
---|
| 519 | |
---|
| 520 | for (int i=0; i<argc; ++i) |
---|
| 521 | free(argv[i]); |
---|
| 522 | free(argv); |
---|
[137] | 523 | free(filename); |
---|
[117] | 524 | } |
---|
| 525 | #endif |
---|
| 526 | |
---|
| 527 | |
---|
[129] | 528 | #ifdef MIBENCH_LARGE |
---|
[117] | 529 | void main_dijkstra_large (void) |
---|
| 530 | { |
---|
| 531 | int argc = 3; |
---|
| 532 | |
---|
| 533 | char ** argv; |
---|
| 534 | |
---|
| 535 | char * execname = "./dijkstra"; |
---|
| 536 | char *_filename = "/dijkstra-input.dat"; |
---|
| 537 | char * filename = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename)); |
---|
| 538 | strcpy(filename,MIBENCH_DATA_PATH); strcat(filename,_filename); |
---|
| 539 | char * nb_path = "100"; |
---|
| 540 | |
---|
| 541 | argv = (char **)malloc ((argc) * sizeof(char *)); |
---|
| 542 | |
---|
| 543 | argv[0] = (char *) malloc (strlen(execname )); |
---|
| 544 | argv[0] = memcpy(argv[0],execname ,strlen(execname )); |
---|
| 545 | |
---|
| 546 | argv[1] = (char *) malloc (strlen(filename )); |
---|
| 547 | argv[1] = memcpy(argv[1],filename ,strlen(filename )); |
---|
| 548 | |
---|
| 549 | argv[2] = (char *) malloc (strlen(nb_path )); |
---|
| 550 | argv[2] = memcpy(argv[2],nb_path ,strlen(nb_path )); |
---|
| 551 | |
---|
| 552 | main_dijkstra(argc, argv); |
---|
| 553 | |
---|
| 554 | for (int i=0; i<argc; ++i) |
---|
| 555 | free(argv[i]); |
---|
| 556 | free(argv); |
---|
[137] | 557 | free(filename); |
---|
[117] | 558 | } |
---|
| 559 | #endif |
---|
| 560 | |
---|
| 561 | void run_network_dijkstra (void) |
---|
| 562 | { |
---|
| 563 | printf("***** network.dijkstra - Begin *****\n"); |
---|
| 564 | |
---|
[129] | 565 | #ifdef MIBENCH_SMALL |
---|
[117] | 566 | main_dijkstra_small (); |
---|
| 567 | #endif |
---|
[129] | 568 | #ifdef MIBENCH_LARGE |
---|
[117] | 569 | main_dijkstra_large (); |
---|
| 570 | #endif |
---|
| 571 | |
---|
| 572 | printf("***** network.dijkstra - End *****\n"); |
---|
| 573 | } |
---|
| 574 | |
---|
| 575 | //======================================================================================= |
---|
| 576 | // [ run_office_stringsearch ] |
---|
| 577 | //======================================================================================= |
---|
| 578 | void run_office_stringsearch (void) |
---|
| 579 | { |
---|
| 580 | printf("***** office.stringsearch - Begin *****\n"); |
---|
| 581 | |
---|
[129] | 582 | #ifdef MIBENCH_SMALL |
---|
[117] | 583 | main_stringsearch_small (); |
---|
| 584 | #endif |
---|
[129] | 585 | #ifdef MIBENCH_LARGE |
---|
[117] | 586 | main_stringsearch_large (); |
---|
| 587 | #endif |
---|
| 588 | |
---|
| 589 | printf("***** office.stringsearch - End *****\n"); |
---|
| 590 | } |
---|
| 591 | |
---|
| 592 | //======================================================================================= |
---|
| 593 | // [ run_security_sha ] |
---|
| 594 | //======================================================================================= |
---|
[129] | 595 | #ifdef MIBENCH_SMALL |
---|
[117] | 596 | void main_sha_small (void) |
---|
| 597 | { |
---|
| 598 | int argc = 2; |
---|
| 599 | char ** argv; |
---|
| 600 | |
---|
| 601 | char * execname = "./sha"; |
---|
| 602 | char *_filename = "/sha-input_small.asc"; |
---|
| 603 | char * filename = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename)); |
---|
| 604 | strcpy(filename,MIBENCH_DATA_PATH); strcat(filename,_filename); |
---|
| 605 | |
---|
| 606 | argv = (char **)malloc ((argc) * sizeof(char *)); |
---|
| 607 | |
---|
| 608 | argv[0] = (char *) malloc (strlen(execname )); |
---|
| 609 | argv[0] = memcpy(argv[0],execname ,strlen(execname)); |
---|
| 610 | |
---|
| 611 | argv[1] = (char *) malloc (strlen(filename )); |
---|
| 612 | argv[1] = memcpy(argv[1],filename ,strlen(filename)); |
---|
| 613 | |
---|
| 614 | main_sha(argc, argv); |
---|
| 615 | |
---|
| 616 | for (int i=0; i<argc; ++i) |
---|
| 617 | free(argv[i]); |
---|
| 618 | free(argv); |
---|
[137] | 619 | free(filename); |
---|
[117] | 620 | } |
---|
| 621 | #endif |
---|
| 622 | |
---|
[129] | 623 | #ifdef MIBENCH_LARGE |
---|
[117] | 624 | void main_sha_large (void) |
---|
| 625 | { |
---|
| 626 | int argc = 2; |
---|
| 627 | char ** argv; |
---|
| 628 | |
---|
| 629 | char * execname = "./sha"; |
---|
| 630 | char *_filename = "/sha-input_large.asc"; |
---|
| 631 | char * filename = (char *) malloc(strlen(MIBENCH_DATA_PATH)+strlen(_filename)); |
---|
| 632 | strcpy(filename,MIBENCH_DATA_PATH); strcat(filename,_filename); |
---|
| 633 | |
---|
| 634 | argv = (char **)malloc ((argc) * sizeof(char *)); |
---|
| 635 | |
---|
| 636 | argv[0] = (char *) malloc (strlen(execname )); |
---|
| 637 | argv[0] = memcpy(argv[0],execname ,strlen(execname)); |
---|
| 638 | |
---|
| 639 | argv[1] = (char *) malloc (strlen(filename )); |
---|
| 640 | argv[1] = memcpy(argv[1],filename ,strlen(filename)); |
---|
| 641 | |
---|
| 642 | main_sha(argc, argv); |
---|
| 643 | |
---|
| 644 | for (int i=0; i<argc; ++i) |
---|
| 645 | free(argv[i]); |
---|
| 646 | free(argv); |
---|
[137] | 647 | free(filename); |
---|
[117] | 648 | } |
---|
| 649 | #endif |
---|
| 650 | |
---|
| 651 | void run_security_sha (void) |
---|
| 652 | { |
---|
| 653 | printf("***** security.sha - Begin *****\n"); |
---|
| 654 | |
---|
[129] | 655 | #ifdef MIBENCH_SMALL |
---|
[117] | 656 | main_sha_small (); |
---|
| 657 | #endif |
---|
[129] | 658 | #ifdef MIBENCH_LARGE |
---|
[117] | 659 | main_sha_large (); |
---|
| 660 | #endif |
---|
| 661 | |
---|
| 662 | printf("***** security.sha - End *****\n"); |
---|
| 663 | } |
---|
[137] | 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 | } |
---|