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.

78 lines
2.8 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 flags used for Release and Debug build type
  18. add_compile_options(
  19. "$<$<CONFIG:Release>:${RELEASE_FLAGS}>"
  20. "$<$<CONFIG:Debug>:${DEBUG_FLAGS}>"
  21. )
  22. # evaluate custom variables
  23. function(eval vname vvalid vdefault)
  24. # is variable is set to the below value if its not already defined from the comand line
  25. set(VALID ${vvalid} CACHE INTERNAL "Possible values for ${vname}")
  26. set(${vname} ${vdefault} CACHE STRING "The barrier mode")
  27. # command for GUI shenanigans
  28. set_property(CACHE ${vname} PROPERTY STRINGS VALID)
  29. if(${vname} IN_LIST VALID)
  30. message(STATUS "Variable ${vname} = ${${vname}}")
  31. else()
  32. message(STATUS "Variable ${vname} has invalid value ${${vname}}")
  33. # set the fallback value for use in parent function
  34. unset(${vname} CACHE)
  35. message(STATUS "Fallback to default: ${vname} = ${vdefault}")
  36. set(${vname} ${vdefault} PARENT_SCOPE)
  37. endif()
  38. endfunction()
  39. eval(WSUPPRESS "suppress;show" "show")
  40. if($<STREQUAL:${BUFFER_LIMIT},suppress> EQUAL 1)
  41. add_compile_options("${SUPPRESS_WARNINGS}")
  42. endif()
  43. eval(BARRIER_MODE "global;local" "global")
  44. add_definitions(-DBARRIER_MODE="${BARRIER_MODE}")
  45. eval(BUFFER_LIMIT "unlimited;limited" "unlimited")
  46. add_definitions(-DBUFFER_LIMIT=$<STREQUAL:${BUFFER_LIMIT},limited>)
  47. eval(QUERY "simple;complex" "simple")
  48. add_definitions(-DQUERY=$<STREQUAL:${QUERY},simple>)
  49. eval(THREAD_FACTOR "1;2;3;4;5;6;7;8;9;10" "4")
  50. add_definitions(-DTHREAD_GROUP_MULTIPLIER=${THREAD_FACTOR})
  51. # build directory
  52. set(CMAKE_BINARY_DIR "../bin") #relative to inside build
  53. set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
  54. # include directories
  55. include_directories(src/utils)
  56. include_directories(src/algorithm)
  57. include_directories(src/algorithm/operators)
  58. # link libraries
  59. link_libraries(-lnuma -lpthread -l:libdml.a)
  60. # Add targets only below
  61. # specify build targets
  62. add_executable(MAXBench src/benchmark/MAX_benchmark.cpp)