# Matrix multiplication shared memory

**URL:** <https://forums.developer.nvidia.com/t/matrix-multiplication-shared-memory/37515>\
**Category:** CUDA Programming and Performance\
**Created:** [April 5, 2015, 3:32am UTC](https://forums.developer.nvidia.com/t/matrix-multiplication-shared-memory/37515 "2015-04-05T03:32:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![onkar\_shedge](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@onkar\_shedge](https://forums.developer.nvidia.com/u/onkar_shedge)\
**Post date:** [April 5, 2015, 3:32am UTC](https://forums.developer.nvidia.com/t/matrix-multiplication-shared-memory/37515/1 "2015-04-05T03:32:11Z")

</div>

Do the tile dimensions and block dimensions have to be same for shared memory matrix multiplication ?

---

<div class="post-metadata">

**Author:** ![little\_jimmy](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@little\_jimmy](https://forums.developer.nvidia.com/u/little_jimmy)\
**Post date:** [April 5, 2015, 7:17am UTC](https://forums.developer.nvidia.com/t/matrix-multiplication-shared-memory/37515/2 "2015-04-05T07:17:07Z")

</div>

it is generally easier (i did not necessarily say better) to have the tile dimensions == block dimensions, i would think

running with your thought, if the tile dimension != block dimension, then block dimension \< tile dimension; i can not perceive the case of tile dimension \< block dimension

if the block dimension \< tile dimension, you would then have to steer the block over the tile, likely through iteration

why do you ask this?

---

<div class="post-metadata">

**Author:** ![onkar\_shedge](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@onkar\_shedge](https://forums.developer.nvidia.com/u/onkar_shedge)\
**Post date:** [April 5, 2015, 8:22am UTC](https://forums.developer.nvidia.com/t/matrix-multiplication-shared-memory/37515/3 "2015-04-05T08:22:59Z")

</div>

I am having hard time understanding shared memory (tiled) matrix multiplication

---

<div class="post-metadata">

**Author:** ![little\_jimmy](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@little\_jimmy](https://forums.developer.nvidia.com/u/little_jimmy)\
**Post date:** [April 5, 2015, 8:38am UTC](https://forums.developer.nvidia.com/t/matrix-multiplication-shared-memory/37515/4 "2015-04-05T08:38:57Z")

</div>

there is likely a matrix transpose buried in there  
thus, if you first understand how to do a matrix transpose, and why it is done the way it is done, the matrix multiplication should be easier to follow, i would think

---

<div class="post-metadata">

**Author:** ![Robert\_Crovella](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/robert_crovella/32/14043_2.png) [@Robert\_Crovella](https://forums.developer.nvidia.com/u/Robert_Crovella)\
**Post date:** [April 5, 2015, 1:42pm UTC](https://forums.developer.nvidia.com/t/matrix-multiplication-shared-memory/37515/5 "2015-04-05T13:42:00Z")

</div>

There’s a writeup in the programming guide that covers matrix multiplication using shared memory that may be of interest:

[url][Programming Guide :: CUDA Toolkit Documentation](https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#shared-memory%5B/url%5D)

---

<div class="post-metadata">

**Author:** ![onkar\_shedge](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@onkar\_shedge](https://forums.developer.nvidia.com/u/onkar_shedge)\
**Post date:** [April 6, 2015, 2:23am UTC](https://forums.developer.nvidia.com/t/matrix-multiplication-shared-memory/37515/6 "2015-04-06T02:23:40Z")

</div>

Thank You!!!
