[Csdn] 13 typical cases of opencl in the computer field

Source: Internet
Author: User

Http://www.csdn.net/article/2013-10-29/2817319-the-application-areas-opencl-can-be-used

Abstract:Which type of algorithm is faster when the accelerator and opencl are used? Professor Wu Feng from the Virginia University of Technology and his team gave an example of an algorithm list, sharing 13 typical cases that opencl is often used in the computer field.

Which algorithm can map GPU and vector processor the best? In other words, which type of algorithm is faster when the accelerator and opencl are used?

Professor Wu Feng from the Virginia University of Technology and his team gave an example of an algorithm list, sharing 13 typical cases that opencl is often used in the computer field. Some people call it the 13 "Little Giants" in the opencl computing field ".

1. Dense linear algebra (dense linear algebra)

Classical vector and matrix operations can traditionally be divided into 1 (vector/vector), 2 (matrix/vector), 3 (matrix/matrix ), it is widely used.

Application Scope:

  • Linear Algebra: LAPACK and Atlas.
  • Clustering Algorithms (Clustering Algorithm)/data-mining (Data Mining): streamcluster, K-means algorithm.
Normally, a loop is executed, but in most cases it is easy to perform parallel computing in opencl.

Ii. sparse linear algebra (sparse linear algebra)

Multiplication is mainly composed of zero matrices. The computation is more efficient by moving non-zero elements around the diagonal matrix.

Application Scope:

  • Finite element analysis.
  • Partial Differential Equation.

There are two ways to use opencl: solve this problem by performing Column Operations, which leads to a large amount of overhead. The second method is to use the successive approximation of some columns, minimizes the function error.

Iii. spectral methods (spectral method)

Various structures of substances have their own characteristic spectra. The spectral analysis method is to use the feature spectra to study the material structure or determine the chemical composition.

Spectral methods can be used to solve the problems of ordinary differential equations (ODES), partial differential equations (PDES), and value-added problems including differential equations.

Application Scope:

  • Fluid Dynamics.
  • Quantum mechanics.
  • Weather forecast.

Opencl provides various FFT Implementation methods for each hardware architecture. The trick is tuning.

Iv. N-body Methods

The N-body method is a dynamics system that simulates particles. Generally, under the influence of physics, such as gravity, there are two calculation methods (A affects B, and B also affects ), the entire system will be updated again after each round.

The basic algorithm is O (n ^ 2 ). Optimization of large systems can be achieved through neighbor-Administration (adjacent management) and away from particle computing, where the runtime method is desirable.

Application Scope:

  • Astronomy: cosmology (for example, the formation of a galaxy ).
  • Computational chemistry: molecular dynamics (such as protein folding) and molecular simulation.
  • Physics: fluid dynamics, plasma physics.

Opencl can implement tens of thousands of particles per second.

V. structured grids (structured grid)

Structured grid refers to the fact that all internal points in the grid area have the same adjacent units. All elements in a structured or regular grid have the same size, such as square modules. The calculation method depends on the adjacent irregular mesh.

Application Scope:

  • Image processing: Gaussian Image Blurring Gaussian image blur.
  • Physics simulations: Transient Thermal Differential Equation Solver.
  • Finite element method (finite element method ).

With opencl, the grid has rules, so the ing is quite easy. The problem to be solved is how to achieve the connectivity between adjacent grids.

6. Unstructured Grids (Unstructured Grid)

All the grids are irregular, and different elements have different numbers of adjacent elements. This group has a lot of overlap and backtracking. Each element in the grid can be a two-dimensional polygon or three-dimensional polygon. There is no implicit connectivity between each element.

Application Scope:

  • Computational Fluid Dynamics.
  • Belief Propagation (confidence Propagation ).

The difficulty is to map irregular grids on the hardware.

VII. Map-Reduce & Monte Carlo

Each process can run independently of other processes, so there is no connectivity between adjacent processes. In a large data set and computing-intensive algorithm, GPUs can combine big data solutions, such as hadoop.

Application Scope:

  • Monte-Carlo (Monte Carlo Method): PI (circumference rate) calculation method, collision simulation, and sequence comparison.
  • Distributed search.

Since the communication between nodes is the smallest, this is also one of the fastest ways to use GPU.

VIII. Combinational Logic)

A combined logical circuit is a logical circuit. Its steady-state output at any time point is only related to the value of the input variable at that time point, but not the value of the input variable before that time point. This algorithm involves a large amount of data and can use bit-level operations to perform simple operations.

Application Scope:

  • Computing checksums.
  • Calculation verification method, CRCs.
  • Encryption and decryption.
  • Hash.
  • Hamming weight.

Not all hardware is suitable for this type of operation. Therefore, device selection is crucial.

9. Graph Traversal)

Graph tracing accesses all nodes in a specific way to update/check values. Tree tracing is a special case of graph tracing, which involves indirect search and microcomputing.

Application Scope:

  • Search: Deep-first search and breadth-first search. Find a connection component in all nodes.
  • Sorting: Fast sorting.
  • Serialization/deserialization.
  • Maze generation.
  • Collision Detection.

When using opencl, the most important thing is to keep the core program busy.

10. Dynamic Programming (Dynamic Planning)

It is a method used in mathematics, computer science, and economics to solve complex problems by decomposing the original problem into a relatively simple subproblem.

Dynamic Planning is often used to solve simple overlapping subproblems and the problem of optimal sub-structure. Many Dynamic Programming Problem operations fill in representative problem fields in the grid, which retains the final answer in the grid.

Application Scope:

  • Graphics problems: Floyd's allpairs, shortest path, Bellman-Ford algorithm.
  • Sequence Comparison: Needleman-Wunsch, Smith-Waterman.
"Dynamic" application, which is optimized during runtime to achieve optimal performance.

11. Backtracking)

The Backtracking Method (exploration and backtracking) is an optimization search method that searches forward based on the optimization conditions to achieve the goal. However, when you find that the previous selection is not optimal or fails to reach the target, you can return to the previous step and re-select the target. This technology will return to the backtracing method if you fail to get the target, vertices that meet backtracing conditions are called backtracing points ".

The common solution for this group is branch demarcation (divide and conquer ).

Application Scope:

  • Intelligent games: N-queens, crossword game, jiugongge game, and PEG solitaire.
  • Travel Salesman ).
  • Knapsack, subset, problem, and partition problem.
  • Integer linear programming.
  • Boolean satisfiability (Boolean operation ).
  • Combinatorial optimisation (combination optimization ).

The most important thing in opencl is to avoid large branches.

12. probabilistic graphical models (probability Graph Model)

This graph combines uncertainty (probability) and logical structure (independent constraints) to represent complex and real-world phenomena.

Application Scope:

  • Bayesian Networks: belief networks, concept networks, causal networks, and knowledge maps.
  • Hidden Markov models (Hidden Markov Model ).
  • Neural Networks.

As more and more processes need to update the same node (atomic science is a typical case), it takes a lot of time.

13. finite state machines (finite state machine)

A finite state machine is a mathematical model of finite states and the transfer and action between these States.

It has three features: the total number of States is limited; at any time, it is only in one State; under certain conditions, it will change from one State (Transition) to another State.

Mathematical computing models are often used to design computer programs and time series logic circuits. It is often seen as an abstract machine that can be used in a limited number of States.

Application Scope:

  • Video decoding, parsing, and compression.
  • Data Mining.
  • Find the loop mode.
From: streamcomputing

This article is compiled for csdn and cannot be reproduced without permission. If you need to reprint it, please contact market # csdn.net (# Replace @)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.