請問 CUDA 每個 block 可使用多少 shared memory - 顯卡

Table of Contents

NVIDIA 一張顯卡上有 1~20 個 stream multiprocessor (SM),視顯卡型號而異
每個 SM 有 16KB 大小的 shared memory

一份 CUDA 程式,
假設會產生了 1024 個 blocks,每個 block 有 128 threads

因為不知道(或不能預期)顯卡 SM 的個數
也不知道幾個 block 會被配置給一個 SM

coding 的時候,要怎麼知道
kernel 裡可以宣告多少 shared memory 來用呢?

感謝各位

--

All Comments