Skip to content

drisspg/simple_cuda

Repository files navigation

Simple Cuda

surfing

Small little project to track exercises as I go through the Programming Massively Parallel Processors book.

I also want to get some more familiarity with using Cmake from scratch, I wouldn't use any of this code its mostly for learning.

Structure

Code goes into 2 places. I plan on figuring out what utilities and generals things I want to that are agnostic to individual examples. These will go into src/. They will go into one of two places, currently this header only so I plan on putting stuff src/include. But I want to learn more about libraries so I might put some stuff in src/ and create a library that the examples will depend on.

The examples will go into examples/. I plan on using the CMakeLists.txt in the root to build all the examples. By default cmake will build every example, which is fine for now. I might add a way to build a specific example later.

Building

# In the root directory
mkdir build && cd build

# Configure the build
cmake -DCMAKE_BUILD_TYPE=RelWithDebugInfo -G Ninja ..

# Build the examples
ninja

There are some options that can be set when configuring the build. These are set with the -D flag when running cmake. For example to build in debug:

cmake -DCMAKE_BUILD_TYPE=Debug ..

Release

cmake -DCMAKE_BUILD_TYPE=Release ..

etc..

This will build all the examples and put the executables in build/bin.

Example E2E run for the tiled_mm example in chapter5

cd build

cmake -DCMAKE_BUILD_TYPE=RelWithDebugInfo -G Ninja ..

./bin/tiled_mm

# Profie with NCU
ncu -k "regex:Matrix" ./bin/tiled_mm  

Dependencies

  • Cmake
  • Ninja
  • Cuda
  • c++=std20 compilier

About

Learnings + Exercises from the PMPP book!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published