Cuda learning ing.

Source: Internet
Author: User

0. IntroductionThis paper records the learning process of cuda-just beginning to touch the GPU-related things, including graphics, computing, parallel processing mode, first from the concept of things to start, and then combined with practice began to learn. Cuda feel no authoritative books, development tools change is faster, so the total feeling is not very practical. So this article is from the perspective of beginners, from ignorance began to explore the process. Of course, in the course of learning to avoid the emergence of conceptual understanding of the error, the description of the ambiguity is not accurate place also hope to point out, mutual encouragement ~

Concept of 1.CUDA

model of 2.CUDACuda's run model, allowing each kernel in host to be executed on the graphics hardware (GPU) in the same way as the thread grid (GRID).  Each thread grid contains more than one line Cheng (block), and each line Cheng contains multiple threads (thread). Thread is the most basic operating unit in the UCDA model, performing the most basic program directives. Each group of collaborative thread is attributed to a block. Shared storage is allowed inside the block, and the upper limit for thread can be 512. A grid is a set of blocks that share global storage space. Each grid corresponds to a kernel task (the core task performed on the GPU). WARP:GPU executes the program (multi-processor) dispatch unit, the current Cuda Warp size of 32, the same in a Warp thread, executing different data under the same instruction. Because the number of multi-processor is different, all the thread in the one by one block of a pair does not necessarily run all at the same time, but all the thread within each warp must be running at the same time. Therefore, when we define blocksize, it should be an integer multiple of warp size, that is, blocksize should be an integer multiple of 32. Theoretically, the more the number of thread, the more you can make up for a single thread to read data latency, but when the more tread, the number of registers per thread can be less, serious time can even cause kernel to fail to start. Each block should therefore contain at least 64 thread, a general number of 128 or 256, depending on the number of multi-processor. A multi-processor can run up to 768 thread at a time, but each multi-processor contains up to 8 blocks, so to maintain 100% utilization, block and size should maintain the following settings: 2 blocks X 384 threads 3 blocks x THREADS4 blocks x 192 threads6 blocks x $ threads 8 blocks x threads

Cuda learning ing:

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.