This contains my bachelors thesis and associated tex files, code snippets and maybe more. Topic: Data Movement in Heterogeneous Memories with Intel Data Streaming Accelerator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
3.7 KiB

  1. cmake_minimum_required(VERSION 3.18)
  2. # set the project name
  3. project(NUMA_Slow_Fast_Datamigration_Test VERSION 0.1)
  4. # specify the C standard
  5. set(CMAKE_CXX_STANDARD 20)
  6. set(CMAKE_CXX_STANDARD_REQUIRED True)
  7. #set flags on need cross compile for sapphirerapids architecture
  8. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=sapphirerapids")
  9. #set flags on need cross compile for skylake micro architecture
  10. #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=skylake-avx512")
  11. #set flags on need cross compile for knights landing micro architecture (for debugging)
  12. #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx512f -mavx512cd -mavx512er -mavx512pf")
  13. #suppress selected! warnigs that are not very important to resolve. This is to keep the compileation output clean
  14. set(SUPPRESS_WARNINGS "-Wno-literal-suffix -Wno-volatile")
  15. set(DEBUG_FLAGS "-g3" "-ggdb")
  16. set(RELEASE_FLAGS "-O3")
  17. #set pcm location
  18. set(PCM_LOCATION ./thirdParty/pcm)
  19. set(PCM_LINKS -lpcm -L${CMAKE_CURRENT_LIST_DIR}/${PCM_LOCATION}/build/lib)
  20. # pass the in formation about the shared library location to the linker
  21. link_directories(${CMAKE_CURRENT_LIST_DIR}/${PCM_LOCATION}/build/lib)
  22. #set flags used for Release and Debug build type
  23. add_compile_options(
  24. "$<$<CONFIG:Release>:${RELEASE_FLAGS}>"
  25. "$<$<CONFIG:Debug>:${DEBUG_FLAGS}>"
  26. )
  27. # evaluate custom variables
  28. function(eval vname vvalid vdefault)
  29. # is variable is set to the below value if its not already defined from the comand line
  30. set(VALID ${vvalid} CACHE INTERNAL "Possible values for ${vname}")
  31. set(${vname} ${vdefault} CACHE STRING "The barrier mode")
  32. # command for GUI shenanigans
  33. set_property(CACHE ${vname} PROPERTY STRINGS VALID)
  34. if(${vname} IN_LIST VALID)
  35. message(STATUS "Variable ${vname} = ${${vname}}")
  36. else()
  37. message(STATUS "Variable ${vname} has invalid value ${${vname}}")
  38. # set the fallback value for use in parent function
  39. unset(${vname} CACHE)
  40. message(STATUS "Fallback to default: ${vname} = ${vdefault}")
  41. set(${vname} ${vdefault} PARENT_SCOPE)
  42. endif()
  43. endfunction()
  44. eval(WSUPPRESS "suppress;show" "show")
  45. if($<STREQUAL:${BUFFER_LIMIT},suppress> EQUAL 1)
  46. add_compile_options("${SUPPRESS_WARNINGS}")
  47. endif()
  48. eval(BARRIER_MODE "global;local" "global")
  49. add_definitions(-DBARRIER_MODE="${BARRIER_MODE}")
  50. eval(BUFFER_LIMIT "unlimited;limited" "unlimited")
  51. add_definitions(-DBUFFER_LIMIT=$<STREQUAL:${BUFFER_LIMIT},limited>)
  52. eval(QUERY "simple;complex" "simple")
  53. add_definitions(-DQUERY=$<STREQUAL:${QUERY},simple>)
  54. eval(THREAD_FACTOR "1;2;3;4;5;6;7;8;9;10" "4")
  55. add_definitions(-DTHREAD_GROUP_MULTIPLIER=${THREAD_FACTOR})
  56. eval(PINNING "cpu;numa" "cpu")
  57. add_definitions(-DPINNING=$<STREQUAL:${PINNING},cpu>)
  58. eval(PCM_M "true;false" "false")
  59. add_definitions(-DPCM_M=$<STREQUAL:${PCM_M},true>)
  60. add_definitions(${PCM_LINKS})
  61. # build directory
  62. set(CMAKE_BINARY_DIR "../bin") #relative to inside build
  63. set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
  64. # include directories
  65. include_directories(src/utils)
  66. include_directories(src/algorithm)
  67. include_directories(src/algorithm/operators)
  68. include_directories(thirdParty/pcm/src)
  69. # link libraries
  70. link_libraries(-lnuma -lpthread)
  71. # Add targets only below
  72. # specify build targets
  73. add_executable(FilterAggregatePipeline src/benchmark/filter_aggregate_pipeline.cpp)
  74. add_executable(DoublyFiltered src/benchmark/doubly_filtered_agg.cpp)
  75. add_executable(DIMESBench src/benchmark/DIMES_benchmark.cpp)
  76. add_executable(DIMESCoreBench src/benchmark/DIMES_cores_benchmark.cpp)
  77. add_executable(MicroBench src/benchmark/micro_benchmarks.cpp)
  78. add_executable(MAXBench src/benchmark/MAX_benchmark.cpp
  79. src/benchmark/QDP_minimal.h)
  80. target_link_libraries(MAXBench libpcm.so)
  81. add_executable(LatencyBench src/benchmark/latency.cpp)