10.2.4.4 : Le fichier CMakeLists.txt
Un peu de doc pour générer les sources de notre format HDF5 :
1 2 |
# Generate the HDF5 sources from build : # cd ../src/; phoenix_hdf5 -i RawHdf5.ph5; cd - |
Ensuite, nous créons notre bibliothèque de format de données :
1 2 |
add_library(compute_hdf5_data_format RawHdf5.cpp RawHdf5_hdf5.cpp) target_link_libraries(compute_hdf5_data_format ${HDF5_CXX_LIBRARIES}) |
On déclare le programme qui calcule la transformée de Fourier d'un fichier HDF5 :
1 2 |
add_executable(compute_cufft_on_hdf5 main.cpp) target_link_libraries(compute_cufft_on_hdf5 compute_hdf5_data_format ${HDF5_CXX_LIBRARIES} NVHPC::MATH NVHPC::CUDART) |
Quelques performances obtenues sur une A3000 :
1 2 3 |
#time ./src/compute_cufft_on_hdf5 fft.h5 test_2048000.h5 => 0m1,883s #time ./src/compute_cufft_on_hdf5 test_year_fft.h5 test_year_31457280.h5 => 0m2,128s #time ./src/compute_cufft_on_hdf5 test_year_fft.h5 test_year_31457280.h5 15360 => 0m2,216s |
Le programme qui permet de générer un fichier avec une distribution normale :
1 2 |
add_executable(create_hdf5_normal_distribution main_create_file.cpp) target_link_libraries(create_hdf5_normal_distribution compute_hdf5_data_format ${HDF5_CXX_LIBRARIES} NVHPC::MATH NVHPC::CUDART) |
Quelques performances obtenues sur une A3000 :
1 2 |
# time ./src/create_hdf5_normal_distribution test => 0m1,984s #time ./src/create_hdf5_normal_distribution test_year 31457280 => 0m2,031s |
Le CMakeLists.txt complet :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# Generate the HDF5 sources from build : # cd ../src/; phoenix_hdf5 -i RawHdf5.ph5; cd - add_library(compute_hdf5_data_format RawHdf5.cpp RawHdf5_hdf5.cpp) target_link_libraries(compute_hdf5_data_format ${HDF5_CXX_LIBRARIES}) add_executable(compute_cufft_on_hdf5 main.cpp) target_link_libraries(compute_cufft_on_hdf5 compute_hdf5_data_format ${HDF5_CXX_LIBRARIES} NVHPC::MATH NVHPC::CUDART) #time ./src/compute_cufft_on_hdf5 fft.h5 test_2048000.h5 => 0m1,883s #time ./src/compute_cufft_on_hdf5 test_year_fft.h5 test_year_31457280.h5 => 0m2,128s #time ./src/compute_cufft_on_hdf5 test_year_fft.h5 test_year_31457280.h5 15360 => 0m2,216s add_executable(create_hdf5_normal_distribution main_create_file.cpp) target_link_libraries(create_hdf5_normal_distribution compute_hdf5_data_format ${HDF5_CXX_LIBRARIES} NVHPC::MATH NVHPC::CUDART) # time ./src/create_hdf5_normal_distribution test => 0m1,984s #time ./src/create_hdf5_normal_distribution test_year 31457280 => 0m2,031s |