Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9108397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:47:57+00:00 2026-06-17T02:47:57+00:00

Let’s suppose I have a kernel call with a 2D grid, like so: dim3

  • 0

Let’s suppose I have a kernel call with a 2D grid, like so:

dim3 dimGrid(x, y); // not important what the actual values are
dim3 dimBlock(blockSize, blockSize);
myKernel <<< dimGrid, dimBlock >>>();

Now I’ve read that multidimensional grids are merely meant to ease programming – the underlying hardware will only ever use 1D linearly cached memory (unless you use texture memory, but that’s not relevant here).

My question is: In what order will the threads be assigned to the grid indices during warp scheduling? Will they be assigned horizontally (“iterate” x, then y) or vertically (“iterate” y, then x)? This might be relevant to improve memory coalescing, depending on how I access my memory in the kernel.

To make it more clear, let’s say the following represents the thread’s IDs as applied to my (imaginary) grid with a “horizontal” distribution:

[ 0  1  2  3 ]
[ 4  5  6  7 ]
[ 8  9 10 11 ]
[ ...        ]

And “vertical” distribution would be:

[ 0  4  8 .. ]
[ 1  5  9 .. ]
[ 2  6 10 .. ]
[ 3  7 11 .. ]

I hope you can see how this might affect coalescing: With each variant, there will be a specific optimal way to access my device memory buffer.

Unfortunately, I have not found any detailed information on this yet..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T02:47:58+00:00Added an answer on June 17, 2026 at 2:47 am

    Horizontal and vertical is arbitrary. But threads do have a well-defined x, y, and z dimension. Threads are grouped into warps in the order of x, y, z. So a 16×16 threadblock will have threads in the following order in the first 32-thread warp:

    warp lane: thread ID (x,y,z)

    • 0: 0,0,0
    • 1: 1,0,0
    • 2: 2,0,0
    • 3: 3,0,0
    • …
    • 15: 15,0,0
    • 16: 0,1,0
    • 17: 1,1,0
    • 18: 2,1,0
    • 19: 3,1,0
    • …
    • 31: 15,1,0

    The above is also the exact pattern you would have for a threadblock dimension of 16,2 which would fill one warp.

    For a dimension that does not fill a warp completely, such as 8,3 (or 8,29, which will leave the final warp only partially full of active threads), the assignment order follows the same pattern. The rapidly varying dimension as you assign threads to warps is the x dimension, just as you see above. The next most rapidly varying dimension is y, then z.

    The programming guide also explains how to number threads in order. When threads are numbered in that order, the first 32 threads belong to the first warp, the next 32 threads belong to the next warp, etc.

    If there is only a partial complement (i.e. less than 32) of threads available for a particular last warp in the above numbering order, then the last warp (only) will consist of fewer than 32 active threads.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's have an example like below: package xliiv.sandbox; import android.app.Activity; import android.os.Bundle; import android.util.Log;
Let's say I have a sortable list like this: $(.song-list).sortable({ handle : '.pos_handle', axis
Let's say I have a string like this: var str = /abcd/efgh/ijkl/xxx-1/xxx-2; How do
Let's say I have pseudocode like this: main() { BOOL b = get_bool_from_environment(); //get
Let's say I have an actor like this (Using Akka 2.1 with Scala 2.10):
Let's suppose that we have multi-site CMS and every website in this CMS having
Let suppose I have this class diagram in UML: How can I do, in
Let's say that I have classes like this: public class Parent { public int
Let say you have an XML like this: <?xml version=1.0 encoding=utf-8?> <Class HashCode=307960707> <Person>
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.