Chapter 4. Basic OpenCL Examples
This chapter discusses some basic OpenCL examples, which allow us to summarize our understanding of the specification discussed in Chapter 2. These examples demonstrate the programming steps needed to write complete OpenCL applications. We also include an example using the C++ Wrapper API for developers who have a preference toward C++. The examples discussed here can serve as baselines to compare the optimized versions, which can be written after studying later chapters.
Keywords C++, example program, matrix multiplication, OpenCL

Introduction

In Chapter 2, we discussed the OpenCL specification and how it can be used to implement programs for heterogeneous platforms. Chapter 3 covered the architecture of some possible ...

Get Heterogeneous Computing with OpenCL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.