build systems combining cuda and
play

Build Systems: Combining CUDA and Modern CMake GTC, San Jose, CA - PowerPoint PPT Presentation

Build Systems: Combining CUDA and Modern CMake GTC, San Jose, CA May, 2017 Robert Maynard Kitware, Inc. Founded in 1998 by five former GE Research employees 136 current employees; 47 with PhDs Privately held, profitable from


  1. Build Systems: Combining CUDA and Modern CMake GTC, San Jose, CA May, 2017 Robert Maynard

  2. Kitware, Inc. • Founded in 1998 by five former GE Research employees • 136 current employees; 47 with PhDs • Privately held, profitable from creation • Offices – Clifton Park, NY – Carrboro, NC – Santa Fe, NM – Lyon, France

  3. Business Model: Open Source • Open-source Software – Normally BSD-licensed • Collaborative Research and Development • Technology Integration • Services, Support, Training, and Consulting

  4. 100� 10� 20� 30� 40� 50� 60� 70� 80� 90� 0� 2004-01� 2004-05� 2004-09� Why CMake? Everyone is using it 2005-01� 2005-05� cmake:� 2005-09� 2006-01� 2006-05� 2006-09� 2007-01� (Worldwide)� 2007-05� 2007-09� 2008-01� 2008-05� 2008-09� 2009-01� 2009-05� 2009-09� KDE 2006 – First Tipping Point! 2010-01� 2010-05� 2010-09� 2011-01� autoconf:� 2011-05� 2011-09� 2012-01� 2012-05� 2012-09� 2013-01� 2013-05� (Worldwide)� 2013-09� 2014-01� 2014-05� 2014-09� 2015-01� 2015-05� 2015-09� 2016-01� 2016-05� 2016-09� 2017-01�

  5. Why CMake? Everyone is using it 2016-17 – Second Tipping Point! • Introduction of CMake Server • QTCreator • VisualStudio 2017 • C++ Package Managers • Conan.io – provides helper scripts • Microsoft.vckpg • Native CUDA language support • CMake 3.5, 3.6, 3.7, and 3.8 in the last 14 months

  6. Classic CMake In reality most projects have a Directory very directory centric model Downard propagation – Include Directories – Compile Definitions Directory Directory – Find Packages Consumers have to know: – Does the dependency generate build tree files Executable Library B Library A – Does the dependency use any new external package

  7. Modern CMake • Modern CMake uses new(er) APIs • Modern CMake is target focused – Include Directories – Compile Options – Compile Definitions • Modern CMake introduces the concept of usage requirements – PUBLIC – PRIVATE – INTERFACE • Modern CMake is more declarative

  8. Let’s write CMake code! 8

  9. Let’s write CMake code! 9

  10. Shared Library Mixed Languages PRIVATE : only the given target will use it INTERFACE: only consuming targets use it BUILD_INTERFACE: used by consumers from this project or use the build directory INSTALL_INTERFACE: used by consumers after this target has been installed 10

  11. Shared Library Mixed Languages PUBLIC : given target and consuming targets will use it 11

  12. Interface Library 12

  13. Lets Run CMake 13

  14. Separable Compilation • Separable compilation allows CUDA code to call device functions implemented in other translation units • CMake 3.8 is capable of separable compilation and device linking – device linking of static libraries occurs when they are consumed by a shared library or executable 14

  15. Separable Compilation 15

  16. Separable Compilation 16

  17. Separable Compilation 17

  18. Export Configuration CMake is able to produce two types of config files 1. You have config files that are part of the build tree of a project. These contain build paths that can only be used on the current machine 2. You have installed config files that are meant to be machine relocatable. Large projects generally ship these as part of the SDK Export Configuration File 18

  19. Export Configuration 19

  20. Install Export Configuration 20

  21. The Proof 21

  22. The Proof 22

  23. CMake 3.9: MSVC • CMake 3.9 adds CUDA support to MSVC • Will require the CUDA MSBuild extensions 23

  24. CMake 3.9: OBJECT targets • CMake 3.9 is expanding OBJECT support • Will be – Installable – Exportable – Importable – Usable in Generator Expressions 24

  25. CMake 3.9: PTX • CMake 3.9 will add support for PTX files • Will be – Installable – Exportable – Importable – Usable in Generator Expressions 25

  26. CMake 3.9: PTX 26

  27. Now that you are inspired • Explore more CUDA+CMake snippets – https://gitlab.kitware.com/robertmaynard/cmake_cuda_tests 27

  28. Now that you are inspired • Read “how to write a CMake buildsystem ” – https://cmake.org/cmake/help/v3.8/manual/cmake-buildsystem.7.htmlExplore the CMake documentation • Explore the CMake documentation – https://www.cmake.org/cmake/help/v3.8/ 28

  29. Thank You! Thanks to NVIDIA for all the technical Robert Maynard support when developing this work robert.maynard@kitware.com @robertjmaynard Checkout out: Kitware @ www.kitware.com CMake @ www.cmake.org Please complete the Presenter Evaluation sent to you by email or through the GTC Mobile App. Your feedback is important!

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend