C++17 ParallelSTL: A Standardization Experience Report for CPU and GPU on SYCL

Play C++17 ParallelSTL: A Standardization Experience Report for CPU and GPU on SYCL
Sign in to queue

Description

The most significant improvement in C++17 will be Parallel Algorithms in the STL. But it is meant only for CPUs, as C++ does not define heterogeneous devices yet (though SG14 is working on that). How would you like to learn how to run Parallel STL algorithms on both CPU and GPU? Parallel STL is an implementation of the Technical Specification for C++ Extensions for Parallelism for both CPU and GPU with SYCL Heterogeneous C++ language. This technical specification describes a set of requirements for implementations of an interface that C++ programs may use to invoke algorithms with parallel execution. In practice, this specification allows users to specify execution policies to traditional STL algorithms which will enable the execution of those algorithms in parallel. The various policies can specify different kinds of parallel execution. For example, std::vector<int> v = ... // Traditional sequential sort: std::sort(vec.begin(), vec.end()); // Explicit sequential sort: std::sort(seq, vec.begin(), vec.end()); // Explicit parallel sort if possible: std::sort(par, vec.begin(), vec.end()); // Explicit parallel and vectorized sort if possible: std::sort(par_unseq, vec.begin(), vec.end()); So how does a Technical Specification become a Standard? As it turns out, in this case, not without harrowing twists and turns worthy of an Agatha Christie novel. This talk will also be the story behind the C++17 standardization process of the Parallelism TS and why we made so many changes. While it started life as a Technical Specification (TS), did you know all the changes we made to it before we added it to C++17 and why? For example, we changed the names of the execution policies, removed exception handling support, disabled dynamic execution, unified some of the numeric algorithm names, allowed copying arguments to function objects given to parallel algorithms, and addressed complexity and iterator concerns as we lived through it as a member of SG1 and the editor of several TSes. The implementation is available here: https://github.com/KhronosGroup/SyclParallelSTL/blob/master/README.md

Day:

2

Session Type:

Presentation

Code:

132

Embed

Download

Download this episode

Download captions

The Discussion

Add Your 2 Cents