Coder Social home page Coder Social logo

nlesc-recruit / cudawrappers Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 4.0 401 KB

C++ wrapper for the Nvidia C libraries (e.g. CUDA driver, nvrtc, cuFFT etc.)

Home Page: https://cudawrappers.readthedocs.io/en/latest/

License: Apache License 2.0

C++ 82.13% CMake 10.54% Python 7.19% Cuda 0.14%
accelerator amd cpp cuda driver-api gpu gpu-computing hip library nvidia rocm

cudawrappers's People

Contributors

abelsiqueira avatar benvanwerkhoven avatar bouweandela avatar csbnw avatar fdiblen avatar hannospreeuw avatar john-romein avatar jspaaks avatar laurasootes avatar loostrum avatar matmanc avatar pre-commit-ci[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

cudawrappers's Issues

Steps to compile and run the code

Let's describe the steps to compile the code and run it on various infrastructures (DAS5, DAS6, AWS, your local system). We can then use this information to create a developer documentation.

Fix the build system

In #43 we changed the folder structure which broke the build system. We need to adapt the buildsystem (CMakeLists.txt) and make sure we can build the code on system with CUDA.

Software and hardware configurations

We need a list of hardware and software used in development and testing. Please add the information below as a comment.

  • Infrastructure details: < AWS, DAS5, DAS6 etc.>
  • Operating system details:< Windows 11, Ubuntu 21.10, Amazon Linux, macOS>
  • CUDA version and GPU device (paste output of nvidia-smi):

New project checklist

Following 10-new-project.md, we decided/noted on the following:

  • Access
    • Everyone has access to the repo.
    • We may need an account for read-the-docs. In such case we will create an organization e-mail and add @bouweandela as admin
  • Pull Request
    • PR template exists
  • Debugging
    • We hope that the compiler will get most errors. We can use the guide.esciencecenter.nl/#/best_practices/language_guides/ccpp compiler flags in Static code analysis with GCC
    • We can use gdb and valgrind as tools for debugging during runtime.
  • Documentation
  • Virtual environments
    • We are not using virtual environments
  • Building
  • Linting
    • We don't have any linters set up
    • We will ask C++ experts and TechLeads at the center how they do linting (rules, services)
  • Running tests
    • We don't have any test
    • We need to setup the CI first
    • Writing unit test is out of the scope of the current sprint
    • We will skip this for now
  • Enforcing consistent styling
    • We need to know which rules are already in place
    • We will use EditorConfig

Update .gitignore

  • build folder - or maybe explicitly
    - CMakeFiles
    - cmake_install.cmake
    - CMakeCache.txt
    - Makefile

Possibly other things.

Rename the library and the repo

We should rename the library and use the same name for the repo for clarity.
Some suggestions:

  • cudacpp
  • cudacxx
  • cuda++
  • cudawrappers
  • your suggestion

List of ideas

General

1. Find a better name for the repo #8
1. Capitalization of the repo name? Should be consistent with name of the library IMO #8
1. fix copyright issue in README.md #11
1. Write something about the added value of the wrapper. What thing is now easier? #12
1. Describe what this code does and why a user needs it #12
1. Is there value to having a sibling repo (say, cuda-wrappers-it) with a release of cuda-wrappers as a submodule? #9
1. Make an RSD entry #13
1. add editorconfig #14
1. pre-commit hooks for clang clang-tidy https://github.com/pocc/pre-commit-hooks #15
1. Add a Citation file #17
1. Add contributing guide (CONTRIBUTING.md) #18
1. add a PR template, an issue template #19
1. Add Code of conduct #20
1. Add badges: fair-software, repo badge, license badge, rsd badge, CI badges, zenodo badge, checklist badge #21

Code improvements

1. organize the files and think about folder structure #9
1. Clean up the code: delete commented out code #24

CI

1. look for options to do static analysis and add a GH action #23
1. Add integration test programs See #9
1. CI with self-hosted runners to run the integration tests #25
1. continuous integration for at least the same linters as precommit hooks #26
1. add cffconvert-github-action #27

  1. check if PRs will be a problem for self-hosted runners

Documentation

1. look for alternatives for code documentation and build the documentation with CI #28
1. document how to build the documentation locally #29
1. notes on how to make a release #30
1. notes on precommit hooks #31
1. notes on running the linters locally #32
1. notes on how to build the library libcu.so #33
1. add list of software and hardware requirements #34
1. add list of supported CUDA versions and operating systems #34
1. add a section about 'alternatives' doing the same or similar thing #35
1. improve code documentation --> document functions #36

  1. think about remote development/debugging using VSCode's remote containers extension (https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
  2. Consider creating a conan package https://conan.io
  3. Any IDE extensions or configuration needed?

Build system

1. Is libcu.so a good name? #8
1. Can we steal some ideas from https://github.com/nlesc-dirac/sagecal/blob/master/CMakeLists.txt ? #9

API

1.The API is not covering all the functionalities. Decide how to proceed after talking to Ben. #37

Dissemination

  1. Add links to repos that use the wrappers maybe as a section in the README like "##Used by" #38
  2. Find out who can benefit from this work #39
  3. Think about events that this work can be advertised #40

Add badges

  • fair-software
  • repo badge
  • license badge
  • rsd badge
  • CI badges
  • zenodo badge

A first working example

We need a simple working example program that uses the library for testing the build system and as a test case.

The current plan is to construct a simple vector_add example program that uses both the CUDA Driver wrapper and NVRTC.

Overview of refactoring plan

To make the library easy for others to include in their own work, we propose to make a few changes.

We'd like to make the file tree structure more or less as follows:

.
├── cudawrappers
│   ├── CMakeLists.txt
│   ├── cudawrappers-config.cmake
│   ├── include
│   │   └── cudawrappers.hpp
│   ├── README.md
│   ├── src
│   │   └── cudawrappers.cpp
│   └── tests
│       ├── CMakeLists.txt
│       ├── convolution
│       │   ├── convolution.cpp
│       │   └── README.md
│       ├── README.md
│       └── vector_add
│           ├── README.md
│           ├── vector_add.cpp
│           └── vector_add.cu
└── usage-examples
    ├── cmake-pull
    │   ├── CMakeLists.txt
    │   └── helloworld.cpp
    ├── git-submodule
    │   ├── [email protected]
    │   └── helloworld.cpp
    ├── locally-installed
    │   ├── CMakeLists.txt
    │   └── helloworld.cpp
    ├── plain-copy
    │   ├── CMakeLists.txt
    │   ├── cudawrappers
    │   └── helloworld.cpp
    └── README.md
  1. We propose to name the library cudawrappers, this will be more consistent across various contexts in which the name will be used
  2. cudawrappers/:
    1. contains the library files, with an include/, src/ and tests/ directory. src/ should contain the definitions part of what used to be in files cu/cu.cc, cu/cu.h, cu/nvrtc.c and cu/nvrth.h in release 0.1.0; include/ contains the corresponding header files with all declarations. Any definition code that's currrently in cu/cu.h or cu/nvrth.h should be moved to somewhere under src/.
    2. We propose to use filename extensions .cpp for implementations and .hpp for header files.
    3. tests/ will contain a few tests, I've put some placeholder directories (convolution/ and vector_add/) there to illustrate the general idea.
  3. usage-examples/ contains some typical ways of how users of the library would access the functionality offered by the cudawrappers library, such as
    1. by including a plain copy of the library source code in their own source tree and building the complete project with CMake (plain-copy/);
    2. by including a git submodules copy of the library source code in their own source tree and building the complete project with CMake (git-submodule/);
    3. by locally installing the library to an arbitrary place on their system and building their project with CMake (locally-installed/);
    4. by having CMake pull in a copy of the library code from GitHub (cmake-pull/)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.