我试图通过使用常量参数但获得错误来分配共享内存.我的内核看起来像这样:
__global__ void Kernel(const int count) { __shared__ int a[count]; }
我收到一个错误说
错误:表达式必须具有常量值
伯爵是常量!为什么我收到此错误?我怎么能绕过这个?
c c++ cuda gpu-shared-memory
c ×1
c++ ×1
cuda ×1
gpu-shared-memory ×1