Code Monkey home page Code Monkey logo

cppcon2018-parallelism-class's Introduction

CppCon 2018: Parallel Programming with Modern C++: from CPU to GPU

This repository provides set up instructions and the exerises for the CppCon parallel programing class.

Pre-requisites

The majority of the exercises will require a only standard C++17 compliant compiler, however if for any reason you cannot use a C++17 compiler, using online compilers such as https://godbolt.org/ and https://wandbox.org/ will suffice.

Some later exercises, those which involve programming for the GPU will have some further dependencies. You will need to install OpenCL drivers for the GPU on your laptop and ComputeCpp SYCL (see instructions below). If you do not have a GPU on your laptop or cannot find suitable OpenCL drivers for your GPU then the CPU will suffice. If you have trouble setting this up or for any reason are unable to install the requirements on your laptop we are providing a docker image which will provide OpenCL drivers for Intel CPU and ComputeCpp SYCL (see instructions below).

Instructions

Installing OpenCL drivers:

Installing ComputeCpp:

Setting up docker image:

  • Install Docker CE from https://docs.docker.com/install/.

  • Pull the computecpp_ubunutu1604 docker image:

    docker pull aerialmantis/computecpp_ubuntu1604

  • Run the computecpp_ubuntu1604 docker image:

    docker run --rm -it aerialmantis/computecpp_ubuntu1604

Preparing this repository

  • Once you've got OpenCL and ComputeCpp SYCL setup or you have the docker image setup you can clone this repository to verify your setup and prepare yourself for the class.

  • Pull this repository:

    git clone https://github.com/AerialMantis/cppcon2018-parallelism-class.git

  • Create a build directory:

    cd cppcon2018-parallelism-class/ mkdir build cd build

  • Run CMake to configure solution (local setup):

    cmake ../ -G[Generator] -DCMAKE_BUILD_TYPE=[Debug/Release]

  • Note that if you are using an NVidia GPU, in order to use the experimental ComputeCpp SYCL support you must include the following in the above cmake command:

    -DCOMPUTECPP_BITCODE=ptx64

  • Run CMake to configure solution (docker image):

    cmake ../ -GNinja -DCMAKE_BUILD_TYPE=Debug -DOpenCL_LIBRARY=${OCL_LIB}/libOpenCL.so -DOpenCL_INCLUDE_DIR=${OCL_INC}

  • Build your solution:

    cmake --build

  • Verify your setup by running the hello world example:

    ./examples/hello_world

cppcon2018-parallelism-class's People

Contributors

aerialmantis avatar

Watchers

James Cloos avatar Michael Wong avatar

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.