Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Book Reviews

Submission + - Book Review: OpenCL Programming Guide

asgard4 writes: Statistics
Title: OpenCL Programming Guide
Author: Aaftab Munshi, Benedict R. Gaster, Timothy G. Mattson, James Fung, Dan Ginsburg
Pages: 603
Rating: 9/10
Publisher: Addison-Wesley Pearson Education
ISBN-10: 0-321-74964-2
ISBN-13: 978-0-321-74964-2
Price: $54.99 US
Book Website: http://openclprogrammingguide.com/
Summary: A solid introduction to programming with OpenCL.

In recent years GPUs have become powerful computing devices whose power is not only used to generate pretty graphics on screen but also to perform heavy computation jobs that were exclusively reserved for high performance super computers in the past. Considering the vast diversity and rapid development cycle of GPUs from different vendors, it is not surprising that the ecosystem of programming environments has flourished fairly quickly as well, with multiple vendors, such as NVIDIA, AMD, and Microsoft, all coming up with their own solutions on how to program GPUs for more general purpose computing (also abbreviated GPGPU) applications.
With OpenCL (short for Open Computing Language) the Khronos Group provides an industry standard for programming heavily parallel, heterogeneous systems with a language to write so-called kernels in a C-like language. The OpenCL Programming Guide gives you all the necessary knowledge to get started developing high-performing, parallel applications for such systems with OpenCL 1.1.

The authors of the book certainly know what they are talking about. Most of them have been involved in the standardization effort that went into OpenCL. Munshi, for example, is the editor of the OpenCL specification. So all the information in the book is first-hand knowledge from experts in OpenCL. The reader is expected to be familiar with the C programming language and basic programming concepts. Some experience in parallelizing problems is a benefit but not a requirement.

The book consist of two major parts. The first part is a detailed description of the OpenCL C language and the API used by the host to control the execution of programs written in that language. The second part is comprised of various case studies that show OpenCL in action.
The authors get straight to the point in the introduction, discussing the conceptual foundations of OpenCL in detail. They explain what kernels are (basically functions that are scheduled for execution on a compute device), how the kernel execution model works, how the host manages the command queues that schedule memory transfers or kernel execution on compute devices, and the memory model.

While this first chapter is all prose, the second chapter dives right in with some code and a first HelloWorld example. The following chapters introduce more and more of the OpenCL language and API step-by-step. All API functions are described in somewhat of a reference style with a lot of detail, including possible error codes. However, the text is not a reference. There is always a good explanation with examples or short code listings, the only notable exception being chapter three, which presents the OpenCL C language. A few more examples would have made the text less dry in this chapter.

An important chapter is chapter nine on events and synchronization between multiple compute devices and the host. This chapter is important because — as any experienced parallel programmer knows — getting synchronization right is often tricky but obviously essential for correct execution of a parallel program.

An interesting feature in OpenCL is the built-in interoperability with OpenGL and, surprisingly, Direct3D. Various functions in the OpenCL API allow creating buffers from OpenGL/Direct3D objects, such as textures or vertex buffers, that can be used by an OpenCL kernel. This opens up interesting possibilities for doing a lot more work on the GPU in graphics applications, such as running a fluid simulation on the GPU in OpenCL, which directly writes its results into vertex buffers or textures to be used directly for rendering without the host CPU having to intervene.

Before delving into the case studies the book briefly discusses the embedded profile that is available for OpenCL and the standardized C++ API that the Khronos Group provides in addition to the regular OpenCL API (which is defined exclusively as C functions). The C++ API makes using some of the OpenCL objects a little bit easier and somewhat nicer.

The second part of the book contains various interesting case studies that show off what OpenCL can be used for, such as computing a sobel filter or a histogram for an image, computing FFTs, doing cloth simulation, or multiplying dense and sparse matrices. The choice and variety of case studies is definitely interesting and most will be immediately applicable to the reader when going forward developing applications using OpenCL. All the code for the examples and the case studies in the book are available for download on the book's website.

