Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Heterogeneous computing with OpenCL 2.0
Kaeli D., Mistry P., Schaa D., Zhang D., Morgan Kaufmann Publishers Inc., San Francisco, CA, 2015. 330 pp. Type: Book (978-0-128014-14-1)
Date Reviewed: Dec 9 2015

Whether we like it or not, parallel computing is here to stay. The hardware community moved to multicore processors, due to the end of Dennard scaling, the enabling technology of Moore’s law, and the software community was not yet ready for it. There are three big challenges in parallel computing. The first is the existence of many different architectures. The second is to pick a language that increases the programmer’s productivity in using the type of parallelism. The third is to find an algorithm that exposes as much parallelism as possible. OpenCL is a very good candidate to deal with the first two challenges, and the book at hand is one of the best sources to start with OpenCL.

The title of the book shows the key idea of the language and the book: heterogeneous. Heterogeneous computing means the existence of computing devices of different characteristics, for example: traditional central processing units (CPUs), graphics processing units (GPUs), or any other accelerators. The book gives a nice introduction to OpenCL and how to use it to write parallel programs for parallel heterogeneous computing systems.

The first chapter gives a good introduction to parallel programming models and the concepts of threads, granularity of parallelism, and so on.

The second chapter delves into the computer architecture of parallel machines. Since we will be writing programs for heterogeneous machines, it is important to know about this heterogeneity. Therefore, this chapter is a good, yet very brief, introduction to CPU design; GPU design; and the superscalar, very long instruction word (VLIW), single instruction multiple data (SIMD), and multithreading concepts. If you already have a good background in computer architecture, you can skip this chapter. If not, it will give you enough background to read and follow the rest of the book.

The real introduction to OpenCL starts in chapter 3. Here, you will learn the main structure of an OpenCL program: the platform model, execution model, and the memory model. The chapter ends with an example of vector addition. With the information in this chapter, you are ready to write a full OpenCL program. OpenCL is an extension to C/C++, so if you know C, it will make your life easier.

The best way to learn any language is to see it in action. This is why chapter 4 contains several examples of OpenCL programs, like histogram, image rotation, and convolution. You may need to type the code in this chapter (or download it) and execute it yourself to get a feeling for the language. Just reading this chapter will not give you the full experience.

One of the trickiest challenges of parallel programming is to distribute the work among the threads and to synchronize them. Chapter 5 discusses this issue.

Since a heterogeneous system contains a host and several other compute devices, several memories need to be dealt with and managed. This is a complicated issue and therefore takes two chapters (6 and 7).

People are always under the impression, when the issue of heterogeneous computing arises, that the host is an Intel processor and the compute device is an NVIDIA GPU. Chapter 8 discusses, in great detail, the other choice: an AMD FX-8350 CPU as host and AMD Radeon R9 as device.

After a lot of theory, it is time for more examples. Chapter 9 gives a full example of an image clustering program (the bag-of-words model). The main difference between this chapter and chapter 4 is that this chapter discusses in great detail one single application, as the case study, and shows the effect of different types of optimization on performance.

The bad news about parallel programming is that it is much harder to profile and debug than sequential programming. Chapter 10 shows different philosophies and tools for profiling and debugging OpenCL programs.

At this point, the reader must now be familiar with OpenCL as an extension to C. Chapter 11 introduces an interesting concept. It starts by stating that C++ contains high-level constructs that are developer-friendly and are missing from OpenCL. The chapter introduces C++ accelerated massive parallelism (AMP), which is an extension to C++, and shows how this extension can make these high-level constructs map to OpenCL. The title of the chapter says it all: “Mapping High-Level Languages to OpenCL 2.0.” Basically, it asks, and actually answers, this question: What will we gain if we make OpenCL the target of the compiler?

We cannot talk about programming without mentioning the web. Parallel computing is very useful for scientific number-crunching applications, but can also be useful for web applications. Chapter 12 presents WebCL, which uses OpenCL to accelerate web applications. WebCL is a JavaScript representation of OpenCL.

The book ends with a very short chapter about using OpenCL with languages other than C and C++. It gives a brief introduction to Haskell OpenCL.

I like this book, as it is easy to read and follow and is concise. The only thing it is lacking is chapter exercises to help the reader experiment. Each chapter, however, concludes with a list of references that can help researchers and developers with further reading material.

If you need to start writing parallel programs but are intimidated by the complexity, this book will not leave you any excuses!

Reviewer:  Mohamed Zahran Review #: CR144005 (1602-0087)
Bookmark and Share
  Reviewer Selected
Featured Reviewer
 
 
Distributed Programming (D.1.3 ... )
 
 
Distributed Systems (C.2.4 )
 
 
Reference (A.2 )
 
Would you recommend this review?
yes
no
Other reviews under "Distributed Programming": Date
Topics in distributed algorithms
Tel G., Cambridge University Press, New York, NY, 1991. Type: Book (9780521403764)
Sep 1 1992
Interacting processes
Francez N., Forman I., ACM Press/Addison-Wesley Publ. Co., New York, NY, 1996. Type: Book (9780201565287)
Jan 1 1997
Verification of sequential and concurrent programs (2nd ed.)
Apt K. (ed), Olderog E., Springer-Verlag New York, Inc., Secaucus, NJ, 1997. Type: Book (9780387948966)
Feb 1 1998
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy