PacktLib: OpenCL Programming by Example

OpenCL Programming by Example

Credits

About the Authors

About the Reviewers

www.PacktPub.com

Preface

Hello OpenCL

Advances in computer architecture

Different parallel programming techniques

Introduction to OpenCL

OpenCL components

An example of OpenCL program

Summary

References

OpenCL Architecture

Platform model

Platform versions

Execution model

Memory model

OpenCL ICD

Application scaling

Summary

OpenCL Buffer Objects

Memory objects

Creating subbuffer objects

Histogram calculation

Reading and writing buffers

Copying buffers

Mapping buffer objects

Querying buffer objects

Undefined behavior of the cl_mem objects

Summary

OpenCL Images

Creating images

Samplers

Reading and writing buffers

Copying and filling images

Mapping image objects

Querying image objects

Image histogram computation

Summary

OpenCL Program and Kernel Objects

Creating program objects

Creating kernel objects

Summary

Events and Synchronization

OpenCL events and monitoring these events

OpenCL event synchronization models

Coarse-grained synchronization

Event-based or fine-grained synchronization

Getting information about cl_event

User-created events

Event profiling

Memory fences

Summary

OpenCL C Programming

Built-in data types

Aliasing rules

Conversions and type casts

Operators

Address space qualifiers

Image access qualifiers

Storage class specifiers

Built-in functions

Summary

Basic Optimization Techniques with Case Studies

Finding the performance of your program?

Case study – matrix multiplication

Case study – Histogram calculation

Finding the scope of the use of OpenCL

General tips

Summary

Image Processing and OpenCL

Image representation

Implementing image filters

OpenCL implementation of filters

JPEG compression

Summary

References

OpenCL-OpenGL Interoperation

Introduction to OpenGL

Defining Interoperation

Implementing Interoperation

Summary

Case studies – Regressions, Sort, and KNN

Regression with least square curve fitting

Bitonic sort

k-Nearest Neighborhood (k-NN) algorithm

Summary

Index