CUDA + DX10 Note: The form of the block internal thread matrix

Source: Internet
Author: User

Today, using the thread in Cuda block to modify the hexahedral of two for loops has been wrong.

// For     (int i= 0;i<boxpointnums-1;i++)//    {        int j= threadidx.x;         int i= threadidx.y; // For         (int j = 0; j<boxpointnums-1;j++)        {

Is that the incorrect sequence of I and J affects the coordinate position when calculating vertex coordinates:

   Boxverticescuda[gridindexnumstop]. Pos,-boxlength/2+widthblock*j, Boxtopy, (Boxlength/2-lengthblock*i));

The Thread.x Thread.y in the block, the execution sequence should be the opposite of the For loop , resulting in the final drawing error.     It is mostly just beginning with a for ... for draw, which causes the row and column order to be fixed, after being modified to Cuda, a row and column matching is required. If it is Cuda drawn, in for...for may not.

The source code, such as 2015,5,1,

CUDA + DX10 Note: The form of the block internal thread matrix

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.