简体   繁体   English

CUDA中超过65535个块

[英]More than 65535 blocks in CUDA

Is there anyways to create more than 65535 blocks in CUDA? 无论如何,在CUDA中是否可以创建65535个以上的块?

If I understand correctly, the maximum number of threads in a block is 1024 (CUDA 8). 如果我理解正确,则块中的最大线程数为1024(CUDA 8)。 So, it can form a 2^16(blocks) * 2^10(threads) space. 因此,它可以形成2 ^ 16(blocks)* 2 ^ 10(threads)空间。

Is there anyways to create a 2^32 bits space? 反正有创建2 ^ 32位空间吗?

What I wanna do is create a total of 2^32 threads in total. 我想做的是总共创建2 ^ 32个线程。 A simple example is, I malloced 4GB memory, and I want to fill up the memory with counters from 1 to 0xffffffff. 一个简单的示例是,我分配了4GB内存,并且我想用1到0xffffffff的计数器填充内存。

If you read the relevant section of the documentation , you will see that your GPU supports 2^31 - 1 blocks in a one dimensional grid. 如果阅读了文档的相关部分,您将看到您的GPU在一维网格中支持2 ^ 31-1个块。 So yes there is a way to create a kernel launch with 2^32 threads if you so desire (not that it is necessary or advisable in this case). 因此,是的,如果您愿意的话,有一种方法可以创建具有2 ^ 32个线程的内核启动(在这种情况下不是必须的或不可取的)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM