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
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
OpenCL Programming by Example

You're reading from   OpenCL Programming by Example A comprehensive guide on OpenCL programming with examples with this book and ebook

Arrow left icon
Product type Paperback
Published in Dec 2013
Publisher Packt
ISBN-13 9781849692342
Length 304 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
 Banger Banger
Author Profile Icon Banger
Banger
Koushik Bhattacharyya Koushik Bhattacharyya
Author Profile Icon Koushik Bhattacharyya
Koushik Bhattacharyya
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

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

Creating kernel objects

In this section we will discuss details about the kernel objects, and how kernel objects can be created using the program objects. Every program is a collection of kernels, you can consider a program object as a library of kernels. As shown in the following figure a program is associated with kernel1 and kernel2. The program is built with inputs as two devices device1 and device2. A kernel when enqueued on the command queue, the OpenCL runtime generates the binary for execution on the device. Note that each kernel can be executed on different devices. It is at the runtime the binaries are generated.

A kernel object can be created from a well formed OpenCL C program, which is built as discussed in the previous section. A kernel object is an encapsulation for a parallel executable entity. The kernel object is used to pass arguments using the clSetKernelArg API, before running the kernel using the clEnqueueNDRangeKernel API. Have a look at the following diagram:

Creating kernel objects

Kernels...

lock icon The rest of the chapter is locked
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
OpenCL Programming by Example
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £16.99/month. Cancel anytime
Modal Close icon
Modal Close icon