Jump to content
  • Advertisement
Sign in to follow this  
cozzie

Compute shader and nr of threads, typo or misunderstanding?

This topic is 743 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all,

I'm currently working my way through luna's d3d11 book.
Now arrived in the chapter on compute shaders.

What I've learned/ understood:
- in the CS you can create the shader from x*y*z threads, where the result is ideally a multiple of 32 (cuda) or 64 (wavefront ATI)
- in the application you create A thread groups, if for example you want to compute/ process 1000 pixels of a texture, you'll need this number of groups: A = ceil(1000 / x*y*z).
- the final number is the number of disparch thread ID's (summed up for all thread groups)
- a multiprocessor can handle x thread groups, to fully use available computing power, create x*2 groups, so a stalled multiprocessor can fall back to the other thread group. With 16 multiprocessors, this would be (max) 32 thread groups
- shared memory can be max 32kb, so 16kb per thread group, because if you have 2 per multiprocessor, there wouldn't be enough with >2*16kb

My question;
In the book it says that with a 3x2 grid of thread groups, with 10x10 threads per group, you will get a total of 60 dispatch thread ID's.

Is this a typo? The reason I ask is that I think it should be 600 (3*2*100).

Share this post


Link to post
Share on other sites
Advertisement
Thanks, this clears things up.
From your explanation on the multiprocessors I read that it's a good idea to create a scalable approach to be better ready for the future

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!