| … | … | @@ -1,28 +1,28 @@ |
| 1 | 1 | set(libHashFactory_LIB_SRCS CLHash_Utilities.c HashFactory.c CLHash_Utilities.h HashFactory.h) |
| 2 | 2 | |
| 3 | set(INDENT indent) | |
| 4 | set(CPREPROCESSOR cpp) | |
| 3 | #set(INDENT indent) | |
| 4 | #set(CPREPROCESSOR cpp) | |
| 5 | 5 | |
| 6 | 6 | #COMMAND ${CPREPROCESSOR} -CC -x c -imacros HashFactory.hm HashFactory.hp | ${INDENT} -linux -brf -o HashFactory.h |
| 7 | 7 | |
| 8 | 8 | ########### generate sources target ############### |
| 9 | add_custom_target(HashFactory.h ALL | |
| 10 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/HashFactory.hm ${CMAKE_CURRENT_SOURCE_DIR}/HashFactory.hp | |
| 11 | ${CMAKE_CURRENT_SOURCE_DIR}/perfectHash.hm ${CMAKE_CURRENT_SOURCE_DIR}/compactHash.hm | |
| 12 | COMMAND cpp -P -CC -x c -imacros HashFactory.hm HashFactory.hp | indent -linux -brf -o HashFactory.h) | |
| 13 | ||
| 14 | add_custom_target(HashFactory.c ALL | |
| 15 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/HashFactory.cm ${CMAKE_CURRENT_SOURCE_DIR}/HashFactory.cp | |
| 16 | ${CMAKE_CURRENT_SOURCE_DIR}/perfectHash.cm ${CMAKE_CURRENT_SOURCE_DIR}/compactHash.cm | |
| 17 | HashFactory.cl HashFactory.h | |
| 18 | COMMAND cpp -P -CC -x c -imacros HashFactory.cm HashFactory.cp | indent -linux -brf | | |
| 19 | sed -e '/OMP_PRAGMA_PARALLEL_FOR/s/[[:space:]]*OMP_PRAGMA_PARALLEL_FOR\;/\#pragma omp parallel for/' > HashFactory.c && | |
| 20 | ${CMAKE_CURRENT_SOURCE_DIR}/embed_source.pl HashFactory.cl >> ${CMAKE_CURRENT_BINARY_DIR}/HashFactory.c) | |
| 21 | ||
| 22 | add_custom_target(HashFactory.cl ALL | |
| 23 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/HashFactory.clp ${CMAKE_CURRENT_SOURCE_DIR}/HashFactory.cm | |
| 24 | ${CMAKE_CURRENT_SOURCE_DIR}/perfectHash.cm ${CMAKE_CURRENT_SOURCE_DIR}/compactHash.cm | |
| 25 | COMMAND cpp -P -CC -x c -imacros HashFactory.cm HashFactory.clp | indent -linux -brf -o HashFactory.cl) | |
| 9 | #add_custom_target(HashFactory.h ALL | |
| 10 | # DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/HashFactory.hm ${CMAKE_CURRENT_SOURCE_DIR}/HashFactory.hp | |
| 11 | # ${CMAKE_CURRENT_SOURCE_DIR}/perfectHash.hm ${CMAKE_CURRENT_SOURCE_DIR}/compactHash.hm | |
| 12 | # COMMAND cpp -P -CC -x c -imacros HashFactory.hm HashFactory.hp | indent -linux -brf -o HashFactory.h) | |
| 13 | # | |
| 14 | #add_custom_target(HashFactory.c ALL | |
| 15 | # DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/HashFactory.cm ${CMAKE_CURRENT_SOURCE_DIR}/HashFactory.cp | |
| 16 | # ${CMAKE_CURRENT_SOURCE_DIR}/perfectHash.cm ${CMAKE_CURRENT_SOURCE_DIR}/compactHash.cm | |
| 17 | # HashFactory.cl HashFactory.h | |
| 18 | # COMMAND cpp -P -CC -x c -imacros HashFactory.cm HashFactory.cp | indent -linux -brf | | |
| 19 | # sed -e '/OMP_PRAGMA_PARALLEL_FOR/s/[[:space:]]*OMP_PRAGMA_PARALLEL_FOR\;/\#pragma omp parallel for/' > HashFactory.c && | |
| 20 | # ${CMAKE_CURRENT_SOURCE_DIR}/embed_source.pl HashFactory.cl >> ${CMAKE_CURRENT_BINARY_DIR}/HashFactory.c) | |
| 21 | # | |
| 22 | #add_custom_target(HashFactory.cl ALL | |
| 23 | # DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/HashFactory.clp ${CMAKE_CURRENT_SOURCE_DIR}/HashFactory.cm | |
| 24 | # ${CMAKE_CURRENT_SOURCE_DIR}/perfectHash.cm ${CMAKE_CURRENT_SOURCE_DIR}/compactHash.cm | |
| 25 | # COMMAND cpp -P -CC -x c -imacros HashFactory.cm HashFactory.clp | indent -linux -brf -o HashFactory.cl) | |
| 26 | 26 | |
| 27 | 27 | ########### embed source target ############### |
| 28 | 28 | add_custom_target(HashFactory_source.inc ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/HashFactory.cl |
| … | … | @@ -276,7 +276,7 @@ int main (int argc, const char * argv[]) |
| 276 | 276 | if (strcmp(argv[i], "-N") == 0) { |
| 277 | 277 | i++; |
| 278 | 278 | n_max =(int)(atoi(argv[i])); |
| 279 | } | |
| 279 | } | |
| 280 | 280 | if (strcmp(argv[i], "-o") == 0) { |
| 281 | 281 | i++; |
| 282 | 282 | int option_size = 0; |
| … | … | @@ -287,7 +287,7 @@ int main (int argc, const char * argv[]) |
| 287 | 287 | printf("Please add tests: br, kd, hc, hlc, hc1, hlc1, hc2, hlc2, hc3, hlc3, holc3, hg, hg1, hg2, hg3, hg4\n"); |
| 288 | 288 | return 0; |
| 289 | 289 | } |
| 290 | sprintf(header,"Size, \tncells, \tcompression,"); | |
| 290 | sprintf(header,"Size, \tlevmx: \tncells, \tcompression,"); | |
| 291 | 291 | if(WRITE_MEM_USAGE) fprintf(fmem,"Size, \tncells, "); |
| 292 | 292 | fflush(stdout); |
| 293 | 293 | options = (int*)malloc((option_size+2)*sizeof(int)); |
| … | … | @@ -298,7 +298,7 @@ int main (int argc, const char * argv[]) |
| 298 | 298 | for (int iopt = 0; iopt < nopts; iopt++){ |
| 299 | 299 | if (strcmp(argv[i], inputopt[iopt]) == 0) { |
| 300 | 300 | option = inputkey[iopt]; |
| 301 | sprintf(add_string,"\t%s,",descriptor[iopt]); | |
| 301 | sprintf(add_string," \t%s,",descriptor[iopt]); | |
| 302 | 302 | strcat(header,add_string); |
| 303 | 303 | if(WRITE_MEM_USAGE) fprintf(fmem,"\t%s,",descriptor[iopt]); |
| 304 | 304 | break; |
| … | … | @@ -313,7 +313,7 @@ int main (int argc, const char * argv[]) |
| 313 | 313 | i++; |
| 314 | 314 | } |
| 315 | 315 | options[j] = END_CHARACTER; |
| 316 | strcat(header,"\n"); | |
| 316 | //strcat(header,"\n"); | |
| 317 | 317 | if(WRITE_MEM_USAGE) fprintf(fmem,"\n"); |
| 318 | 318 | } |
| 319 | 319 | } |
| … | … | @@ -381,14 +381,14 @@ int main (int argc, const char * argv[]) |
| 381 | 381 | printf("\n 2D Neighbors Performance Results\n\n"); |
| 382 | 382 | printf("%s\n",header); |
| 383 | 383 | |
| 384 | printf("\nThreshold for refinement is %f\n",threshold); | |
| 385 | printf("\nWork group size is %d and init workgroup size is %d\n",TILE_SIZE,TILE_SIZE_INIT); | |
| 384 | //printf("\nThreshold for refinement is %f\n",threshold); | |
| 385 | //printf("\nWork group size is %d and init workgroup size is %d\n",TILE_SIZE,TILE_SIZE_INIT); | |
| 386 | 386 | for (uint levmx = levmx_min; levmx < levmx_max; levmx++ ){ |
| 387 | printf("\nMax levels is %d\n",levmx); | |
| 387 | //printf("\nMax levels is %d\n",levmx); | |
| 388 | 388 | if(WRITE_MEM_USAGE) fprintf(fmem,"\nMax levels is %d\n",levmx); |
| 389 | 389 | for( uint i = n_min; i <= n_max; i*=2 ) { |
| 390 | 390 | if (levmx > 3 && i > 512) continue; |
| 391 | printf("%d, ", i); | |
| 391 | printf("%d, \t%d: ", i,levmx); | |
| 392 | 392 | if(WRITE_MEM_USAGE) fprintf(fmem,"%d, ", i); |
| 393 | 393 | neighbors2d(i, levmx, threshold, options, haveGPU); |
| 394 | 394 | printf("\n"); |