Understanding of several important concepts of Cuda learning notes

Source: Internet
Author: User

Today we will talk about several cuda-related concepts in the GPU hardware structure: thread block grid warp SP Sm

SP: the most basic processing unit. The specific commands and tasks of streaming processor are processed on the SP. GPU for parallel computing, that is, multiple SPs simultaneously Process

SM: multiple SPs and other resources form an SM, streaming multiprocessor. Other resources are storage resources, shared memory, and storage devices.

Warp: The scheduling unit when the GPU executes the program. The current Cuda Warp Size is 32, and the same command is executed in different data resources in the same warp thread.

Thread --> block --> grid: When Cuda is used for programming, a grid is divided into multiple blocks, and a block is divided into multiple threads. Whether the division of tasks affects the final execution result. The division is based on task features and GPU hardware features.

The following hardware structure diagram is easy to understand (picture comes from the Internet)

The above two figures can clearly show the relationship between SM and sp.

This figure reflects the role of warp as the scheduling unit. Each time the GPU schedules 32 threads in a warp to execute the same command

Different threads correspond to different data resources.

This figure is an example of a warp schedule.

One SM will only execute the warp in one block, and the warp in other blocks will be executed after the warp in the block is executed.

When partitioning, it is best to ensure that the warp in each block is more reasonable, so that an SM can execute the warp in turn to improve

Efficiency. In addition, when allocating blocks, we need to allocate a reasonable number of blocks based on the number of GPUs SM, so that the GPU Sm can be used to improve the efficiency.

Utilization. When allocating resources, you must also consider the resources of the same thread block. Do not make sure the corresponding resources are insufficient.

Reprinted on http://blog.csdn.net/pizi0475/article/details/7630248

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.