By Matthew Scarpino

OpenCL in motion is a radical, hands-on presentation of OpenCL, with an eye fixed towards displaying builders the way to construct high-performance purposes in their personal. It starts via offering the center ideas in the back of OpenCL, together with vector computing, parallel programming, and multi-threaded operations, after which courses you step by step from easy info buildings to complicated capabilities.

Show description

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

Best algorithms books

Algorithms For Interviews

Algorithms For Interviews (AFI) goals to aid engineers interviewing for software program improvement positions in addition to their interviewers. AFI contains 174 solved set of rules layout difficulties. It covers middle fabric, resembling looking and sorting; normal layout ideas, comparable to graph modeling and dynamic programming; complex issues, akin to strings, parallelism and intractability.

Scalable Optimization via Probabilistic Modeling: From Algorithms to Applications (Studies in Computational Intelligence, Volume 33)

This ebook focuses like a laser beam on one of many most well liked subject matters in evolutionary computation over the past decade or so: estimation of distribution algorithms (EDAs). EDAs are a huge present method that's resulting in breakthroughs in genetic and evolutionary computation and in optimization extra commonly.

Abstract Compositional Analysis of Iterated Relations: A Structural Approach to Complex State Transition Systems

This self-contained monograph is an built-in research of regular platforms outlined through iterated relatives utilizing the 2 paradigms of abstraction and composition. This comprises the complexity of a few state-transition structures and improves knowing of advanced or chaotic phenomena rising in a few dynamical platforms.

Estimation of Distribution Algorithms: A New Tool for Evolutionary Computation

Estimation of Distribution Algorithms: a brand new software for Evolutionary Computation is dedicated to a brand new paradigm for evolutionary computation, named estimation of distribution algorithms (EDAs). This new classification of algorithms generalizes genetic algorithms via exchanging the crossover and mutation operators with studying and sampling from the likelihood distribution of the simplest participants of the inhabitants at every one generation of the set of rules.

Extra info for OpenCL in Action: How to Accelerate Graphics and Computations

Example text

3 Matrix-vector multiplication sends it to the first device it finds. The following listing shows what this host code looks like. Notice that the source code is written in the C programming language. c file in this book’s example code. \n"); } clReleaseMemObject(mat_buff); clReleaseMemObject(vec_buff); Set kernel arguments Execute kernel The OpenCL standard and extensions 13 clReleaseMemObject(res_buff); clReleaseKernel(kernel); clReleaseCommandQueue(queue); clReleaseProgram(program); clReleaseContext(context); return 0; } This source file is long but straightforward.

In OpenCL, a context identifies a set of devices—not every possible device, but only those selected to work together. Contexts make it possible to create command queues, the structures that allow hosts to send kernels to devices. 7 discusses command queues in detail. At the time of this writing, the devices in a context must be provided by the same platform. That is, you can’t create a context containing both AMD and Nvidia devices—you have to create a different context for each platform. But a host application can manage devices using more than one context, and it can even create multiple contexts from devices in a single platform.

Appendix A explains just about everything you may want to know about SDKs. 1 Creating platform structures Each cl_platform_id structure represents a different OpenCL implementation (called a platform) installed on the host. If you’ve installed two SDKs, you’ll have two platforms installed, and your code will detect two cl_platform_id structures. In code, working with platforms is a two-step process. First you need to allocate memory for one or more cl_platform_id structures. Then you need to call clGetPlatformIDs to initialize these structures.

Download PDF sample

Rated 4.89 of 5 – based on 34 votes