Overall, the OpenCL Programming Guide succeeds in being a great introduction to OpenCL 1.1. The book covers all of the specification and more, has an easy to read writing style and yet provides all the necessary details to be an all-encompassing guide to OpenCL. The good selection of case studies makes the book even more appealing and demonstrates what can be done with real-life OpenCL code (and also how it needs to be optimized to get the best performance out of current OpenCL platforms, such as GPUs).

About the review author:
Martin Ecker has been involved in real-time graphics programming for more than 15 years and works as a professional game developer for Sony Computer Entertainment America in sunny San Diego, California.
Crime

Submission + - Craigslist Bank Robber Flees in Getaway Inner Tube

Hugh Pickens writes writes: "Cnet reported earlier in October on an ingenious bank robber in Seattle who used Craigslist to recruit a crowd of unwitting participants to facilitate his escape. In the days leading up to his robbery of an armored car, the perpetrator placed an ad on Craigslist seeking workers for a purported road-maintenance project paying $28.50 an hour and instructed all applicants to show up at the same time and location wearing a yellow vest, safety goggles, respirator mask and blue shirt — the criminal’s exact outfit the day of the robbery. After overpowering the armored car driver with pepper spray, the suspect grabbed a duffel bag filled with cash, ran past a dozen similarly dressed innocents and made his escape at a local creek where he floated away in his pre-positioned getaway inner tube down Woods Creek toward the Skykomish River. 911 calls reporting the robbery described the suspect as being a construction worker in a yellow vest so when police arrived on scene, they had numerous robbery suspects from which to choose. "We did some research after the actual event, and we believe the ad was not a credible ad and that it may have been an attempt to get people dressed like the suspect into the area," says Monroe Police Department spokeswoman Debbie Willis."
HP

Submission + - HP announces first ARM-based server (techworld.com.au)

angry tapir writes: "HP has become the first major vendor to announce an ARM-based server. The servers use a 32-bit processor from ARM licensee Calxeda. Calxeda's chip includes an ARM processor and consumes as little as 1.5 watts of power. HP's ARM-based server design packs 288 Calxeda chips into a 4U rack-mount server with shared power, cooling and management infrastructure."
Iphone

Submission + - Unlock iPhone 4 (unlockiphone.co)

An anonymous reader writes: Find out how you can unlock your iPhone 4, 3GS, 3G or 2G with the ultimate iPhone unlocking solution online.
EU

Submission + - Europe Sending a Probe to the Sun (bbc.co.uk) 2

Mindflux0 writes: The European Union is going forward with the proposed Solar Orbiter, a space probe designed to study the sun. The probe will orbit closer to the sun than any other man-made object at a sizzling 42 million km. It's planned to launch in 2017 for close to a billion euros.

Submission + - Specific Media's Big Plans For MySpace (itworld.com)

itwbennett writes: "Specific Media, which bought MySpace for $35 million, has big plans for the faded social media site. Mainly, it wants to become the Hulu of music (and somehow having Justin Timberlake as an investor will help make that happen). From All Things Digital's Liz Gannes:

Specific is telling marketers that the new Myspace’s vision is 'to become the #1 online community music destination,' and its mission is to feed the energy of youth culture everywhere.'

"

Firefox

Submission + - Firefox Advises Users to Disable McAfee Plugin (itworld.com)

itwbennett writes: "Mozilla is advising Firefox users to disable McAfee's ScriptScan software, saying that it could cause 'stability or security problems.' ScriptScan, which ships with McAfee's VirusScan antivirus program, is designed to keep Web surfer's safe by scanning for any malicious scripting code that might be running in the browser. But according to Mozilla it has an unintended side-effect: It can cause Firefox to crash... a lot."

Submission + - Detect major earthquakes? (washingtonpost.com)

hcs_$reboot writes: According to a Japanese researcher, the electrons count escalation high in the atmosphere could indicate that a major earthquake is going to happen within 30~40 minutes.
That phenomenon was observed before three earthquakes since 2004.
If confirmed, the earthquake detection system could save thousands of lives.

Slashdot Top Deals

You must realize that the computer has it in for you. The irrefutable proof of this is that the computer always does what you tell it to do.

Working...