3.3.3.4 : Le CMakeLists.txt

Écrivons le fichier CMakeLists.txt :

Commençons par inclure les fonctions que nous utiliserons pour lancer les tests de performance et afficher les résultats :
1
include(runExample.cmake)


Ajoutons un programme pour appeler notre produit de Hadamad :
1
2
3
4
5
6
7
8
9
10
cuda_add_executable("hadamard_product_gpu_cuda" main.cpp)
target_link_libraries(hadamard_product_gpu_cuda hadamard_product_cuda asterics_hpc_cuda ${CUDA_LIBRARIES})
runExample(hadamard_product_gpu_cuda)

cuda_add_executable("hadamard_product_gpu_cuda_kernel" main_kernel.cpp)
target_link_libraries(hadamard_product_gpu_cuda_kernel hadamard_product_cuda asterics_hpc_cuda ${CUDA_LIBRARIES})
runExample(hadamard_product_gpu_cuda_kernel)

plotPerf("hadamardCuda" hadamard_product_gpu_cuda)
plotPerf("hadamardKernel" hadamard_product_gpu_cuda hadamard_product_gpu_cuda_kernel)


Le fichier CMakeLists.txt complet.

1
2
3
4
5
6
7
8
9
10
11
include(runExample.cmake)
cuda_add_executable("hadamard_product_gpu_cuda" main.cpp)
target_link_libraries(hadamard_product_gpu_cuda hadamard_product_cuda asterics_hpc_cuda ${CUDA_LIBRARIES})
runExample(hadamard_product_gpu_cuda)

cuda_add_executable("hadamard_product_gpu_cuda_kernel" main_kernel.cpp)
target_link_libraries(hadamard_product_gpu_cuda_kernel hadamard_product_cuda asterics_hpc_cuda ${CUDA_LIBRARIES})
runExample(hadamard_product_gpu_cuda_kernel)

plotPerf("hadamardCuda" hadamard_product_gpu_cuda)
plotPerf("hadamardKernel" hadamard_product_gpu_cuda hadamard_product_gpu_cuda_kernel)


Vous pouvez télécharger le fichier ici.