Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Events
Videos
Audiobooks
Packt Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
OpenCL Programming by Example
OpenCL Programming by Example

OpenCL Programming by Example: A comprehensive guide on OpenCL programming with examples with this book and ebook

Arrow left icon
Profile Icon Ravishekhar Banger Profile Icon Koushik Bhattacharyya
Arrow right icon
€35.09 €38.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.3 (7 Ratings)
eBook Dec 2013 304 pages 1st Edition
eBook
€35.09 €38.99
Paperback
€47.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Ravishekhar Banger Profile Icon Koushik Bhattacharyya
Arrow right icon
€35.09 €38.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.3 (7 Ratings)
eBook Dec 2013 304 pages 1st Edition
eBook
€35.09 €38.99
Paperback
€47.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€35.09 €38.99
Paperback
€47.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

OpenCL Programming by Example

Left arrow icon Right arrow icon

Key benefits

  • Learn about all of the OpenCL Architecture and major APIs.
  • Learn OpenCL programming with simple examples from Image Processing, Pattern Recognition and Statistics with detailed code explanation.
  • Explore several aspects of optimization techniques, with code examples to guide you through the process
  • Understand how to use OpenCL in your problem domains

Description

Research in parallel programming has been a mainstream topic for a decade, and will continue to be so for many decades to come. Many parallel programming standards and frameworks exist, but only take into account one type of hardware architecture. Today computing platforms come with many heterogeneous devices. OpenCL provides royalty free standard to program heterogeneous hardware. This guide offers you a compact coverage of all the major topics of OpenCL programming. It explains optimization techniques and strategies in-depth, using illustrative examples and also provides case studies from diverse fields. Beginners and advanced application developers will find this book very useful. Beginning with the discussion of the OpenCL models, this book explores their architectural view, programming interfaces and primitives. It slowly demystifies the process of identifying the data and task parallelism in diverse algorithms. It presents examples from different domains to show how the problems within different domains can be solved more efficiently using OpenCL. You will learn about parallel sorting, histogram generation, JPEG compression, linear and parabolic regression and k-nearest neighborhood, a clustering algorithm in pattern recognition. Following on from this, optimization strategies are explained with matrix multiplication examples. You will also learn how to do an interoperation of OpenGL and OpenCL. "OpenCL Programming by Example" explains OpenCL in the simplest possible language, which beginners will find it easy to understand. Developers and programmers from different domains who want to achieve acceleration for their applications will find this book very useful.

Who is this book for?

If you are a beginner in parallel programming and would like to quickly accelerate your algorithms using OpenCL, this book is perfect for you! You will find the diverse topics and case studies in this book interesting and informative. You will only require a good knowledge of C programming for this book, and an understanding of parallel implementations will be useful, but not necessary.

What you will learn

  • Understand OpenCL Platform Model, Execution Model, Memory Model, and Programming Model
  • Explore the different OpenCL objects, APIs for building kernel, memory allocation, data transfer, synchronization, and many more
  • Get to grips with API explanations, featuring simple examples
  • Create image processing examples such as Image histogram and Image convolution
  • Learn optimization techniques with Matrix Multiplication and Histogram examples.
  • Develop Bitonic sort in OpenCL
  • Build JPEG decoder using OpenCL
  • Construct linear and parabolic regression equation in OpenCL
  • Compose k-nearest neighborhood clustering algorithm from pattern recognition
  • Use OpenCL with OpenGL interoperability

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 23, 2013
Length: 304 pages
Edition : 1st
Language : English
ISBN-13 : 9781849692359
Category :
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Dec 23, 2013
Length: 304 pages
Edition : 1st
Language : English
ISBN-13 : 9781849692359
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 139.97
OpenCL Programming by Example
€47.99
OpenGL 4 Shading Language Cookbook, Second Edition
€47.99
OpenGL Development Cookbook
€43.99
Total 139.97 Stars icon

Table of Contents

12 Chapters
1. Hello OpenCL Chevron down icon Chevron up icon
2. OpenCL Architecture Chevron down icon Chevron up icon
3. OpenCL Buffer Objects Chevron down icon Chevron up icon
4. OpenCL Images Chevron down icon Chevron up icon
5. OpenCL Program and Kernel Objects Chevron down icon Chevron up icon
6. Events and Synchronization Chevron down icon Chevron up icon
7. OpenCL C Programming Chevron down icon Chevron up icon
8. Basic Optimization Techniques with Case Studies Chevron down icon Chevron up icon
9. Image Processing and OpenCL Chevron down icon Chevron up icon
10. OpenCL-OpenGL Interoperation Chevron down icon Chevron up icon
11. Case studies – Regressions, Sort, and KNN Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.3
(7 Ratings)
5 star 28.6%
4 star 28.6%
3 star 0%
2 star 28.6%
1 star 14.3%
Filter icon Filter
Top Reviews

