10.7.5 : The CMakeLists.txt file
Now, let's write the CMakeLists.txt file :
First we manage the project name and the minimal
cmake version for the file :
1
2
|
project(SgemmWrapper)
cmake_minimum_required(VERSION 3.0)
|
Then, we get the files used to build the module :
1
|
file(GLOB moduleSrc "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/*.py")
|
We call the
cmake function to create a module :
1
|
createPythonModule(install_sgemm_module setup.py ${moduleSrc})
|
Now, we call the
cmake function to run the python performances tests
1
2
|
runPythonExample(sgemmIntrinsicsPitchPython.py install_sgemm_module)
runPythonExample(sgemmNumpyPython.py install_asterics_hpc_module)
|
Finally, we make some plots to compare the Python performances with the C++ ones :
1
2
3
|
plotPerf("sgemmBasePy" sgemmNumpyPython sgemm_swap_Ofast sgemm_vectorize_Ofast)
plotPerf("sgemmSummaryPython" sgemmNumpyPython sgemm_swap_Ofast sgemm_vectorize_Ofast sgemmIntrinsicsPitchPython sgemm_intrinsicsPitch_O3)
|
The full
CMakeLists.txt file :
1
2
3
4
5
6
7
8
9
10
11
12
13
|
project(SgemmWrapper)
cmake_minimum_required(VERSION 3.0)
file(GLOB moduleSrc "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/*.py")
createPythonModule(install_sgemm_module setup.py ${moduleSrc})
runPythonExample(sgemmIntrinsicsPitchPython.py install_sgemm_module)
runPythonExample(sgemmNumpyPython.py install_asterics_hpc_module)
plotPerf("sgemmBasePy" sgemmNumpyPython sgemm_swap_Ofast sgemm_vectorize_Ofast)
plotPerf("sgemmSummaryPython" sgemmNumpyPython sgemm_swap_Ofast sgemm_vectorize_Ofast sgemmIntrinsicsPitchPython sgemm_intrinsicsPitch_O3)
|
You can download it
here.