Skip to content

Stuff for the talk "Look ma, no CUDA! Programming GPUs with modern C++" at the Italian C++ Community meetup @ Modena, Italy

License

Notifications You must be signed in to change notification settings

nazavode/meetupcpp-may-2019

Repository files navigation

Look ma, no CUDA! Programming GPUs with modern C++

This repo contains all the stuff used during the talk I gave at the Italian C++ Community meetup in Modena, 2019-05-09 about GPUs and how SYCL allows us to finally program them in a sane way. Please feel free to steal anything you want.

Contents

Path What to expect
slides/ The slide deck. Nothing more, nothing less.
examples/ Show me the code.
cmake/ CMake helpers, mainly intended to support ComputeCpp and directly copied from its distribution.
external/ All git submodules related to external dependencies.

Getting Started

The CMakeLists.txt provided in this repo builds the following examples as separate executables:

Example Depends on WAT?
vector_add_sycl.cpp SYCL Parallel vector addition with linear accessors
vector_add_sycl_serial.cpp SYCL Serial vector addition with linear accessors
vector_add_tmp_sycl.cpp SYCL Templated (on value type) parallel vector addition with linear accessors
vector_add_tmp_sycl_serial.cpp SYCL Templated (on value type) serial vector addition with linear accessors
matrix_add_sycl.cpp SYCL Matrix (2-dimensions) parallel addition with 2-dimensional accessors
vector_add_opencl.cpp OpenCL Parallel vector addition using a linear kernel grid
vector_add_cuda.cu CUDA Parallel vector addition using a linear kernel grid

OpenCL and CUDA examples are built only if a suitable implementation can be found on the host while SYCL based ones are built anyway.

All of the SYCL based examples have been tested with the following implementations:

Please note that if SYCL cannot be found on the host, the triSYCL source tree will be automatically downloaded and included via git submodule.

Build configuration

The following CMake options are available:

Option Default Meaning
MEETUPCPP_SYCL triSYCL SYCL implementation to be used; allowed values are: triSYCL, ComputeCpp
MEETUPCPP_TRISYCL_DIR <repo>/external/triSYCL Path of the triSYCL source to be used when triSYCL is selected; defaults to vendored submodule
COMPUTECPP_BITCODE ptx64 Bitcode generation target for ComputeCpp; defaults to NVIDIA PTX
TRISYCL_OPENCL ON Use OpenCL execution backend; ignored when MEETUPCPP_SYCL isn't set to triSYCL or OpenCL isn't available

Credits

A lot of excellent charts and pitches have been taken directly from publicly available talks across the net, I've strived really hard to put proper credits on the slides but if you notice that something's missing please open an issue on this repo.

Thanks everyone for your help in making my slides more clear and understandable. I'm particularly grateful to (in order of appearance):

Resources

About

Stuff for the talk "Look ma, no CUDA! Programming GPUs with modern C++" at the Italian C++ Community meetup @ Modena, Italy

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages