Download E-books OpenCL in Action: How to Accelerate Graphics and Computation PDF

By Matthew Scarpino

Summary

OpenCL in Action is an intensive, hands-on presentation of OpenCL, with a watch towards exhibiting builders find out how to construct high-performance purposes in their personal. It starts through featuring the center recommendations at the back of OpenCL, together with vector computing, parallel programming, and multi-threaded operations, after which courses you step by step from basic facts constructions to complicated functions.

About the Technology

Whatever procedure you could have, it most likely has extra uncooked processing strength than you are utilizing. OpenCL is a high-performance programming language that maximizes computational strength by way of executing on CPUs, pictures processors, and different number-crunching units. it truly is ideal for speed-sensitive initiatives like vector computing, matrix operations, and images acceleration.

About this Book

OpenCL in Action blends the speculation of parallel computing with the sensible fact of establishing high-performance functions utilizing OpenCL. It first courses you thru the basic facts constructions in an intuitive demeanour. Then, it explains suggestions for high-speed sorting, photo processing, matrix operations, and quick Fourier remodel. The publication concludes with a deep examine the all-important topic of pictures acceleration. a variety of tough examples offer you other ways to test with operating code.

A heritage in C or C++ is beneficial, yet no past publicity to OpenCL is needed.

buy of the print e-book comes with a suggestion of a unfastened PDF, ePub, and Kindle booklet from Manning. additionally on hand is all code from the e-book.

What's Inside

  • Learn OpenCL step via step
  • Tons of annotated code
  • Tested algorithms for max performance

***********

Table of Contents

    PART 1 FOUNDATIONS OF OPENCL PROGRAMMING
  1. Introducing OpenCL
  2. Host programming: basic facts structures
  3. Host programming: information move and partitioning
  4. Kernel programming: facts varieties and equipment memory
  5. Kernel programming: operators and features
  6. Image processing
  7. Events, profiling, and synchronization
  8. Development with C++
  9. Development with Java and Python
  10. General coding principles
  11. PART 2 CODING sensible ALGORITHMS IN OPENCL
  12. Reduction and sorting
  13. Matrices and QR decomposition
  14. Sparse matrices
  15. Signal processing and the short Fourier transform
  16. PART three ACCELERATING OPENGL WITH OPENCL
  17. Combining OpenCL and OpenGL
  18. Textures and renderbuffers

Show description

Read Online or Download OpenCL in Action: How to Accelerate Graphics and Computation PDF

Best Algorithms books

Automating Open Source Intelligence: Algorithms for OSINT (Computer Science Reviews and Trends)

Algorithms for Automating Open resource Intelligence (OSINT) provides info at the collecting of knowledge and extraction of actionable intelligence from brazenly to be had resources, together with information publicizes, public repositories, and extra lately, social media. As OSINT has functions in crime combating, state-based intelligence, and social examine, this e-book presents fresh advances in textual content mining, internet crawling, and different algorithms that experience resulted in advances in tools which may mostly automate this method.

Computational Geometry: An Introduction Through Randomized Algorithms

This advent to computational geometry is designed for newcomers. It emphasizes basic randomized tools, constructing uncomplicated rules with the aid of planar purposes, starting with deterministic algorithms and transferring to randomized algorithms because the difficulties turn into extra complicated. It additionally explores larger dimensional complicated purposes and gives routines.

Algorithms and Data Structures: With Applications to Graphics and Geometry (BCS Practitioner)

In accordance with the authors' large educating of algorithms and knowledge constructions, this article goals to teach a pattern of the highbrow calls for required through a working laptop or computer technological know-how curriculum, and to offer matters and result of lasting worth, principles that might outlive the present new release of pcs. pattern routines, many with options, are integrated during the e-book.

Extra resources for OpenCL in Action: How to Accelerate Graphics and Computation

Show sample text content

Along with pace, neighborhood reminiscence additionally has the benefit of being to be had to each workitem in a work-group. this implies you could have a number of work-items processing a similar info, thereby bettering functionality. Synchronization is a crucial precedence in lots of purposes, and bankruptcy 7 discusses work-item synchronization intimately. four. 6. 2 inner most arguments deepest reminiscence can purely be accessed by means of a unmarried work-item, and this reminiscence entry is even quicker than neighborhood reminiscence entry. yet inner most reminiscence is generally small in comparison to neighborhood and worldwide reminiscence. in contrast to neighborhood facts, a kernel’s deepest information should be initialized by means of a bunch software. To configure this in code, the host must make the final parameter of clSetKernelArg a pointer to primitive facts: an int*, float*, char*, and so forth. www. it-ebooks. details 92 bankruptcy four Kernel programming: information varieties and machine reminiscence for instance, feel you will have each one work-item that allows you to entry its personal reproduction of an int referred to as num_iterations, and also you wish the preliminary price to be four. you could specify this within the host program with the subsequent code: int num_iterations = four; clSetKernelArg(kernel, zero, sizeof(num_iterations), &num_iterations); Then your kernel functionality should still glance just like the next: __kernel void proc_data(int num_iters, ... ) { ... } There are issues to notice approximately this function’s argument. First, it has no tackle house specifier like __global or __local. which means num_iters could be kept within the device’s inner most tackle area and every work-item may have its personal replica. moment, in contrast to some other kernel argument we’ve visible, num_iters isn’t a pointer. inner most kernel arguments can’t be references—they has to be uncomplicated primitives like int and waft. If you’re acquainted with the excellence among pass-by-value info and pass-byreference info in common C, it may be transparent that global/constant facts is handed to kernels via reference and personal info is handed to kernels by means of worth. If the host sends information to the kernel as a part of a reminiscence item, it could possibly learn again the converted info. If the host sends information as an easy primitive, it can’t learn that info again. inner most kernel arguments needs to be primitives, yet they don’t must be scalars. you may also ship facts that the kernel may still interpret as a vector variety. for instance, let’s say you need to ship 4 floats to the kernel, and also you wish the floats to be positioned within the device’s inner most handle house to allow them to be accessed fast. Then, within the host program, you may upload code similar to the subsequent: glide nums[4] = {0. 0f, 1. 0f, 2. 0f, three. 0f}; clSetKernelArg(kernel, zero, sizeof(nums), nums); The kernel can’t entry the non-public information as a four-element array simply because deepest arguments can’t be guidelines. however the info should be accessed as a float4 vector, as proven within the following kernel functionality: __kernel void proc_data(float4 values, ... ) { ... } the connection among clSetKernelArg and the arguments of a kernel functionality is among the most vital yet least understood features of OpenCL.

Rated 4.06 of 5 – based on 34 votes