OpenCL Parallel Programming Development Cookbook


OpenCL Parallel Programming Development Cookbook
eBook: $32.99
Formats: PDF, PacktLib, ePub and Mobi formats
$28.04
save 15%!
Print + free eBook + free PacktLib access to the book: $87.98    Print cover: $54.99
$54.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters
  • Learn about parallel programming development in OpenCL and also the various techniques involved in writing high-performing code
  • Find out more about data-parallel or task-parallel development and also about the combination of both
  • Understand and exploit the underlying hardware features like processor registers and caches that run potentially tens of thousands of threads across the processors

Book Details

Language : English
Paperback : 302 pages [ 235mm x 191mm ]
Release Date : August 2013
ISBN : 1849694524
ISBN 13 : 9781849694520
Author(s) : Raymond Tay
Topics and Technologies : All Books, Application Development, Cookbooks, Web Graphics & Video

Table of Contents

Preface
Chapter 1: Using OpenCL
Chapter 2: Understanding OpenCL Data Transfer and Partitioning
Chapter 3: Understanding OpenCL Data Types
Chapter 4: Using OpenCL Functions
Chapter 5: Developing a Histogram OpenCL program
Chapter 6: Developing a Sobel Edge Detection Filter
Chapter 7: Developing the Matrix Multiplication with OpenCL
Chapter 8: Developing the Sparse-Matrix Vector Multiplication in OpenCL
Chapter 9: Developing the Bitonic Sort with OpenCL
Chapter 10: Developing the Radix Sort with OpenCL
Index
  • Chapter 1: Using OpenCL
    • Introduction
    • Querying OpenCL platforms
    • Querying OpenCL devices on your platform
    • Querying OpenCL device extensions
    • Querying OpenCL contexts
    • Querying an OpenCL program
    • Creating OpenCL kernels
    • Creating command queues and enqueuing OpenCL kernels
    • Chapter 2: 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
      • Chapter 3: 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
        • Chapter 4: Using OpenCL Functions
          • Introduction
          • Storing vectors into 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
              • Chapter 7: 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
                • Chapter 8: 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

                      Raymond Tay

                      Raymond Tay has been a software developer for the past decade and his favorite programming languages include Scala, Haskell, C, and C++. He started playing with GPGPU technology since 2008, first with the CUDA toolkit by NVIDIA and OpenCL toolkit by AMD, and then Intel. In 2009, he decided to submit a GPGPU project on which he was working to the editorial committee working on the "GPU Computing Gems" to be published by Morgan Kauffmann. And though his work didn't make it to the final published work, he was very happy to have been short-listed for candidacy. Since then, he's worked on projects that use GPGPU technology and techniques in CUDA and OpenCL. He's also passionate about functional programming paradigms and their applications in cloud computing which has led him investigating on various paths to accelerate applications in the cloud through the use of GPGPU technology and the functional programming paradigm. He is a strong believer of continuous learning and hopes to be able to continue to do so for as long as he possibly can.
                      Sorry, we don't have any reviews for this title yet.

                      Code Downloads

                      Download the code and support files for this book.


                      Submit Errata

                      Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.

                      Sample chapters

                      You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                      Frequently bought together

                      OpenCL Parallel Programming Development Cookbook +    IBM SPSS Modeler Cookbook =
                      50% Off
                      the second eBook
                      Price for both: $49.65

                      Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                      What you will learn from this book

                      • How to use OpenCL
                      • Understand data partitioning and transfers in OpenCL
                      • Understand OpenCL data types
                      • Learn about OpenCL functions including math, atomic, threading model, data transfer, and so on
                      • Develop a histogram in OpenCL
                      • Learn how to develop Sobel edge detection in OpenCL for image processing
                      • Develop the Matrix Multiplication and the Sparse Matrix Vector Multiplication in OpenCL
                      • Learn to develop Bitonic sort and Radix sort in OpenCL

                      In Detail

                      OpenCL (Open Computing Language) is the first royalty-free standard for cross platform, parallel programming of modern processors found in personal computers, servers, mobiles, and embedded devices. OpenCL greatly improves speed and responsiveness for a wide spectrum of applications in numerous market categories, from gaming and entertainment to scientific and medical software. OpenCL has proved itself to be versatile in that it now runs on not only operating systems like Windows and Linux powered by Intel and AMD processors, but also on low power chips like ARM, and it has also been adopted by processor manufacturers like ARM Corp, Vivante, and Altera, among others.

                      OpenCL Parallel Programming Development Cookbook was designed to be practical so that we achieve a good balance between theory and application. Learning to program in a parallel way is relatively easy, but to be able to take advantage of all of the resources available to you efficiently is quite different. You need to be shown not only application, but also the theory behind it.

                      This book is roughly in two parts, where the first part is the fundamentals of OpenCL parallel development and the second part is the various algorithms we will explore with you. Each part is packed with many code samples and illustrations to demonstrate various concepts. The first part is essential for a beginner to not only program in parallel, but also to think in parallel and become equipped with the mental model with which to tackle parallel programming. The second part consists of seven different algorithms that the author has identified; you will learn various parallel programming techniques that experts have used in the past 60 years that are applicable to OpenCL.

                      This book will demonstrate how you think in parallel by illustrating and demonstrating programming techniques like data partitioning, thread coarsening, register tiling, data pre-fetching, and algorithm transformation. These techniques are demonstrated in the seven algorithms you’ll be shown, from image processing and solving sparse linear systems to in-memory sorting.
                      OpenCL Parallel Programming Development Cookbook combines recipes, illustrations, code, and explanations to allow you to learn the essentials of parallel programming in OpenCL, and the author has added in enough math so that the readers understand the motivation and can also lay the foundation upon which they will begin their own exploration.

                      Approach

                      OpenCL Parallel Programming Development Cookbook will provide a set of advanced recipes that can be utilized to optimize existing code. This book is therefore ideal for experienced developers with a working knowledge of C/C++ and OpenCL.

                      Who this book is for

                      This book is intended for software developers who have often wondered what to do with that newly bought CPU or GPU they bought other than using it for playing computer games; this book is also for developers who have a working knowledge of C/C++ and who want to learn how to write parallel programs in OpenCL so that life isn’t too boring.

                      Code Download and Errata
                      Packt Anytime, Anywhere
                      Register Books
                      Print Upgrades
                      eBook Downloads
                      Video Support
                      Contact Us
                      Awards Voting Nominations Previous Winners
                      Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                      Resources
                      Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software