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 subbuffer objects


There may be situations when you may want to create a subbuffer out of the existing buffer object. For this purpose OpenCL provides the API.

cl_mem clCreateSubBuffer (cl_mem buffer,cl_mem_flags flags,cl_buffer_create_type buffer_create_type,const void *buffer_create_info,cl_int *errcode_ret)

The clCreateSubBuffer function can be used to create a new partial buffer object (referred to as a subbuffer object) from an existing OpenCL cl_mem buffer object.

Parameter name

Description

buffer

Must be a valid buffer object created using the clCreateBuffer API and cannot itself be a subbuffer object.

flags

This parameter takes the same values as described in the table of cl_mem_flags shown earlier. The values taken by the flags variable should not get into any mutual exclusion condition with the flags of the original buffer. For example, if the original cl_mem object buffer is created with CL_MEM_HOST_WRITE_ONLY and the flag specified is CL_MEM_HOST_READ_ONLY, then the...

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 $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon