My experiences with opencl

Source: Internet
Author: User
My experiences with opencl

Http://bbs.hpctech.com

Http://blog.csdn.net/openhero

Http://www.comp.hkbu.edu.hk /~ Kyzhao/

Blog kaiyong

2009/11/20

Perhaps for the sake of a moment of silence, I chose a quiet night. Maybe at this time, only a few computers on the lab desk were buzzing to remind me of the existence of the surroundings. 09 years is a busy year. It's almost the end of the year. In contrast, what you did in the year has nothing to do with technology ...... The pursuit of a moment of quiet, seeking for the attribution of the soul. I have been sleeping for only 4-5 hours in recent days. On a quiet night, I may find my real location ......

I have been looking at some of the features of opencl over the past two days. In this process of reflection, I want to divide the development of computer technology into two layers: high-level, cloud, and bottom-layer core, in the cloud layer, we can use a series of cluster, distributed management software and task control software to maintain the entire system. For the longitudinal core system, we have just started, opencl, as a standard of vertical core, may be a start point. Since opencl was launched, it has started to focus on it. Now, the features of opencl have learned the idea of large clusters, it also reflects the features of the longitudinal core. I prefer this programming model diagram in opencl:

I am optimistic about some concepts of opencl. For example, the cooperation of high-level multi-task operations avoids the embarrassment of writing a multi-GPU management on the Cuda layer.

For example, in the demo of opencl provided by nvidia and the oclmatrixmul example, we can see that in the process of multi-card processing, opencl can directly use multi-card to allocate their respective tasks and then combine them, in this way, all opencl resources can be used at the same time on a node, and all GPUs and CPUs can be used. For a node, you can simply use it as a node without the programmer doing too many things manually.

This model also reflects the three layers of computer clusters that I have mentioned on many occasions,

The first is the multi-machine layer. We can use the MPI Programming Model to understand this layer. It consists of multiple computers, which may include homogeneous and heterogeneous clusters, this layer is based on multiple machines.

The second layer is for each machine node. We can understand it as a CPU, multiple GPU processors in one operating system, and this node can be centrally managed by the system.

The third layer, for the CPU and GPU itself, is also the carrier of the longitudinal core.

Now I want to merge opencl into the second layer. opencl can be used as a bridge. Of course, if the underlying opencl supports database transformation, it can also be the first level or the third level. But now I only classify him as the second layer.

In fact, we can imagine the structure of a tree, a tree, a grass, a forest, a forest. Such a structure may be the structure of nature, so I like the figure above. Wonderful: PS: The fragment is also wonderful ...... I like graphics ...... Maybe it's because I learned painting for several years in elementary school ......

When we look at opencl, we cannot directly compare it with cuda, because the two are not at the same level. The current understanding of Cuda is also vague. In NVIDIA's own words, Cuda is only a platform. It is an ISA architecture, just like a X86 architecture, we only use Cuda C now. In the future, we can also use Cuda C ++, Cuda Java... We should not use Cuda and opencl for comparison. The two are different. opencl is a higher level.

...................................................... Split line

However, opencl is still in its initial stage. I have amd platforms and NVIDIA platforms, each of which supports opencl. However, the underlying libraries used are different and the effects are different. IBM also has its own opencl library. For uniform support, there is still a way to go for opencl, one year, two years, or three years? Unknown.

At least for opencl programming, it is still very painful. Everyone's things are different, and they are compiled and executed during runtime. This speed must be much slower than the original ecology. On the way of unification, opencl still has a long way to go.

............................................................

For opencl, I prefer to use it as the second layer and as the manager of a Multi-card task, but now on the same machine, it cannot support both AMD and NVIDIA to use opencl at the same time, so you still need to wait. Although I have both amd cards and NVIDIA cards on my machine, they both provide their own opencl, so this is very troublesome ~ When you need to run their own programs, you also need to change the DLL to the corresponding one.

We hope that in the future, the opencl Organizing Committee will provide a unified opencl for each vendor to provide their respective runtime libraries such as nvopencl. DLL amdopencl. the DLL is then provided by the opencl Organizing Committee. DLL to manage the DLL of these vendors, which makes it much easier for developers. I think they will do the same in the future. The format is different.

One feature of opencl is mentioned today. This is my favorite feature for opencl.

We will continue to analyze some of the features of opencl in the future. You are welcome to discuss them at any time.

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.