kdevelop ide cuda support forcolumbia-openacademy.github.io/presentations/spring2015/kdevelo… ·...
TRANSCRIPT
![Page 1: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/1.jpg)
CUDA Support for KDevelop IDE
Matthew SuozzoZuokun Yu
![Page 2: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/2.jpg)
Warp SpeedIntroduction to CUDA
![Page 3: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/3.jpg)
What is CUDA?
➔ A Parallel Computing Platform◆ Based on C/C++◆ Leverages massively parallel graphics architecture
➔ Proprietary to NVIDIA Hardware
➔ Industry Standard◆ High-Performance Computing (HPC)◆ Simulation (Physics, Fluid Dynamics)
![Page 4: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/4.jpg)
What is CUDA?
![Page 5: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/5.jpg)
What is CUDA?
➔ Raw GPU Hardware◆ NVIDIA Fermi Processor
![Page 6: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/6.jpg)
What is CUDA?
➔ Take the Parallel Architecture… ◆ Streaming Multiprocessors◆ Dedicated Memory Banks
![Page 7: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/7.jpg)
What is CUDA?
➔ Useful Programming Abstractions◆ Independent Address Space◆ Hierarchical Execution Primitives
![Page 8: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/8.jpg)
CPUGPU
What is CUDA?
nvcc Compiler
CUDA C/C++ Code
PTX Device Executable
x86 Host Executable
![Page 9: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/9.jpg)
Even More Warp Speed Intro to KDevelop
![Page 10: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/10.jpg)
What is KDevelop
➔ Open Source IDE
➔ Written in C++
➔ Part of the KDECommunity
![Page 11: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/11.jpg)
KDE 5
➔ Based on Qt Framework◆ ಠ_ಠ
➔ Application Suite
➔ Plasma Desktop Environment
![Page 12: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/12.jpg)
Why KDevelop
➔ Very Low Memory Usage◆ 3x less than Eclipse
➔ It’s Fast◆ 2-3x faster than Eclipse
➔ Robust Plugin Ecosystem◆ Something for Every Language
![Page 13: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/13.jpg)
KDevelop: Plugins
![Page 14: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/14.jpg)
Development
![Page 15: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/15.jpg)
Our Tasks
➔ Basic Support for CUDA Files◆ KDevelop Recognizing .cu Source
➔ CUDA Syntax Highlighting
➔ CUDA Code Parsing
![Page 16: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/16.jpg)
KDevelop Quirks
➔ “Switch-to-Buddy”◆ Able to Switch Between .cu and .cuh Files◆ Handy Feature for Any C-like Language
➔ “Find-in-Files”◆ Ability to search for text in .cu/.cuh files
![Page 17: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/17.jpg)
Syntax Highlighting
➔ KATE Editor◆ Part of KDE
➔ XML Syntax Definition◆ Keywords◆ Types◆ Language Constructs◆ CUDA APIs◆ Typeahead
KATE the Woodpecker
![Page 18: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/18.jpg)
Code Parsing
➔ KDevelop <= 5.2◆ Used Custom C++ Parser◆ ~80,000 Lines of Code
➔ KDev-Clang◆ Pet Project of Milian Wolff (a Primary Maintainer)◆ Thin Abstraction Layer Over clang-c API◆ ~15,000 Lines of Code
➔ Why Clang?◆ Fast◆ Reliable◆ Actively Developed
wyvern the Dragon (LLVM)
![Page 19: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/19.jpg)
Code Parsing
➔ Developed on the KDev-Clang Plugin
➔ All Parsing Done through the “Definition-Use Chain”◆ Language-Agnostic Program Representation◆ Used for Syntax Checking, Identifier Indexing, Autocomplete, etc.
➔ Modified the Clang DUChain Builder◆ Essentially: Changed Conversion from Clang AST to KDevelop AST
![Page 20: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/20.jpg)
The Definition Use Chain
1) 2)Locked DU Chain
src 1 src 2 src 3
DU Context DU ContextDU Context
DU Context
DU Context
DU Context
TypeBuilder
Context Builder
Declaration Builder Use Builder
![Page 21: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/21.jpg)
Clang AST
➔ Basic AST Format◆ Type◆ Decl◆ Stmt
➔ Leverage Clang’s API
Features◆ CUDAKernelCallExpr◆ CUDAGlobalAttr
![Page 22: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/22.jpg)
Ongoing Development
➔ Type inference in Clang◆ Clang fixit
Qualfiied Identifier (kdevelop) DeclarationsClang Fixit
fixUnknownDeclaration ???
![Page 23: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/23.jpg)
Additional Clang Work
➔ C Preprocessor Code◆ Not Migrated to Clang API◆ Fixes, Refactors, Tests
➔ Additional Unit Tests◆ Easy Way to Get on a Maintainers’ Good Sides
![Page 24: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/24.jpg)
Post-Mortem
![Page 25: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/25.jpg)
Roadblocks: The Bleeding Edge
➔ KDE 5◆ Initial Released in July 2014◆ VERY Sparse Documentation
➔ Clang Parser◆ Substantial Backend Transition
➔ Maintaining the Environment◆ Development Toolchains Break
![Page 26: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/26.jpg)
Roadblocks: Code Sprawl
➔ Massive Project◆ KDevelop: ~160k Lines of Code◆ KDevPlatform: ~200k Lines of Code◆ KDev-Clang: ~15k Lines of Code (+ Clang API)
➔ Chicken & Egg◆ If the IDE isn’t working, hard to navigate the code◆ Hard to fix the IDE if the you can’t navigate the code
![Page 27: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/27.jpg)
Where is Our Code
➔ Vanilla KDevelop Focused on C++◆ Additional languages added as plugins
➔ CUDA as a Plugin◆ Initial steps towards full-fledged support
![Page 28: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/28.jpg)
CUDA Plugin?
![Page 29: KDevelop IDE CUDA Support forcolumbia-openacademy.github.io/presentations/spring2015/KDevelo… · ಠ_ಠ Application Suite Plasma Desktop Environment. Why KDevelop Very Low Memory](https://reader034.vdocuments.us/reader034/viewer/2022050120/5f5068060e24f3326872905d/html5/thumbnails/29.jpg)
Questions?Thank you to Alex Dymo, Adam, and Jae.