1. Main Page
  2. 1. Introduction
    ❱
    1. 1.1. Utilisation de bibliothèques
    2. 1.2. Ensemble de fonctions CMake
    3. 1.3. CMakeLists.txt pricipal du projet
  3. 2. La réaction de diffusion de Gray Scott
  4. 3. Programmation GPU
    ❱
    1. 3.1. Petit tour d'horizon d'un GPU
    2. 3.2. Récupération des informations GPU
      ❱
      1. 3.2.1. Le main.cpp
      2. 3.2.2. Le CMakeLists.txt
      3. 3.2.3. La compilation
      4. 3.2.4. Les informations sur un GPU local
    3. 3.3. Produit de Hadamard GPU en Cuda
      ❱
      1. 3.3.1. Une mini bibliothèque Cuda
        ❱
        1. 3.3.1.1. L'allocation de tableaux
          ❱
          1. 3.3.1.1.1. Le fichier asterics_alloc.h
          2. 3.3.1.1.2. Le fichier asterics_alloc.cpp
        2. 3.3.1.2. Récupération d'information du GPU hôte avec Cuda
          ❱
          1. 3.3.1.2.1. Le fichier asterics_cuda.h
          2. 3.3.1.2.2. Le fichier asterics_cuda.cpp
        3. 3.3.1.3. Une méthode qui vérifie si un appel Cuda réussit
          ❱
          1. 3.3.1.3.1. Le fichier phoenix_cuda_check.h
          2. 3.3.1.3.2. Le fichier phoenix_cuda_check.c
        4. 3.3.1.4. Un chronomètre
          ❱
          1. 3.3.1.4.1. Le fichier timer.h
          2. 3.3.1.4.2. Le fichier timer.cpp
      2. 3.3.2. Les sources de notre projet
        ❱
        1. 3.3.2.1. Le kernel
          ❱
          1. 3.3.2.1.1. Le fichier hadamard_product_cuda.h
          2. 3.3.2.1.2. Le fichier hadamard_product_cuda.cu
        2. 3.3.2.2. Le CMakeLists.txt
      3. 3.3.3. Les programmes de tests
        ❱
        1. 3.3.3.1. Avec les transfert de données
        2. 3.3.3.2. Sans les transfert de données
        3. 3.3.3.3. Les fonctions qui permettent de lancer et afficher les résultats
        4. 3.3.3.4. Le CMakeLists.txt
      4. 3.3.4. Le CMakeLists.txt principal
      5. 3.3.5. Compilation
      6. 3.3.6. Performances
    4. 3.4. Produit de Hadamard GPU en C++17
      ❱
      1. 3.4.1. Pourquoi NVC++ ?
      2. 3.4.2. Structure du projet
      3. 3.4.3. Les sources de notre projet
        ❱
        1. 3.4.3.1. Le CMakeLists pricipal du projet
        2. 3.4.3.2. Le fichier gitignore
        3. 3.4.3.3. Le fichier README.md
        4. 3.4.3.4. Les fonctions CMake
        5. 3.4.3.5. Le dossier src
          ❱
          1. 3.4.3.5.1. Le header hadamard.h
          2. 3.4.3.5.2. Les sources hadamard.cpp
          3. 3.4.3.5.3. Le programme main.cpp
          4. 3.4.3.5.4. Le CMakeLists.txt
      4. 3.4.4. Compilation basiques et performances sur CPU
        ❱
        1. 3.4.4.1. Compilation
        2. 3.4.4.2. Performances
      5. 3.4.5. Compilation nvc++ et performances sur CPU
        ❱
        1. 3.4.5.1. Compilation
        2. 3.4.5.2. Performances
      6. 3.4.6. Comparaison de performances
      7. 3.4.7. Avec un GPU A100
        ❱
        1. 3.4.7.1. Lancer un job avec HT Condor
          ❱
          1. 3.4.7.1.1. Un exemple simple
          2. 3.4.7.1.2. Un exemple avec GPU
          3. 3.4.7.1.3. Récupération des Compute capabilities avec un job
          4. 3.4.7.1.4. Produit de Hadamard Cuda sur MUST
          5. 3.4.7.1.5. Gray Scott Cuda sur MUST
          6. 3.4.7.1.6. Test un peu plus fiables
          7. 3.4.7.1.7. Produit de Hadamard NVC++ sur MUST
  5. 4. La réation de Gray Scott en GPU avec Cuda
    ❱
    1. 4.1. Le projet Gray Scott sur GPU avec cuda
      ❱
      1. 4.1.1. Le CMakeLists.txt pricipal du projet
      2. 4.1.2. Le fichier .gitignore
      3. 4.1.3. Le fichier README.md
      4. 4.1.4. Les fonctions CMake
      5. 4.1.5. Une mini bibliothèque Cuda (encore)
        ❱
        1. 4.1.5.1. L'allocation de tableaux
          ❱
          1. 4.1.5.1.1. Le fichier asterics_alloc.h
          2. 4.1.5.1.2. Le fichier asterics_alloc.cpp
        2. 4.1.5.2. Récupération d'information du GPU hôte avec Cuda
          ❱
          1. 4.1.5.2.1. Le fichier asterics_cuda.h
          2. 4.1.5.2.2. Le fichier asterics_cuda.cpp
        3. 4.1.5.3. Une méthode qui vérifie si un appel Cuda réussit
          ❱
          1. 4.1.5.3.1. Le fichier phoenix_cuda_check.h
          2. 4.1.5.3.2. Le fichier phoenix_cuda_check.c
        4. 4.1.5.4. Un chronomètre
          ❱
          1. 4.1.5.4.1. Le fichier timer.h
          2. 4.1.5.4.2. Le fichier timer.cpp
      6. 4.1.6. Le format de données
        ❱
        1. 4.1.6.1. Le header MatrixHdf5.h
        2. 4.1.6.2. La source MatrixHdf5.cpp
        3. 4.1.6.3. Fonction d'initialisation
          ❱
          1. 4.1.6.3.1. Le fichier header
          2. 4.1.6.3.2. Le fichier source
        4. 4.1.6.4. Le CMakeLists.txt
      7. 4.1.7. Les calculs
        ❱
        1. 4.1.7.1. Le header
        2. 4.1.7.2. Le fichier Cuda
        3. 4.1.7.3. Le CMakeLists.txt
      8. 4.1.8. Les programmes
        ❱
        1. 4.1.8.1. L'implémentation classique
          ❱
          1. 4.1.8.1.1. Les includes
          2. 4.1.8.1.2. La définition des arguments du programme
          3. 4.1.8.1.3. La fonction générale du programme
          4. 4.1.8.1.4. La fonction principale du programme
        2. 4.1.8.2. L'implémentation stupide
          ❱
          1. 4.1.8.2.1. Les includes
          2. 4.1.8.2.2. La définition des arguments du programme
          3. 4.1.8.2.3. La fonction générale du programme
          4. 4.1.8.2.4. La fonction principale du programme
    2. 4.2. Compilation
    3. 4.3. Performance
  6. 5. La réation de Gray Scott en GPU avec C++17
    ❱
    1. 5.1. Le NVidia HPC_SDK
    2. 5.2. Le compilateur nvc++
    3. 5.3. Un exemple nvc++ en C++17 ultra simple
      ❱
      1. 5.3.1. Le fichier main.cpp
      2. 5.3.2. Le fichier CMakeLists.txt
      3. 5.3.3. Le fichier .gitignore
      4. 5.3.4. Un exemple de script pour compiler sur MUST
      5. 5.3.5. Un script pour lancer tous nos jobs
    4. 5.4. Un exemple avec plusieurs fichiers
      ❱
      1. 5.4.1. Le fichier hadamard_product.h
      2. 5.4.2. Le fichier hadamard_product.cpp
      3. 5.4.3. Le fichier main.cpp
      4. 5.4.4. Le fichier CMakeLists.txt
      5. 5.4.5. Le fichier .gitignore
      6. 5.4.6. Un exemple de script pour compiler sur MUST
      7. 5.4.7. Un script pour lancer tous nos jobs
    5. 5.5. Un exemple avec une bibliothèque
      ❱
      1. 5.5.1. Le fichier hadamard_product.h
      2. 5.5.2. Le fichier hadamard_product.cpp
      3. 5.5.3. Le fichier main.cpp
      4. 5.5.4. Le fichier CMakeLists.txt
      5. 5.5.5. Le fichier .gitignore
      6. 5.5.6. Un exemple de script pour compiler sur MUST
      7. 5.5.7. Un script pour lancer tous nos jobs
    6. 5.6. Test de performance avec un produit de Hadamard
      ❱
      1. 5.6.1. Le fichier hadamard_product.h
      2. 5.6.2. Le fichier hadamard_product.cpp
      3. 5.6.3. Le fichier timer.h
      4. 5.6.4. Le fichier timer.cpp
      5. 5.6.5. Le fichier main.cpp
      6. 5.6.6. Le fichier CMakeLists.txt
      7. 5.6.7. Le fichier .gitignore
      8. 5.6.8. Un exemple de script pour compiler sur MUST
      9. 5.6.9. Un script pour lancer tous nos jobs
      10. 5.6.10. Performances obtenues sur MUST
    7. 5.7. Fourberies et subtilités de ce cher nvc++
    8. 5.8. Implémentation avec des std::vector
      ❱
      1. 5.8.1. Le CMakeLists.txt pricipal du projet
      2. 5.8.2. Le fichier .gitignore
      3. 5.8.3. Le fichier README.md
      4. 5.8.4. Les fonctions CMake
      5. 5.8.5. Format de données et initialisation
        ❱
        1. 5.8.5.1. Le header MatrixHdf5.h
        2. 5.8.5.2. La source MatrixHdf5.cpp
        3. 5.8.5.3. Fonction d'initialisation
          ❱
          1. 5.8.5.3.1. Le fichier header
          2. 5.8.5.3.2. Le fichier source
        4. 5.8.5.4. Le CMakeLists.txt
      6. 5.8.6. Les calculs
        ❱
        1. 5.8.6.1. Le header gray_scott_nvcpp.h
        2. 5.8.6.2. Le fichier source gray_scott_nvcpp.cpp
        3. 5.8.6.3. Le CMakeLists.txt
      7. 5.8.7. Le programme
        ❱
        1. 5.8.7.1. Le main.cpp
          ❱
          1. 5.8.7.1.1. Les includes
          2. 5.8.7.1.2. La définition des arguments du programme
          3. 5.8.7.1.3. La fonction générale du programme
          4. 5.8.7.1.4. La fonction principale du programme
        2. 5.8.7.2. Le CMakeLists.txt
      8. 5.8.8. Performances
        ❱
        1. 5.8.8.1. Pour 1000x34 images
        2. 5.8.8.2. Pour 5x68000 images
        3. 5.8.8.3. Pour 5x680000 images
      9. 5.8.9. Comparaisons avec CUDA
        ❱
        1. 5.8.9.1. Pour 1000x34 images
        2. 5.8.9.2. Pour 5x68000 images
        3. 5.8.9.3. Pour 5x680000 images
      10. 5.8.10. Conclusion

5.8.7.1 : Le main.cpp

  • 5.8.7.1.1) Les includes
  • 5.8.7.1.2) La définition des arguments du programme
  • 5.8.7.1.3) La fonction générale du programme
  • 5.8.7.1.4) La fonction principale du programme
Écrivons le fichier main.cpp :