Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pkestene/cuda-proj-tmpl
A minimal cmake based project skeleton for developping a CUDA application
https://github.com/pkestene/cuda-proj-tmpl
cea cmake cuda gpu gpu-computing parallel-computing parallel-programming template
Last synced: 4 days ago
JSON representation
A minimal cmake based project skeleton for developping a CUDA application
- Host: GitHub
- URL: https://github.com/pkestene/cuda-proj-tmpl
- Owner: pkestene
- License: gpl-3.0
- Created: 2019-10-29T13:00:29.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-20T23:22:21.000Z (11 months ago)
- Last Synced: 2024-01-21T00:28:09.860Z (11 months ago)
- Topics: cea, cmake, cuda, gpu, gpu-computing, parallel-computing, parallel-programming, template
- Language: CMake
- Homepage:
- Size: 41 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cuda-proj-tmpl
A minimal cmake based project skeleton for developping a CUDA application
## Download this skeleton
```bash
git clone --recursive [email protected]:pkestene/cuda-proj-tmpl.git
```## Modern CMake and CUDA
See https://github.com/CLIUtils/modern_cmake
## Requirements
- cmake version >= 3.18 (when using nvcc)
- cmake version >= 3.22 (when using nvc++/nvhpc compiler)
- cuda toolkit## How to build with nvcc ?
```bash
# set default CUDA flags passed to nvcc (Nvidia compiler wrapper)
# at least one hardware architecture flags
export CUDAFLAGS="-arch=sm_75 --expt-extended-lambda"
mkdir build
cd build
cmake ..
make
# then you can run the application
./src/saxpy_cuda
```If you use cmake version >= 3.18, here is a slightly updated version using `CMAKE_CUDA_ARCHITECTURE`
to pass information about actual GPU hardware target architecture:```bash
# set default CUDA flags passed to nvcc (Nvidia compiler wrapper)
# at least one hardware architecture flags
export CUDAFLAGS="--expt-extended-lambda"
mkdir build
cd build
cmake -DCMAKE_CUDA_ARCHITECTURES="75" ..
make
# then you can run the application
./src/saxpy_cuda
```
# How to build with nvc++ (from nvhpc) ?```bash
# Warning, cmake 3.22.0 required
export CUDAFLAGS="--expt-extended-lambda"
export CXX=nvc++
mkdir build
cd build
cmake -DCMAKE_CUDA_HOST_COMPILER=nvc++ -DCMAKE_CUDA_ARCHITECTURES="75" ..
make
# then you can run the application
./src/saxpy_cuda
```