PacktLib: OpenCL Parallel Programming Development Cookbook

OpenCL Parallel Programming Development Cookbook

Credits

About the Author

About the Reviewers

www.PacktPub.com

Preface

Using OpenCL

Introduction

Querying OpenCL platforms

Querying OpenCL devices on your platform

Querying for OpenCL device extensions

Querying OpenCL contexts

Querying an OpenCL program

Creating OpenCL kernels

Creating command queues and enqueuing OpenCL kernels

Understanding OpenCL Data Transfer and Partitioning

Introduction

Creating OpenCL buffer objects

Retrieving information about OpenCL buffer objects

Creating OpenCL sub-buffer objects

Retrieving information about OpenCL sub-buffer objects

Understanding events and event-synchronization

Copying data between memory objects

Using work items to partition data

Understanding OpenCL Data Types

Introduction

Initializing the OpenCL scalar data types

Initializing the OpenCL vector data types

Using OpenCL scalar types

Understanding OpenCL vector types

Vector and scalar address spaces

Configuring your OpenCL projects to enable the double data type

Using OpenCL Functions

Introduction

Storing vectors to an array

Loading vectors from an array

Using geometric functions

Using integer functions

Using floating-point functions

Using trigonometric functions

Arithmetic and rounding in OpenCL

Using the shuffle function in OpenCL

Using the select function in OpenCL

Developing a Histogram OpenCL program

Introduction

Implementing a Histogram in C/C++

OpenCL implementation of the Histogram

Work item synchronization

Developing a Sobel Edge Detection Filter

Introduction

Understanding the convolution theory

Understanding convolution in 1D

Understanding convolution in 2D

OpenCL implementation of the Sobel edge filter

Understanding profiling in OpenCL

Developing the Matrix Multiplication with OpenCL

Introduction

Understanding matrix multiplication

OpenCL implementation of the matrix multiplication

Faster OpenCL implementation of the matrix multiplication by thread coarsening

Faster OpenCL implementation of the matrix multiplication through register tiling

Reducing global memory via shared memory data prefetching in matrix multiplication

Developing the Sparse Matrix Vector Multiplication in OpenCL

Introduction

Solving SpMV (Sparse Matrix Vector Multiplication) using the Conjugate Gradient Method

Understanding the various SpMV data storage formats including ELLPACK, ELLPACK-R, COO, and CSR

Understanding how to solve SpMV using the ELLPACK-R format

Understanding how to solve SpMV using the CSR format

Understanding how to solve SpMV using VexCL

Developing the Bitonic Sort with OpenCL

Introduction

Understanding sorting networks

Understanding bitonic sorting

Developing bitonic sorting in OpenCL

Developing the Radix Sort with OpenCL

Introduction

Understanding the Radix sort

Understanding the MSD and LSD Radix sorts

Understanding reduction

Developing the Radix sort in OpenCL

Index