Part 11 : What about branching ? (bonus)

You can find the associated presentation here.

Previous parts deal with kernels without conditions. This part show what are the consequencies of using conditions (or more generally branching) in kernels and what are the solutions to optimize them.

Let's create a directory 7-BranchingPredicator in the directory ExampleOptimisation for this example :
$ mkdir 7-BranchingPredicator
Do not forget to complete the ExampleOptimisation/CMakeLists.txt file :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
project(HPC_ASTERICS)
cmake_minimum_required(VERSION 3.0)

set(PYTHON_EXECUTABLE "python3" CACHE BOOL "Python program")

add_subdirectory(Performances)

include(runExample.cmake)
include(pythonCheck.cmake)

set(VECTOR_ALIGNEMENT 32)
add_definitions(-DVECTOR_ALIGNEMENT=${VECTOR_ALIGNEMENT})

add_subdirectory(0-CMakeHelloWorld)
add_subdirectory(AstericsHPC)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/AstericsHPC)

add_subdirectory(1-HadamardProduct)

add_subdirectory(3-Saxpy)
add_subdirectory(4-Reduction)
add_subdirectory(5-Barycentre)
add_subdirectory(6-Sgemm)
add_subdirectory(7-BranchingPredicator)