@@ -7,9 +7,9 @@ using the Khronos SYCL standard.
77What is Parallel STL
88-----------------------
99
10- Parallel STL is an implementation of the Technical Specification for C++
11- Extensions for Parallelism, current document number
12- [ N4409 ] ( http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4409 .pdf ) .
10+ Parallel STL is an implementation of the Technical Specification for C++
11+ Extensions for Parallelism, current document number
12+ [ N4507 ] ( http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4507 .pdf ) .
1313This technical specification describes _ a set of requirements for
1414implementations of an interface that computer programs written in
1515C++ programming language may use to invoke algorithms with parallel
@@ -19,27 +19,25 @@ offers the opportunity to users to specify _execution policies_ to
1919traditional STL algorithms, which will enable the execution of
2020those algorithms in parallel.
2121The various policies can specify different kinds of parallel execution.
22- For example,
23-
24- ``` c++
25- std::vector<int > v = ...
26- // Traditional sequential sort
27- std::sort (vec.begin(), vec.end());
28- // Explicit sequential sort
29- std::sort(seq, vec.begin(), vec.end());
30- // Explicit parallel sort
31- std::sort(par, vec.begin(), vec.end());
32- ```
22+ For example,
23+
24+ std::vector<int> v = ...
25+ // Traditional sequential sort
26+ std::sort(vec.begin(), vec.end());
27+ // Explicit sequential sort
28+ std::sort(seq, vec.begin(), vec.end());
29+ // Explicit parallel sort
30+ std::sort(par, vec.begin(), vec.end());
31+
3332
3433What is SYCL
3534----------------------
3635
37- [SYCL](https://www.khronos.org/opencl/sycl) is a royalty-free,
36+ [ SYCL] ( https://www.khronos.org/opencl/sycl ) is a royalty-free,
3837cross-platform C++ abstraction layer that builds on top of OpenCL.
3938SYCL enables single-source development of OpenCL applications in C++ whilst
4039enabling traditional host compilers to produce standard C++ code.
4140
42-
4341The SyclSTL
4442---------------------
4543
@@ -50,11 +48,11 @@ Currently, the following STL algorithms are implemented:
5048* sort : Bitonic sort for ranges which size is power of two, sequential sort
5149otherwise.
5250* transform : Parallel iteration (one thread per element) on the device.
53- * for_each : Parallel iteration (one thread per element) on the device.
51+ * for \_ each : Parallel iteration (one thread per element) on the device.
5452
5553Some optimizations are implemented, for example, the ability of passing
5654iterators to buffers rather than STL containers to reduce the amount of
57- information copied in and out, and the ability of specifying a queue
55+ information copied in and out, and the ability of specifying a queue
5856to the SYCL policy so that queue is used for the various kernels (potentially
5957enabling asynchronous execution of the calls).
6058
@@ -64,14 +62,38 @@ Building the project
6462The project uses CMake in order to produce build files.
6563Simply create a build directory and run CMake as follows:
6664
67- ```
68- $ mkdir build
69- $ cd build
70- $ cmake ../ -DSYCL_PATH=/path/to/sycl \
71- -DOPENCL_ROOT_DIR=/path/to/opencl/dir
72- $ make
73- ```
65+ $ mkdir build
66+ $ cd build
67+ $ cmake ../ -DSYCL_PATH=/path/to/sycl \
68+ -DOPENCL_ROOT_DIR=/path/to/opencl/dir
69+ $ make
70+
7471Usual CMake options are available (e.g. building debug or release).
7572
76- If Google Mock is found in external/gmock then the unit tests are build.
73+ If Google Mock is found in external/gmock, a set of unit tests is built.
74+ Unit tests can be run by running Ctest in the binary directory.
75+
76+ Building the documentation
77+ ----------------------------
78+
79+ Source code is documented using Doxygen.
80+ To build the documentation as an HTML file, navigate to the doc
81+ directory and run doxygen from there.
82+
83+ $ cd doc
84+ $ doxygen
85+
86+ This will generate the html pages inside the doc\_ output directory.
87+
88+ Limitations
89+ ------------
90+
91+ The Lambda functions that you can pass to the algorithms have the same
92+ restrictions as any SYCL kernel.
93+
94+ While using lambda functions, the compiler needs to find a name for that lambda
95+ function. To provide a lambda name, the user do the following:
7796
97+ cl::sycl::queue q;S
98+ sycl::sycl_execution_policy<class SortAlgorithm3> snp(q);
99+ sort(snp, v.begin(), v.end(), [=](int a, int b) { return a >= b; });
0 commit comments