By Matthew Scarpino
OpenCL in Action is a radical, hands-on presentation of OpenCL, with a watch towards displaying builders tips to construct high-performance functions in their personal. It starts by way of proposing the center options in the back of OpenCL, together with vector computing, parallel programming, and multi-threaded operations, after which courses you step by step from easy information buildings to complicated functions.
About the Technology
Whatever procedure you have got, it most likely has extra uncooked processing strength than you are utilizing. OpenCL is a high-performance programming language that maximizes computational strength by means 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 truth of establishing high-performance purposes utilizing OpenCL. It first publications you thru the basic information constructions in an intuitive demeanour. Then, it explains suggestions for high-speed sorting, photograph processing, matrix operations, and quickly Fourier rework. The publication concludes with a deep examine the all-important topic of pics acceleration. quite a few hard examples offer you alternative ways to scan with operating code.
A historical past in C or C++ is useful, yet no previous publicity to OpenCL is needed.
buy of the print booklet comes with a suggestion of a unfastened PDF, ePub, and Kindle book from Manning. additionally to be had is all code from the booklet.
- Learn OpenCL step through step
- Tons of annotated code
- Tested algorithms for max performance
Table of Contents
- Introducing OpenCL
- Host programming: basic info structures
- Host programming: information move and partitioning
- Kernel programming: info forms and gadget memory
- Kernel programming: operators and features
- Image processing
- Events, profiling, and synchronization
- Development with C++
- Development with Java and Python
- General coding principles
- Reduction and sorting
- Matrices and QR decomposition
- Sparse matrices
- Signal processing and the short Fourier transform
- Combining OpenCL and OpenGL
- Textures and renderbuffers
PART 1 FOUNDATIONS OF OPENCL PROGRAMMING
PART 2 CODING sensible ALGORITHMS IN OPENCL
PART three ACCELERATING OPENGL WITH OPENCL
Read Online or Download OpenCL in Action: How to Accelerate Graphics and Computation PDF
Similar Computers books
Electronic layout and desktop structure takes a special and smooth method of electronic layout. starting with electronic common sense gates and progressing to the layout of combinational and sequential circuits, Harris and Harris use those basic development blocks because the foundation for what follows: the layout of an exact MIPS processor.
Grasp the Linux instruments that might Make You a extra efficient, potent Programmer The Linux Programmer's Toolbox is helping you faucet into the immense selection of open resource instruments on hand for GNU/Linux. writer John Fusco systematically describes the main valuable instruments on hand on such a lot GNU/Linux distributions utilizing concise examples that you should simply alter to fulfill your wishes.
Robert Sedgewick has completely rewritten and considerably multiplied and up to date his renowned paintings to supply present and entire insurance of vital algorithms and knowledge constructions. Christopher Van Wyk and Sedgewick have constructed new C++ implementations that either convey the tools in a concise and direct demeanour, and likewise supply programmers with the sensible ability to check them on genuine purposes.
The target of laptop studying is to software desktops to take advantage of instance info or prior adventure to unravel a given challenge. Many winning purposes of desktop studying already exist, together with structures that examine prior revenues info to foretell client habit, optimize robotic habit in order that a job could be accomplished utilizing minimal assets, and extract wisdom from bioinformatics information.
Additional info for OpenCL in Action: How to Accelerate Graphics and Computation
It-ebooks. information 155 Profiling occasions queue = clCreateCommandQueue(context, machine, CL_QUEUE_PROFILING_ENABLE, NULL); clEnqueueReadBuffer(queue, data_buffer, precise, zero, sizeof(data), information, zero, NULL, &timing_event); clGetEventProfilingInfo(timing_event, CL_PROFILING_COMMAND_START, sizeof(time_start), &time_start, NULL); clGetEventProfilingInfo(timing_event, CL_PROFILING_COMMAND_END, sizeof(time_end), &time_end, NULL); read_time = time_end - time_start; Now that you just know the way profiling works, let’s utilize it. First, we’ll make certain no matter if it’s swifter to move info utilizing read/write operations or reminiscence maps. moment, we’ll examine how the timing of kernel execution alterations as you upload extra work-items. 7. three. 2 Profiling information move As defined in bankruptcy three, there are how you can move facts among a number and a tool. you could name features that enqueue read/write instructions reminiscent of clEnqueueReadBuffer or clEnqueueWriteImage. however, you could map a reminiscence item to host reminiscence with a functionality like clEnqueueMapBuffer. Then, as soon as you’ve processed the mapped facts, you could unmap the reminiscence sector with clEnqueueUnmapMemObject. For dossier entry, reminiscence mapping frequently presents better functionality. yet what approximately OpenCL information move? we will discover utilizing occasion profiling. The code within the following directory comprises an new release loop that assessments the common time taken by means of the instructions enqueued by means of clEnqueueReadBuffer as opposed to clEnqueueMapBuffer. The PROFILE_READ macro determines which technique could be used to move info. to avoid wasting area, the mistake dealing with code has been got rid of. directory 7. 6 Profiling info move: profile_read. c ... total_time = zero. 0f; for(i=0; i