To get the most out of this book, you need to have a basic knowledge of C++. It's preferable if you have already been facing problems related to performance and are now looking for new tools and practices to have ready the next time you need to work with performance and C++.
There are a lot of code examples in this book. Some are taken from the real world, but most of them are artificial or vastly simplified examples to prove a concept rather than providing you with production-ready code. We have put all the code examples in source files divided by chapter so that it is fairly easy to find the examples you want to experiment with. If you open up the source code files, you will note that we have replaced most of the main() functions from the examples with test cases written with Google Test framework. We hope that this will help you rather than confuse you. It allowed us to write helpful descriptions for each example, and it also makes it easier to run all the examples from one chapter at once.
In order to compile and run the examples, you will need the following:
- A computer
- An operation system (we have verified the examples on Windows and macOS)
- A compiler (we have been using Clang, GCC, and Microsoft Visual C++)
- CMake
The CMake script provided with the example code will download and install further dependencies such as Boost, OpenCL, and Google Test.
During the writing of this book, it has been of great help for us to use Compiler Explorer, which is available at https://godbolt.org/. Compiler Explorer is an online compiler service that lets you try various compilers and versions. Try it out if you haven't already!