Skip to content

Commit d279736

Browse files
GordonGordon
authored andcommitted
Update README and CMake to support to directory structure.
1 parent 8f91893 commit d279736

File tree

2 files changed

+41
-8
lines changed

2 files changed

+41
-8
lines changed

CMakeLists.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,35 @@ project (cppcon2018-parallelism-class)
1919

2020
# Options
2121

22-
option(CPPCON_SYCL_EXAMPLES "Requires ComputeCpp for SYCL examples" ON)
22+
option(CPPCON_ENABLE_SYCL "Enable SYCL. Requires ComputeCpp for SYCL examples" ON)
23+
option(CPPCON_ENABLE_SOLUTIONS "Enable soltuions." OFF)
2324

2425
# Dependencies
2526

2627
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
2728

2829
find_package(Threads REQUIRED)
29-
if (${CPPCON_SYCL_EXAMPLES})
30+
if (${CPPCON_ENABLE_SYCL})
3031
find_package(ComputeCpp REQUIRED)
3132
endif()
3233

3334
# Headers
3435

3536
include_directories(${CMAKE_SOURCE_DIR}/include)
3637
include_directories(${CMAKE_SOURCE_DIR}/external/catch2)
38+
include_directories(${CMAKE_SOURCE_DIR}/external/stb)
3739

3840
file(GLOB PARALLELISM_INCLUDES ${CMAKE_SOURCE_DIR}/include/*.h)
3941
source_group("Parallelism Headers" FILES ${PARALLELISM_INCLUDES})
4042

41-
# Examples
43+
# Samples, sources and solutions
4244

4345
enable_testing()
4446

45-
add_subdirectory(examples)
47+
include(${CMAKE_MODULE_PATH}/TestingFunctions.cmake)
4648

49+
add_subdirectory(samples)
50+
add_subdirectory(source)
51+
if (${CPPCON_ENABLE_SOLUTIONS})
52+
add_subdirectory(solutions)
53+
endif()

README.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ The majority of the exercises will require a only standard C++17 compliant compi
88

99
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).
1010

11+
## Exercises
12+
13+
| Exercise | Source | Solution |
14+
|----------|--------|----------|
15+
| [SYCL 00: Installing ComputeCpp ][exercise-sycl-00] | NA | NA |
16+
| [SYCL 01: Configuring a Queue ][exercise-sycl-01] | [source][source-sycl-01] | [solution][solution-sycl-01] |
17+
| [SYCL 02: Hello World ][exercise-sycl-02] | [source][source-sycl-02] | [solution][solution-sycl-02] |
18+
| [SYCL 03: Vector Add ][exercise-sycl-03] | [source][source-sycl-03] | [solution][solution-sycl-03] |
19+
1120
## Instructions
1221

1322
### Installing OpenCL drivers:
@@ -46,7 +55,7 @@ Some later exercises, those which involve programming for the GPU will have some
4655

4756
* Pull this repository:
4857

49-
`git clone https://github.com/AerialMantis/cppcon2018-parallelism-class.git`
58+
`git clone https://github.com/AerialMantis/cppcon-parallelism-class.git`
5059

5160
* Create a build directory:
5261

@@ -62,13 +71,17 @@ Some later exercises, those which involve programming for the GPU will have some
6271

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

65-
* 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:
74+
* 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:
6675

6776
`-DCOMPUTECPP_BITCODE=ptx64`
6877

69-
* Note that you can disable the SYCL tests in the case you are not able to use ComputeCpp by adding the following in the above cmake command:
78+
* Note that you can enable building the solutions by adding the following in the above CMake command:
79+
80+
`-DCPPCON_ENABLE_SYCL=OFF`
81+
82+
* Note that you can disable the SYCL tests in the case you are not able to use ComputeCpp by adding the following in the above CMake command:
7083

71-
`-DCPPCON_SYCL_EXAMPLES=OFF`
84+
`-DCPPCON_ENABLE_SOLUTIONS=OFF`
7285

7386
* Build your solution:
7487

@@ -86,3 +99,16 @@ Some later exercises, those which involve programming for the GPU will have some
8699
`RUN add-apt-repository ppa:ubuntu-toolchain-r/test`
87100
`RUN apt-get update`
88101
`RUN apt-get install g++-8`
102+
103+
[exercise-sycl-00]: ./docs/sycl_00_setting_up_computecpp.md
104+
[exercise-sycl-01]: ./docs/sycl_01_configuring_a_queue.md
105+
[exercise-sycl-02]: ./docs/sycl_02_hello_world.md
106+
[exercise-sycl-03]: ./docs/sycl_03_vector_add.md
107+
108+
[source-sycl-01]: ./source/sycl_01_configuring_a_queue.md
109+
[source-sycl-02]: ./source/sycl_02_hello_world.md
110+
[source-sycl-03]: ./source/sycl_03_vector_add.md
111+
112+
[solution-sycl-01]: ./solutions/sycl_01_configuring_a_queue.md
113+
[solution-sycl-02]: ./solutions/sycl_02_hello_world.md
114+
[solution-sycl-03]: ./solutions/sycl_03_vector_add.md

0 commit comments

Comments
 (0)