Filter reviews by




Robin T. Wernick Mar 18, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Due to the war between the GPUs reaching a terminal phase this may be the last comprehensive book published for OpenCL. Nvidia's dominance in the field of GPU programming and the prevalence of CUDA code examples are overshadowing OpenCL.However, there are many systems out there still using AMD's products and the mobile market is still OpenCL accessible. The ARM chariman says so and Sony's Experia can use it. Also, Nexus 10 and 4 devices have drivers for it. So, tablet designers attention! If you want to manage eye-popping animations or twisty-curley 3D simulations or detector displays, then pay attention to this manual.You will have to search the internet and fire up your Android NDK in some cases to maximize your mobile device to manage a display of 10,000 airplane tracks on a map of the US or merge six voice channels into one conference call.For the rest of us, it's a piece of cake, drivers for all the Nvidia and ATI cards are available. Every computing device with a supported GPU can run this code. I even ran the OpenCL starfield simulation on my MSI portable at 112 times the speed of the CPU and it was running on an Nvidia GTX 570GTM internal chip!This book will show you how to take all those simulation ideas and run any computer with a decent graphics card 100 times faster than any current CPU can manage. The book covers all the aspects of using OpenCL from buffer loading, kernel creating and executing, to synchronization and performance evaluation.OK, at 277 pages, its a bit thin for the price. But, what is the cost of fame and fortune? So, buck up and get your head wrapped around this information. The sky is the limit to your imagination here.
Amazon Verified review Amazon
lefaucheux Jul 16, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Couvre les besoins pour bien comprendre OpenCL et même plus ...Facile à assimiler que l'on soit développeurs avancés ou débutants
Amazon Verified review Amazon
milesrf Jun 17, 2016
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Looks like it will be useful once I get started with a compatible C++ compiler.
Amazon Verified review Amazon
Paul T. Miller Mar 16, 2014
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
OpenCL Programming by Example, published by Packt Publishing, is geared toward the OpenCL beginner, so if you already have experience with OpenCL the book doesn’t offer much, though I did learn some nice tips and the OpenCL 1.2 information is useful.The book starts off with some nicely detailed background information on GPU architectures – no surprise as the authors work for AMD. Information is provided on getting the necessary OpenCL libraries and runtimes installed and read for use, so there shouldn’t be any confusion about how to get started. Then comes the nicely detail sample code, which is abundant and well documented.The book covers both basic and more complex GPU algorithms, including basic image processing with OpenCL images, computing histograms with reductions, implementing JPEG compression, and even goes into advanced case studies of speeding up curve-fitting and bitonic sort. The explanations and examples are very complete.I had a few minor issues with the book though. The early chapters are nicely edited but later on there are many grammatical errors and editing mistakes. A lot of boilerplate code is repeated in the examples; it would have been nice if the authors had developed a little wrapper or framework to hide some of the more mundane stuff. And as someone who uses OpenCL for image processing, I would like to have seen more examples in that area. The image processing examples were fairly mundane and well covered elsewhere.Gripes aside, I would definitely recommend this book to a programmer who wants to learn OpenCL. This is probably the most complete book I’ve read yet on the subject. Finally, I’d encourage everyone to check out Packt’s steadily growing library of technical books. The breadth of topics there will surprise you.
Amazon Verified review Amazon
Liad Weinberger Apr 15, 2014
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
First and foremost, a proper disclosure: I was originally signed by Packt Publishing to write this book. Having failed to meet their schedule, Packt re-signed the book with the current authors and asked me to review the book during writing. I have reviewed the first couple of chapters and returned my comments, none of which were integrated in the book, nor have I received any additional chapters for review. My Amazon customer review may therefore seem biased, but I do hope the advised reader will take note and deduce, on her own accord, whether or not that is the case.And now my Amazon customer review:In the preface of the book, the section dubbed "Errata" starts with the following sentence: "Although we have taken every care to ensure the accuracy of our content, mistakes do happen". This is a rather standard statement in many technical books, and should be taken into account whenever a reader finds a mistake in the content. I find it hard to treat the book seriously though, having gone through the process of reviewing the first two chapters prior to the books publication, and ending up reading almost the exact same text in the published material, as what I have received for review and commented on.An example of such mistake that appears in the published book appears at the middle of chapter 1. In the section dubbed "Implement the SAXPY routine in OpenCL", the authors provide a code listing for an ANSI-C implementation of saxpy:void saxpy(int n, float a, float *b, float *c){ for (int i = 0; i < n; ++i) y[i] = a*x[i] + y[i];}I'm not trying to nitpick here, but this code will not compile under any C compiler, unless x and y are globally defined elsewhere, in which case the function will probably not accomplish the intended purpose. Of course it is clear that this is an editorial error, where x and y should have been b and c (or vise verse), but the fact that I commented on this while reviewing the chapter, and the error prevailed to the published version, sheds the promise of "we have taken every care to ensure the accuracy of our content" in a bad light.I would have been OK with the book if this was the only type of errors I found in it, but unfortunately they're not. The book contains a lot of information that newcomers to OpenCL, and to parallel programming in general will find interesting. It is too bad however that this information is flawed, and in some cases gives the impression that the authors, although undoubtedly used and are using OpenCL, fail to fully grasp some of the concepts or delicacies presented by the standard. Add to that the rather poor English grammar conveyed in the book (Packt's English editors were especially sloppy here), and you got yourself a recipe for producing misguided beginner programmers.Some examples are required to emphasis this claim. I'll give some from the 1st chapter, because if this early such mistakes are made, the following is of lesser importance.The 2nd paragraph in chapter 1 draws from Wikipedia's definition of parallel computing. It concludes with the following phrasing: "... large problems can often be divided into smaller ones, which are then solved concurrently (in parallel)". It is important to distinguish between the terms "parallel" and "concurrent". Although one would strive that her different "smaller" tasks run concurrently, that isn't always feasible, even as these are parallel tasks. Parallel is a logical term, describing the state of two (or more) task, having the theoretical ability of being executed at the same time. Concurrency is a physical term describing the target hardware's ability to execute parallel tasks. Parallel computing therefore, by no means, suggests that these parallel tasks will be executed concurrently.I will skip a few paragraphs, namely the rather odd list of parallel programming models in which the authors makes several errors regarding the "pros" and "cons" he chooses to list for each, and his decisions to put these models in comparison when they inherently target different levels of parallelism (local, heterogeneous systems, and distributed systems), and when these models are usually used in conjunction to one another, and complement one another, rather than compete.In the section dubbed "Introduction to OpenCL" the authors claim "OpenCL gives developers a common set of easy-to-use tools...". This is false. OpenCL provides two things, and two things only: an API (divided into two layers) which allows a host processor to manage and coordinate computations across different target devices within the system, and a programming language named OpenCL C, which the developer uses in order to write the code that will be executed on these devices. No tools. More than that, the authors are clearly confused as in a later section dubbed "OpenCL program flow" he falsely writes " An OpenCL C host code does the following...". As mentioned above, OpenCL C is used for programming the devices, whereas the host utilized the OpenCL API.I can actually list more problems found in chapter 1, but I hope that at this point you got the point. This actually gets worse in the following chapters where the authors describe the 4 models presented by the OpenCL standard. Just a small example for a mistake in the text: the authors claim "For high performance every OpenCL device has an associated local memory. This is the memory closest to the OpenCL processing element". This is false, as OpenCL does not define how local memory is to be implemented, and therefore some vendors choose to implement it over the same physical banks of their global memory (which means it operates at the same latency as global memory - providing no performance gains). Local memory with regards to OpenCL, has no performance considerations. These are the domain of device-specific targeting. As you may by now suspect, the list of false claims is much longer, but I will not indulge in it at this time.On a positive note, the set of examples provided in the book (and some are actually pretty good) allows the authors to demonstrate the usage of key concepts in OpenCL programming, which leads me to believe the authors are indeed experienced users of OpenCL, although lack a deep understanding of the different aspects of the standard (they should be, as the lead author is an AMD employee, working on OpenCL code optimizations).The bottom line is simple: if you are serious about learning OpenCL programming - keep away from this book. Not because it doesn't give good examples, but because it is filled with misguided, and at times simply wrong information, both in background topics, but also, and perhaps more concerning, the actual matter of the OpenCL standard. Do yourself a favor and pick a copy of "OpenCL in Action" (published by: Manning Publications), or "Heterogeneous Computing with OpenCL" (published by: Morgan Kaufmann), or even "The OpenCL Programming Guide" (published by: Addison-Wesley Professional), which closely resembles the standard (written by some of the standard editors...), before you pick this book.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.

Modal Close icon
Modal Close icon