Cuda Programming Interface (i)------18 weapons------the GPU revolution

Source: Internet
Author: User
Tags mathematical functions modify

Preface: The so-called 18-like weapons, different eras have different sayings, the earliest Hanwu years: spears, boring, knives, GE, Lance, whip, mace, sword, Hammer, grasping, Ji, bow, Tomahawk, axe, card, stick, gun, fork. To the three countries: nine long: knives, Spears, Ji, lance, boring, tomahawk, sticks, guns, forks; nine short: Axe, GE, brand, arrow, whip, sword, Mace, hammer, grasping. Then to the Ming and Qing dynasties: bows, crossbows, guns, knives, swords, spears, shields, axes, Tomahawk, Ji, Huang, Mace, I, 殳 (stick), fork, rake head, Kam Rope, White dozen (boxing). "Water Margin" in: spears, hammers, bows, crossbows, punch, whip, mace, sword, chain, I, axe, Tomahawk, GE, Ji, cards, rods, guns, grilled. Today's martial Arts sessions: knives, Guns, swords, spears, axes, tomahawk, hooks, forks, whips, mace, hammers, scratches, bores, sticks, lance, rods, turns, meteors. More than 400 kinds of ancient cold weapon era weapons, commonly used only so many. As with our API, there are countless APIs, you can make a few APIs for yourself, commonly used, or just so many. You can't carry a hoe or a bamboo pole to conquer the conquering. The reason why Qin can unify the Six Nations and unify the weapons provide the same model of weaponry (see Qin's history, you can find all the weapons are the same model of production, crossbow devices can be interchangeable, from the Terracotta Warriors found in the pit, the size of the error is very small, can be interchangeable), It is also a good basis for him to conquer the other six countries.

Body:

Zi Yue: 工欲善其事, its prerequisite. To do parallel algorithms with the graphics card as a general-purpose parallel processor, we need to know what kind of interface Cuda gives me, and I have to understand Cuda as a 18 weapon on a general-purpose high-performance computing platform. (If you want to develop your own drive, write your own development library-then I have to admire you very much time, presumably there will not be a lot of people want to realize a cuda bar, hehe, although to achieve a is not too difficult). The book to the last "Cuda Hardware Implementation Analysis (II)------Chice------GPU Revolution" before we talked about some simple cuda C language extension of the rules, the following is specifically to understand the cuda to listen to me oh buy how much convenient API function. When developing Cuda, Cdua also provides us with a complete set of API functions. From the beginning, think about how to put these boring API functions, or this cuda 18-like weapons clearly. If you follow the fourth chapter of Chinese translation, perhaps more people dizzy, only know that these are weapons, and do not know what weapons are used to do. From the preface, it is found that the weapons listed in skills are very similar, and their forms and contents are very rich. With long instruments, short instruments, soft instruments, double instruments, with hooks, barbed, pointed, with knives, bright, dark, attacking, preventing, striking or killing, and shooting, and blocking, and so on. When we look at the Cuda, when we see so many API functions, we first give him some classes, and then we just slowly come to the point.

First, the API summary:

1. Some common interfaces, the previous chapter has also been improved: mathematical functions, time functions, synchronization functions, atomic operation;

2. The function of controlling device is to get equipment information and manage device information. Set up that graphics card to work and get the performance of that video card. There are APIs and runtime levels for driver levels, and some will ask what is driver level and runtime level please look at the figure:

We have seen this figure in the previous chapter. I don't know, ~--! The driver level API is to provide a driver-level API that feels like a write drive. The runtime level API encapsulates some driver-level APIs and encapsulates some of the underlying APIs in some conventional way. In fact, here as we usually live in the same, the beginning of the car is not familiar with the time, to buy a car back can be opened on the OK; can be used familiar with the runtime level API on the line. Slowly, feel the car with the speaker is not good, they began to buy some original equipment back to change the car; slowly feel the whole car is a bit uncomfortable, and then slowly found that want to modify the engine, modify the shape ... began to modify the car, such a job, you have to start from the driver level to do, play a higher number of their own design drawings, their own to use some parts to the group loading. This is the relationship between the driver API and the runtime API. Runtime in the beginning of the use of the general is more convenient, slowly found if the high level (high-level) of the runtime API is inconvenient to use, the bottom (low-level) driver API to make their own modified car ...

3. Memory management, host memory, device memory, global memory, constant, shared, here will be divided into a chapter texture (texture) of the use of memory, said the real texture is also memory ~ to engage so mysterious, no way, Also had to take out to speak alone ... PS: Memory management is also divided into Runtime level API interface, and device level API interface.

4. Program operation control: Like Stream,event,context, Module, Execution controls such as we are classified to run management. There are also runtime levels and driver levels.

5. Okay, here are the remaining OpenGL and Direct3D interface functions, in fact, this is also to facilitate the use of the diagram, mainly OpenGL and DX have become the standard graphics display, so~ graphics card also have to take care of these two things, otherwise the graphics card himself ... HoHo If you really want to implement OpenGL or Dx,cuda will really head big, hoho~~ good to borrow the existing graphics display program to do on the line. Newton's people said it was standing on the shoulders of "tauren" to see farther ... We also do not have to do a lot of the cost of their own to do some hard work. Think of not enough time to see how many people lose weight, but now eat well, lose weight more people ... Fat to go to the gym to lose weight, always feel a bit strange ... Take the money to do no work, (be diligent is to lose weight) but now there are people doing experiments, the surplus of those who lose weight of the energy into electricity ... Pull away ... Mention: He also has two levels of API, there are runtime level, there are driver level.

Well, that's about the 5-part API. Here we come to explain Cuda's 18-like weapons.

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.